27 const unsigned char *buf)
29 cairo_surface_t *surf;
34 G_debug(1,
"Cairo_Bitmap: %d %d %d", ncols, nrows, threshold);
36 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,5,8) 37 stride = cairo_format_stride_for_width(CAIRO_FORMAT_A8, ncols);
40 stride = (ncols + (MULTIPLE - 1)) / MULTIPLE * MULTIPLE;
42 data =
malloc(stride * nrows);
43 surf = cairo_image_surface_create_for_data(
44 data, CAIRO_FORMAT_A8, ncols, nrows, stride);
46 if (cairo_surface_status(surf) != CAIRO_STATUS_SUCCESS)
49 for (i = 0; i < nrows; i++)
50 memcpy(&data[i * stride], &buf[i * ncols], ncols);
52 cairo_surface_mark_dirty(surf);
55 cairo_surface_destroy(surf);
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void Cairo_Bitmap(int ncols, int nrows, int threshold, const unsigned char *buf)
Draw bitmap.
GRASS cairo display driver - header file.
int G_debug(int, const char *,...) __attribute__((format(printf