21 static unsigned int get_2(
const unsigned char **q)
23 const unsigned char *p = *q;
24 unsigned int n = (p[0] << 0) | (p[1] << 8);
30 static unsigned int get_4(
const unsigned char **q)
32 const unsigned char *p = *q;
33 unsigned int n = (p[0] << 0) | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
39 static int read_bmp_header(
const unsigned char *p)
57 if (get_4(&p) != (
unsigned int)
png.
width)
59 if (get_4(&p) != (
unsigned int)-
png.
height)
93 if (fread(header,
sizeof(header), 1, input) != 1)
96 if (!read_bmp_header(header))
101 int b = fgetc(input);
102 int g = fgetc(input);
103 int r = fgetc(input);
104 int a = fgetc(input);
unsigned int png_get_color(int r, int g, int b, int a)
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
GRASS png display driver - header file.