19 #define min(a, b) ((a) < (b) ? (a) : (b))
22 #define max(a, b) ((a) > (b) ? (a) : (b))
33 const unsigned char *buf)
43 for (j = j0; j < j1; j++) {
46 for (i = i0; i < i1; i++) {
48 unsigned int k = buf[j * ncols + i];
51 if (k > (
unsigned int)threshold)
62 for (j = j0; j < j1; j++) {
65 for (i = i0; i < i1; i++) {
67 unsigned int k = buf[j * ncols + i];
70 unsigned int a,
r,
g,
b;
74 a = (a0 * (255 - k) + a1 * k) / 255;
75 r = (r0 * (255 - k) + r1 * k) / 255;
76 g = (g0 * (255 - k) + g1 * k) / 255;
77 b = (b0 * (255 - k) + b1 * k) / 255;
unsigned int png_get_color(int r, int g, int b, int a)
void png_get_pixel(unsigned int pixel, int *r, int *g, int *b, int *a)
void PNG_draw_bitmap(int ncols, int nrows, int threshold, const unsigned char *buf)
Draw bitmap.
GRASS png display driver - header file.