35 gdImageDestroy(us->
data);
57 us->
data = gdImageCreateFromPng(us->
f);
62 us->
data = gdImageCreateFromGif(us->
f);
67 us->
data = gdImageCreateFromJpeg(us->
f);
83 gdImagePtr im2 = gdImageCreate(im->sy, im->sx);
85 gdImageCopyRotated(im2, im, im2->sx / 2., im2->sy / 2.,
86 0, 0, im->sx, im->sy, rotation);
95 gdImagePtr im2, im = job->
context;
105#ifdef HAVE_PANGOCAIRO
111 int x, y, stride, width, height;
114 cairo_surface_t *surface;
124 surface = cairo_image_surface_create_for_data (
data, CAIRO_FORMAT_ARGB32,
125 width, height, stride);
128 if (im->saveAlphaFlag) {
129 for (y = 0; y < height; y++) {
130 for (x = 0; x < width; x++) {
131 px = gdImageTrueColorPixel(im, x, y);
132 *
data++ = gdTrueColorGetBlue(px);
133 *
data++ = gdTrueColorGetGreen(px);
134 *
data++ = gdTrueColorGetRed(px);
135 *
data++ = (0x7F-gdTrueColorGetAlpha(px)) << 1;
140 for (y = 0; y < height; y++) {
141 for (x = 0; x < width; x++) {
142 px = gdImageTrueColorPixel(im, x, y);
143 *
data++ = gdTrueColorGetBlue(px);
144 *
data++ = gdTrueColorGetGreen(px);
145 *
data++ = gdTrueColorGetRed(px);
152 for (y = 0; y < height; y++) {
153 for (x = 0; x < width; x++) {
154 px = gdImagePalettePixel(im, x, y);
155 *
data++ = im->blue[px];
156 *
data++ = im->green[px];
157 *
data++ = im->red[px];
158 *
data++ = (px==im->transparent)?0x00:0xff;
164 cairo_translate(cr, b.
LL.
x, -b.
UR.
y);
165 cairo_scale(cr, (b.
UR.
x - b.
LL.
x)/(us->
w), (b.
UR.
y - b.
LL.
y)/(us->
h));
166 cairo_set_source_surface (cr, surface, 0, 0);
170 cairo_surface_destroy(surface);
179 gdImagePtr im =
NULL;
189 gvputs(job,
"/myctr 0 def\n");
190 gvputs(job,
"/myarray [\n");
192 for (y = 0; y <
Y; y++) {
194 for (x = 0; x <
X; x++) {
195 px = gdImageTrueColorPixel(im, x, y);
197 gdTrueColorGetRed(px),
198 gdTrueColorGetGreen(px),
199 gdTrueColorGetBlue(px));
205 for (y = 0; y <
Y; y++) {
207 for (x = 0; x <
X; x++) {
208 px = gdImagePalettePixel(im, x, y);
218 gvputs(job,
"/myproc { myarray myctr get /myctr myctr 1 add def } def\n");
222 (b.
LL.
x + (b.
UR.
x - b.
LL.
x) * (1. - (job->
dpi.
x) / 96.) / 2.),
223 (b.
LL.
y + (b.
UR.
y - b.
LL.
y) * (1. - (job->
dpi.
y) / 96.) / 2.));
233 gvputs(job,
"{myproc} false 3 colorimage\n");
247#ifdef HAVE_PANGOCAIRO
303#ifdef HAVE_PANGOCAIRO
#define X(prefix, name, str, type, subtype,...)
void gvusershape_file_release(usershape_t *us)
bool gvusershape_file_access(usershape_t *us)
int gvputs(GVJ_t *job, const char *s)
void gvprintf(GVJ_t *job, const char *format,...)
static gvloadimage_engine_t engine_ps
static void gd_loadimage_ps(GVJ_t *job, usershape_t *us, boxf b, bool filled)
static void gd_freeimage(usershape_t *us)
static gvloadimage_engine_t engine
gvplugin_installed_t gvloadimage_gd_types[]
static void gd_loadimage_gd(GVJ_t *job, usershape_t *us, boxf b, bool filled)
static gdImagePtr gd_loadimage(GVJ_t *job, usershape_t *us)
static gdImagePtr gd_rotateimage(gdImagePtr im, int rotation)
static gvloadimage_engine_t engine_cairo
void(* datafree)(usershape_t *us)