Skip to content

Commit

Permalink
Merge branch 'master' into cpt-grayscale
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulWessel authored Dec 5, 2023
2 parents 4eacaee + a0a8f41 commit b543217
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
11 changes: 7 additions & 4 deletions doc/rst/source/image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,13 @@ Optional Arguments

**-G**\ [*color*][**+b**\|\ **f**\|\ **t**]
Change certain pixel values to another color or make them transparent.
For 1-bit images you can specify an alternate *color* for the background (**+b**)
or the foreground (**+f**) pixels, or give no color to make those pixels
transparent. Alternatively, for color images you can select a single *color*
that should be made transparent instead (**+t**). This option may be repeated with different settings.

- **+b**: For 1-bit images you can specify an alternate *color* for the background pixels.
Give no color to make those pixels transparent.
- **+f**: For 1-bit images you can specify an alternate *color* for the foreground pixels.
Give no color to make those pixels transparent.
- **+t**: For color images you can select a single *color* that should be made transparent
instead. This option may be repeated with different settings.

.. _-I:

Expand Down
2 changes: 0 additions & 2 deletions src/gsfml/fzblender.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ EXTERN_MSC int GMT_fzblender (void *V_API, int mode, void *args) {

if (Ctrl->E.active) { /* Now apply the secondary filter */
struct GMT_DATASET *D = NULL;
char s_in_string[GMT_LEN256], s_out_string[GMT_LEN256];
/* Retrieve the primary filtering results */
if ((D = GMT_Read_VirtualFile (API, destination)) == NULL) {
Return (API->error);
Expand All @@ -485,7 +484,6 @@ EXTERN_MSC int GMT_fzblender (void *V_API, int mode, void *args) {
if (GMT_Open_VirtualFile (API, GMT_IS_DATASET, GMT_IS_LINE, GMT_OUT|GMT_IS_REFERENCE, NULL, destination) == GMT_NOTSET) {
Return (API->error);
}
//sprintf (buffer, "-F%s -E -N%d %s ->%s", Ctrl->E.args, POS_DR, s_in_string, s_out_string);
sprintf (buffer, "-F%s -N%d %s ->%s", Ctrl->E.args, POS_DR, source, destination);
GMT_Report (API, GMT_MSG_DEBUG, "Args to secondary filter1d: %s\n", buffer);
if ((status = GMT_Call_Module (API, "filter1d", GMT_MODULE_CMD, buffer))) {
Expand Down
4 changes: 2 additions & 2 deletions src/psimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static int usage (struct GMTAPI_CTRL *API, int level) {
GMT_Usage (API, -2, "Change some pixels to be transparent (or to optional <color>) depending on selected modifier (repeatable):");
GMT_Usage (API, 3, "+b Replace background color by <color> or make it transparent (1-bit images only).");
GMT_Usage (API, 3, "+f Replace foreground color by <color> or make it transparent (1-bit images only).");
GMT_Usage (API, 3, "+t Indicate the given <color> should be made transparent [no transparency].");
GMT_Usage (API, 3, "+t Indicate the given <color> should be made transparent (for color images) [no transparency].");
GMT_Usage (API, 1, "\n-I Invert 1-bit images (does not affect 8 or 24-bit images).");
GMT_Option (API, "J-Z,K");
GMT_Usage (API, 1, "\n-M Force color -> monochrome image using YIQ-transformation.");
Expand Down Expand Up @@ -219,7 +219,7 @@ static int parse (struct GMT_CTRL *GMT, struct PSIMAGE_CTRL *Ctrl, struct GMT_OP
n_errors++;
}
break;
case 'G': /* Background/foreground color for 1-bit images */
case 'G': /* Background/foreground color for 1-bit images [Repeatable] */
Ctrl->G.active = true;
if ((p = strstr (opt->arg, "+b"))) /* Background color (or transparency) selected */
ind = PSIMAGE_BGD, k = 0, p[0] = '\0';
Expand Down
6 changes: 3 additions & 3 deletions src/seis/grdshake.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ static void Free_Ctrl (struct GMT_CTRL *GMT, struct SHAKE_CTRL *C) { /* Dealloca
gmt_M_free(GMT, C);
}

#if 0
static char set_unit_and_mode (char *arg, unsigned int *mode) {
unsigned int k = 0;
*mode = GMT_GREATCIRCLE; /* Default is great circle distances */
Expand All @@ -100,6 +101,7 @@ static char set_unit_and_mode (char *arg, unsigned int *mode) {
}
return (arg[k]);
}
#endif

static int usage (struct GMTAPI_CTRL *API, int level) {
const char *name = gmt_show_name_and_purpose (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_PURPOSE);
Expand Down Expand Up @@ -150,7 +152,7 @@ static int parse (struct GMT_CTRL *GMT, struct SHAKE_CTRL *Ctrl, struct GMT_Z_IO
*/

unsigned int n_errors = 0, n_files = 0, pos = 0;
char txt_a[GMT_LEN256] = {""}, p[GMT_LEN16] = {""};
char p[GMT_LEN16] = {""};
struct GMT_OPTION *opt = NULL;
struct GMTAPI_CTRL *API = GMT->parent;

Expand Down Expand Up @@ -266,9 +268,7 @@ EXTERN_MSC int GMT_grdshake (void *V_API, int mode, void *args) {
struct GMT_DATASET *Lin = NULL;
struct GMT_GRID *G = NULL;
struct GMT_GRID *Grid[3] = {NULL, NULL, NULL};
struct GMT_RECORD *Out = NULL;
struct GMT_Z_IO io;
struct GMT_OPTION *opt = NULL;
struct SHAKE_CTRL *Ctrl = NULL;
struct GMT_CTRL *GMT = NULL, *GMT_cpy = NULL;
struct GMT_OPTION *options = NULL;
Expand Down
7 changes: 3 additions & 4 deletions src/seis/grdvs30.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ static int parse (struct GMT_CTRL *GMT, struct VS30_CTRL *Ctrl, struct GMT_Z_IO
* returned when registering these sources/destinations with the API.
*/

unsigned int n_errors = 0, n_files = 0, pos = 0;
char txt_a[GMT_LEN256] = {""}, p[GMT_LEN16] = {""}, *pch;
unsigned int n_errors = 0, n_files = 0;
char p[GMT_LEN16] = {""}, *pch;
struct GMT_OPTION *opt = NULL;
struct GMTAPI_CTRL *API = GMT->parent;

Expand Down Expand Up @@ -258,14 +258,13 @@ EXTERN_MSC int GMT_grdvs30 (void *V_API, int mode, void *args) {
unsigned int row, col, j, nr, k;
uint64_t ij;
int error = 0;
char cmd[GMT_LEN256] = {""}, data_grd[GMT_LEN16] = {""};
char cmd[GMT_LEN256] = {""};
char crat_grd[GMT_LEN16] = {""}, mask_grd[GMT_LEN16] = {""}, grad_grd[GMT_LEN16] = {""};
float crat, lg;
double (*table)[4], tvs[2], vv, wesn[4];

struct GMT_GRID *G = NULL, *Ggrad = NULL, *Gcrat = NULL, *Gland = NULL, *Gout = NULL;
struct GMT_Z_IO io;
struct GMT_OPTION *opt = NULL;
struct VS30_CTRL *Ctrl = NULL;
struct GMT_CTRL *GMT = NULL, *GMT_cpy = NULL;
struct GMT_OPTION *options = NULL;
Expand Down

0 comments on commit b543217

Please sign in to comment.