24 int i_width, i_height, maxval;
30 if (fscanf(input,
"P6 %d %d %d", &i_width, &i_height, &maxval) != 3)
37 "expected: %dx%d got: %dx%d"),
40 mask_name[strlen(mask_name) - 2] =
'g';
42 mask = fopen(mask_name,
"rb");
47 if (fscanf(mask,
"P5 %d %d %d", &i_width, &i_height, &maxval) != 3)
48 G_fatal_error(
_(
"Cairo: invalid input mask file <%s>"), mask_name);
53 G_fatal_error(
_(
"Cairo: input mask file has incorrect dimensions: "
54 "expected: %dx%d got: %dx%d"),
73 if (a > 0 && a < 0xFF) {
79 row[
x] = (a << 24) | (
r << 16) | (
g << 8) | (
b << 0);
void cairo_read_ppm(void)
GRASS cairo display driver - header file.
void G_free(void *)
Free allocated memory.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
char * G_store(const char *)
Copy string to allocated memory.