47static void gd_format(
GVJ_t * job)
52 unsigned int width = job->width;
53 unsigned int height = job->height;
55 memset(&gd_context, 0,
sizeof(gd_context));
61 im = gdImageCreateTrueColor(width, height);
62 switch (job->device.id) {
65 for (y = 0; y < height; y++) {
66 for (x = 0; x < width; x++) {
71 im->tpixels[y][x] = (
color & 0xffffff) | ((0x7f -
alpha) << 24);
78#define TRANSPARENT 0x7ffffffe
80 gdImageColorTransparent(im, TRANSPARENT);
81 gdImageAlphaBlending(im,
false);
82 for (y = 0; y < height; y++) {
83 for (x = 0; x < width; x++) {
89 im->tpixels[y][x] = (
color & 0xffffff) | ((0x7f -
alpha) << 24);
91 im->tpixels[y][x] = TRANSPARENT;
97 switch (job->device.id) {
100 gdImageTrueColorToPalette(im, 0, 256);
101 gdImageGifCtx(im, &gd_context.
ctx);
116#define JPEG_QUALITY -1
117 gdImageJpegCtx(im, &gd_context.
ctx, JPEG_QUALITY);
123 gdImageTrueColorToPalette(im, 0, 256);
124 gdImagePngCtx(im, &gd_context.
ctx);
129 gdImageGd(im, job->output_file);
133#define GD2_CHUNKSIZE 128
135#define GD2_COMPRESSED 2
136 gdImageGd2(im, job->output_file, GD2_CHUNKSIZE, GD2_COMPRESSED);
143 int black = gdImageColorResolveAlpha(im, 0, 0, 0, gdAlphaOpaque);
144 gdImageWBMPCtx(im,
black, &gd_context.
ctx);
182#ifdef HAVE_PANGOCAIRO
185 {
FORMAT_GIF,
"gif:cairo", 10, &gd_engine, &device_features_gd},
186 {
FORMAT_WBMP,
"wbmp:cairo", 5, &gd_engine, &device_features_gd},
190 {
FORMAT_JPEG,
"jpe:cairo", 5, &gd_engine, &device_features_gd},
191 {
FORMAT_JPEG,
"jpeg:cairo", 5, &gd_engine, &device_features_gd},
192 {
FORMAT_JPEG,
"jpg:cairo", 5, &gd_engine, &device_features_gd},
196 {
FORMAT_PNG,
"png:cairo", 5, &gd_engine, &device_features_gd},
199 {
FORMAT_GD,
"gd:cairo", 5, &gd_engine, &device_features_gd_no_writer},
200 {
FORMAT_GD2,
"gd2:cairo", 5, &gd_engine, &device_features_gd_no_writer},
static gd_context_t * get_containing_context(gdIOCtx *ctx)
static double len(glCompPoint p)
#define GVDEVICE_NO_WRITER
#define GVDEVICE_DOES_TRUECOLOR
#define GVDEVICE_BINARY_FORMAT
static void color(Agraph_t *g)
size_t gvwrite(GVJ_t *job, const char *s, size_t len)
int gvdevice_gd_putBuf(gdIOCtx *context, const void *buffer, int len)
void gvdevice_gd_putC(gdIOCtx *context, int C)
gvplugin_installed_t gvdevice_gd_types[]
static const char black[]