Skip to content

Commit

Permalink
Update gmt_macros.h
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulWessel committed Dec 27, 2023
1 parent 9267591 commit 077dc6b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gmt_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@
/*! Get a color component from a n*4 column-oriented colormap */
#define gmt_M_get_rgba(map,index,color,n) map[index + (color)*(n)]

/*! Copy a 4-element rgb in 0-255 range to normalized 0-1 range */
#define gmt_M_cp_rgb_normalize(rgb_normalized, rgb_integer) {for (unsigned int c = 0; c < 4; c++) rgb_normalized[c] = gmt_M_is255(rgb_integer[c]); }
/*! Macros to do conversion to inches with PROJ_LENGTH_UNIT as default */

/*! Copy a 4-element rgb in normalized 0-1 range to integer 0-255 range */
#define gmt_M_cp_rgb_integer(rgb_integer, rgb_normalized) {for (unsigned int c = 0; c < 4; c++) rgb_integer[c] = gmt_M_s255(rgb_normalized[c]); }

/*! Set a color component in a n*4 column-oriented colormap */
#define gmt_M_set_rgba(map,index,color,n,value) map[index + (color)*(n)] = (value)

Expand Down

0 comments on commit 077dc6b

Please sign in to comment.