34 #ifdef HAVE_PANGOCAIRO
45 static void gd_format(
GVJ_t * job)
48 unsigned int x, y, color,
alpha;
50 unsigned int width = job->
width;
51 unsigned int height = job->
height;
56 ctx.tell = (
void*)job;
58 im = gdImageCreateTrueColor(width, height);
62 for (y = 0; y < height; y++) {
63 for (x = 0; x < width; x++) {
67 alpha = (color >> 25) & 0x7f;
68 im->tpixels[y][x] = (color & 0xffffff) | ((0x7f - alpha) << 24);
75 #define TRANSPARENT 0x7ffffffe
77 gdImageColorTransparent(im, TRANSPARENT);
78 gdImageAlphaBlending(im,
FALSE);
79 for (y = 0; y < height; y++) {
80 for (x = 0; x < width; x++) {
84 if ((alpha = (color >> 25) & 0x7f) >= 0x20)
86 im->tpixels[y][x] = (color & 0xffffff) | ((0x7f - alpha) << 24);
88 im->tpixels[y][x] = TRANSPARENT;
97 gdImageTrueColorToPalette(im, 0, 256);
98 gdImageGifCtx(im, &ctx);
113 #define JPEG_QUALITY -1
114 gdImageJpegCtx(im, &ctx, JPEG_QUALITY);
120 gdImageTrueColorToPalette(im, 0, 256);
121 gdImagePngCtx(im, &ctx);
130 #define GD2_CHUNKSIZE 128
132 #define GD2_COMPRESSED 2
133 gdImageGd2(im, job->
output_file, GD2_CHUNKSIZE, GD2_COMPRESSED);
140 int black = gdImageColorResolveAlpha(im, 0, 0, 0, gdAlphaOpaque);
141 gdImageWBMPCtx(im, black, &ctx);
186 #ifdef HAVE_PANGOCAIRO
189 {
FORMAT_GIF,
"gif:cairo", 10, &gd_engine, &device_features_gd},
190 {
FORMAT_WBMP,
"wbmp:cairo", 5, &gd_engine, &device_features_gd},
194 {
FORMAT_JPEG,
"jpe:cairo", 5, &gd_engine, &device_features_gd},
195 {
FORMAT_JPEG,
"jpeg:cairo", 5, &gd_engine, &device_features_gd},
196 {
FORMAT_JPEG,
"jpg:cairo", 5, &gd_engine, &device_features_gd},
200 {
FORMAT_PNG,
"png:cairo", 5, &gd_engine, &device_features_gd},
203 {
FORMAT_GD,
"gd:cairo", 5, &gd_engine, &device_features_gd_no_writer},
204 {
FORMAT_GD2,
"gd2:cairo", 5, &gd_engine, &device_features_gd_no_writer},
209 {
FORMAT_XBM,
"xbm:cairo", 5, &gd_engine, &device_features_gd},
#define GVDEVICE_BINARY_FORMAT
gvplugin_active_device_t device
#define GVDEVICE_NO_WRITER
void gvdevice_gd_putC(gdIOCtx *context, int C)
int gvdevice_gd_putBuf(gdIOCtx *context, const void *buffer, int len)
gvplugin_installed_t gvdevice_gd_types[]
size_t gvwrite(GVJ_t *job, const char *s, size_t len)
#define GVDEVICE_DOES_TRUECOLOR