26 void Cairo_Bitmap(
int ncols,
int nrows,
int threshold,
const unsigned char *buf)
28 cairo_surface_t *surf;
33 G_debug(1,
"Cairo_Bitmap: %d %d %d", ncols, nrows, threshold);
35 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 5, 8)
36 stride = cairo_format_stride_for_width(CAIRO_FORMAT_A8, ncols);
39 stride = (ncols + (MULTIPLE - 1)) / MULTIPLE * MULTIPLE;
41 data =
malloc(stride * nrows);
42 surf = cairo_image_surface_create_for_data(data, CAIRO_FORMAT_A8, ncols,
45 if (cairo_surface_status(surf) != CAIRO_STATUS_SUCCESS)
48 for (i = 0; i < nrows; i++)
49 memcpy(&data[i * stride], &buf[i * ncols], ncols);
51 cairo_surface_mark_dirty(surf);
54 cairo_surface_destroy(surf);
void Cairo_Bitmap(int ncols, int nrows, int threshold, const unsigned char *buf)
Draw bitmap.
GRASS cairo display driver - header file.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf