php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
gd.h
Go to the documentation of this file.
1#ifndef GD_H
2#define GD_H 1
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#ifdef HAVE_CONFIG_H
9#include "config.h"
10#endif
11
12#include "php_compat.h"
13
14#define GD_MAJOR_VERSION 2
15#define GD_MINOR_VERSION 0
16#define GD_RELEASE_VERSION 35
17#define GD_EXTRA_VERSION ""
18#define GD_VERSION_STRING "2.0.35"
19
20#ifdef NETWARE
21/* default fontpath for netware systems */
22#define DEFAULT_FONTPATH "sys:/java/nwgfx/lib/x11/fonts/ttf;."
23#define PATHSEPARATOR ";"
24#elif defined(_WIN32)
25/* default fontpath for windows systems */
26#define DEFAULT_FONTPATH "c:\\winnt\\fonts;c:\\windows\\fonts;."
27#define PATHSEPARATOR ";"
28#else
29/* default fontpath for unix systems */
30#define DEFAULT_FONTPATH "/usr/X11R6/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/truetype:/usr/X11R6/lib/X11/fonts/TTF:/usr/share/fonts/TrueType:/usr/share/fonts/truetype:/usr/openwin/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/Type1:."
31#define PATHSEPARATOR ":"
32#endif
33
34/* gd.h: declarations file for the graphic-draw module.
35 * Permission to use, copy, modify, and distribute this software and its
36 * documentation for any purpose and without fee is hereby granted, provided
37 * that the above copyright notice appear in all copies and that both that
38 * copyright notice and this permission notice appear in supporting
39 * documentation. This software is provided "AS IS." Thomas Boutell and
40 * Boutell.Com, Inc. disclaim all warranties, either express or implied,
41 * including but not limited to implied warranties of merchantability and
42 * fitness for a particular purpose, with respect to this code and accompanying
43 * documentation. */
44
45/* stdio is needed for file I/O. */
46#include <stdio.h>
47#include "gd_io.h"
48
49/* va_list needed in gdErrorMethod */
50#include <stdarg.h>
51
52/* The maximum number of palette entries in palette-based images.
53 In the wonderful new world of gd 2.0, you can of course have
54 many more colors when using truecolor mode. */
55
56#define gdMaxColors 256
57
58/* Image type. See functions below; you will not need to change
59 the elements directly. Use the provided macros to
60 access sx, sy, the color table, and colorsTotal for
61 read-only purposes. */
62
63/* If 'truecolor' is set true, the image is truecolor;
64 pixels are represented by integers, which
65 must be 32 bits wide or more.
66
67 True colors are repsented as follows:
68
69 ARGB
70
71 Where 'A' (alpha channel) occupies only the
72 LOWER 7 BITS of the MSB. This very small
73 loss of alpha channel resolution allows gd 2.x
74 to keep backwards compatibility by allowing
75 signed integers to be used to represent colors,
76 and negative numbers to represent special cases,
77 just as in gd 1.x. */
78
79#define gdAlphaMax 127
80#define gdAlphaOpaque 0
81#define gdAlphaTransparent 127
82#define gdRedMax 255
83#define gdGreenMax 255
84#define gdBlueMax 255
85#define gdTrueColorGetAlpha(c) (((c) & 0x7F000000) >> 24)
86#define gdTrueColorGetRed(c) (((c) & 0xFF0000) >> 16)
87#define gdTrueColorGetGreen(c) (((c) & 0x00FF00) >> 8)
88#define gdTrueColorGetBlue(c) ((c) & 0x0000FF)
89#define gdEffectReplace 0
90#define gdEffectAlphaBlend 1
91#define gdEffectNormal 2
92#define gdEffectOverlay 3
93#define gdEffectMultiply 4
94
95#define GD_TRUE 1
96#define GD_FALSE 0
97
98#define GD_EPSILON 1e-6
99
100/* This function accepts truecolor pixel values only. The
101 source color is composited with the destination color
102 based on the alpha channel value of the source color.
103 The resulting color is opaque. */
104
105int gdAlphaBlend(int dest, int src);
106int gdLayerOverlay(int dst, int src);
107int gdLayerMultiply(int dest, int src);
108
164
165/* define struct with name and func ptr and add it to gdImageStruct gdInterpolationMethod interpolation; */
166
167/* Interpolation function ptr */
168typedef double (* interpolation_method )(double);
169
170typedef struct gdImageStruct {
171 /* Palette-based image pixels */
172 unsigned char ** pixels;
173 int sx;
174 int sy;
175 /* These are valid in palette images only. See also
176 'alpha', which appears later in the structure to
177 preserve binary backwards compatibility */
183 /* For backwards compatibility, this is set to the
184 first palette entry with 100% transparency,
185 and is also set and reset by the
186 gdImageColorTransparent function. Newer
187 applications can allocate palette entries
188 with any desired level of transparency; however,
189 bear in mind that many viewers, notably
190 many web browsers, fail to implement
191 full alpha channel for PNG and provide
192 support for full opacity or transparency only. */
202 int *style;
204 /* New in 2.0: thickness of line. Initialized to 1. */
205 int thick;
206 /* New in 2.0: alpha channel for palettes. Note that only
207 Macintosh Internet Explorer and (possibly) Netscape 6
208 really support multiple levels of transparency in
209 palettes, to my knowledge, as of 2/15/01. Most
210 common browsers will display 100% opaque and
211 100% transparent correctly, and do something
212 unpredictable and/or undesirable for levels
213 in between. TBB */
215 /* Truecolor flag and pixels. New 2.0 fields appear here at the
216 end to minimize breakage of existing object code. */
218 int ** tpixels;
219 /* Should alpha channel be copied, or applied, each time a
220 pixel is drawn? This applies to truecolor images only.
221 No attempt is made to alpha-blend in palette images,
222 even if semitransparent palette entries exist.
223 To do that, build your image as a truecolor image,
224 then quantize down to 8 bits. */
226 /* Should the alpha channel of the image be saved? This affects
227 PNG at the moment; other future formats may also
228 have that capability. JPEG doesn't. */
230
231 /* 2.0.12: anti-aliased globals. 2.0.26: just a few vestiges after
232 switching to the fast, memory-cheap implementation from PHP-gd. */
233 int AA;
236
237 /* 2.0.12: simple clipping rectangle. These values must be checked for safety when set; please use gdImageSetClip */
238 int cx1;
239 int cy1;
240 int cx2;
241 int cy2;
242 unsigned int res_x;
243 unsigned int res_y;
247
249
250/* Point type for use in polygon drawing. */
251
267typedef struct
268{
269 double x, y;
270}
272
273typedef struct {
274 /* # of characters in font */
276 /* First character is numbered... (usually 32 = space) */
278 /* Character width and height */
279 int w;
280 int h;
281 /* Font data; array of characters, one row after another.
282 Easily included in code, also easily loaded from
283 data files. */
284 char *data;
285} gdFont;
286
287/* Text functions take these. */
289
290typedef void(*gdErrorMethod)(int, const char *, va_list);
291
293void gdClearErrorMethod(void);
294
312typedef struct
313{
314 int x, y;
316}
318
319/* For backwards compatibility only. Use gdImageSetStyle()
320 for MUCH more flexible line drawing. Also see
321 gdImageSetBrush(). */
322#define gdDashSize 4
323
324/* Special colors. */
325
326#define gdStyled (-2)
327#define gdBrushed (-3)
328#define gdStyledBrushed (-4)
329#define gdTiled (-5)
330
331/* NOT the same as the transparent color index.
332 This is used in line styles only. */
333#define gdTransparent (-6)
334
335#define gdAntiAliased (-7)
336
337/* Functions to manipulate images. */
338
339/* Creates a palette-based image (up to 256 colors). */
340gdImagePtr gdImageCreate(int sx, int sy);
341
342/* An alternate name for the above (2.0). */
343#define gdImageCreatePalette gdImageCreate
344
345/* Creates a truecolor image (millions of colors). */
346gdImagePtr gdImageCreateTrueColor(int sx, int sy);
347
348/* Creates an image from various file types. These functions
349 return a palette or truecolor image based on the
350 nature of the file being loaded. Truecolor PNG
351 stays truecolor; palette PNG stays palette-based;
352 JPEG is always truecolor. */
358gdImagePtr gdImageCreateFromJpegEx(FILE *infile, int ignore_warning);
360gdImagePtr gdImageCreateFromJpegCtxEx(gdIOCtx *infile, int ignore_warning);
362gdImagePtr gdImageCreateFromJpegPtrEx (int size, void *data, int ignore_warning);
366
370
374
375gdImagePtr gdImageCreateFromBmp (FILE * inFile);
378
379const char * gdPngGetVersionString(void);
380
381const char * gdJpegGetVersionString(void);
382
383/* A custom data source. */
384/* The source function must return -1 on error, otherwise the number
385 of bytes fetched. 0 is EOF, not an error! */
386/* context will be passed to your source function. */
387
388typedef struct {
389 int (*source) (void *context, char *buffer, int len);
390 void *context;
392
394
397
400
401gdImagePtr gdImageCreateFromGd2Part(FILE *in, int srcx, int srcy, int w, int h);
402gdImagePtr gdImageCreateFromGd2PartCtx(gdIOCtxPtr in, int srcx, int srcy, int w, int h);
403
405void gdImageXbmCtx(gdImagePtr image, char* file_name, int fg, gdIOCtx * out);
406
408
410
411/* Replaces or blends with the background depending on the
412 most recent call to gdImageAlphaBlending and the
413 alpha channel value of 'color'; default is to overwrite.
414 Tiling and line styling are also implemented
415 here. All other gd drawing functions pass through this call,
416 allowing for many useful effects. */
417
418void gdImageSetPixel(gdImagePtr im, int x, int y, int color);
419
420int gdImageGetTrueColorPixel (gdImagePtr im, int x, int y);
421int gdImageGetPixel(gdImagePtr im, int x, int y);
422
424
425void gdImageLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color);
426void gdImageAALine(gdImagePtr im, int x1, int y1, int x2, int y2, int color);
427
428/* For backwards compatibility only. Use gdImageSetStyle()
429 for much more flexible line drawing. */
430void gdImageDashedLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color);
431/* Corners specified (not width and height). Upper left first, lower right
432 second. */
433void gdImageRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color);
434/* Solid bar. Upper left corner first, lower right corner second. */
435void gdImageFilledRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color);
436void gdImageSetClip(gdImagePtr im, int x1, int y1, int x2, int y2);
437void gdImageGetClip(gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P);
438void gdImageSetResolution(gdImagePtr im, const unsigned int res_x, const unsigned int res_y);
439void gdImageChar(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color);
440void gdImageCharUp(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color);
441void gdImageString(gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color);
442void gdImageStringUp(gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color);
443void gdImageString16(gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color);
444void gdImageStringUp16(gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color);
445
446/*
447 * The following functions are required to be called prior to the
448 * use of any sort of threads in a module load / shutdown function
449 * respectively.
450 */
453
454/* 2.0.16: for thread-safe use of gdImageStringFT and friends,
455 * call this before allowing any thread to call gdImageStringFT.
456 * Otherwise it is invoked by the first thread to invoke
457 * gdImageStringFT, with a very small but real risk of a race condition.
458 * Return 0 on success, nonzero on failure to initialize freetype.
459 */
461
462/* Optional: clean up after application is done using fonts in gdImageStringFT(). */
464
465/* Calls gdImageStringFT. Provided for backwards compatibility only. */
466char *gdImageStringTTF(gdImage *im, int *brect, int fg, char *fontlist,
467 double ptsize, double angle, int x, int y, char *string);
468
469/* FreeType 2 text output */
470char *gdImageStringFT(gdImage *im, int *brect, int fg, char *fontlist,
471 double ptsize, double angle, int x, int y, char *string);
472
473typedef struct {
474 double linespacing; /* fine tune line spacing for '\n' */
475 int flags; /* Logical OR of gdFTEX_ values */
476 int charmap; /* TBB: 2.0.12: may be gdFTEX_Unicode,
477 gdFTEX_Shift_JIS, gdFTEX_Big5 or gdFTEX_MacRoman;
478 when not specified, maps are searched
479 for in the above order. */
480 int hdpi;
481 int vdpi;
482}
484
485#define gdFTEX_LINESPACE 1
486#define gdFTEX_CHARMAP 2
487#define gdFTEX_RESOLUTION 4
488
489/* These are NOT flags; set one in 'charmap' if you set the gdFTEX_CHARMAP bit in 'flags'. */
490#define gdFTEX_Unicode 0
491#define gdFTEX_Shift_JIS 1
492#define gdFTEX_Big5 2
493#define gdFTEX_MacRoman 3
494
495/* FreeType 2 text output with fine tuning */
496char *
497gdImageStringFTEx(gdImage * im, int *brect, int fg, char * fontlist,
498 double ptsize, double angle, int x, int y, char * string,
499 gdFTStringExtraPtr strex);
500
501
502/* Point type for use in polygon drawing. */
503typedef struct {
504 int x, y;
506
507void gdImagePolygon(gdImagePtr im, gdPointPtr p, int n, int c);
508void gdImageOpenPolygon(gdImagePtr im, gdPointPtr p, int n, int c);
509void gdImageFilledPolygon(gdImagePtr im, gdPointPtr p, int n, int c);
510
511/* These functions still work with truecolor images,
512 for which they never return error. */
513int gdImageColorAllocate(gdImagePtr im, int r, int g, int b);
514/* gd 2.0: palette entries with non-opaque transparency are permitted. */
515int gdImageColorAllocateAlpha(gdImagePtr im, int r, int g, int b, int a);
516/* Assumes opaque is the preferred alpha channel value */
517int gdImageColorClosest(gdImagePtr im, int r, int g, int b);
518/* Closest match taking all four parameters into account.
519 A slightly different color with the same transparency
520 beats the exact same color with radically different
521 transparency */
522int gdImageColorClosestAlpha(gdImagePtr im, int r, int g, int b, int a);
523/* An alternate method */
524int gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b);
525/* Returns exact, 100% opaque matches only */
526int gdImageColorExact(gdImagePtr im, int r, int g, int b);
527/* Returns an exact match only, including alpha */
528int gdImageColorExactAlpha(gdImagePtr im, int r, int g, int b, int a);
529/* Opaque only */
530int gdImageColorResolve(gdImagePtr im, int r, int g, int b);
531/* Based on gdImageColorExactAlpha and gdImageColorClosestAlpha */
532int gdImageColorResolveAlpha(gdImagePtr im, int r, int g, int b, int a);
533
534/* A simpler way to obtain an opaque truecolor value for drawing on a
535 truecolor image. Not for use with palette images! */
536
537#define gdTrueColor(r, g, b) (((r) << 16) + \
538 ((g) << 8) + \
539 (b))
540
541/* Returns a truecolor value with an alpha channel component.
542 gdAlphaMax (127, **NOT 255**) is transparent, 0 is completely
543 opaque. */
544
545#define gdTrueColorAlpha(r, g, b, a) (((a) << 24) + \
546 ((r) << 16) + \
547 ((g) << 8) + \
548 (b))
549
551
552/* Converts a truecolor image to a palette-based image,
553 using a high-quality two-pass quantization routine
554 which attempts to preserve alpha channel information
555 as well as R/G/B color information when creating
556 a palette. If ditherFlag is set, the image will be
557 dithered to approximate colors better, at the expense
558 of some obvious "speckling." colorsWanted can be
559 anything up to 256. If the original source image
560 includes photographic information or anything that
561 came out of a JPEG, 256 is strongly recommended.
562
563 Better yet, don't use this function -- write real
564 truecolor PNGs and JPEGs. The disk space gain of
565 conversion to palette is not great (for small images
566 it can be negative) and the quality loss is ugly. */
567
568gdImagePtr gdImageCreatePaletteFromTrueColor (gdImagePtr im, int ditherFlag, int colorsWanted);
569
570int gdImageTrueColorToPalette(gdImagePtr im, int ditherFlag, int colorsWanted);
572
573/* An attempt at getting the results of gdImageTrueColorToPalette
574 to look a bit more like the original (im1 is the original
575 and im2 is the palette version */
577
578/* Specifies a color index (if a palette image) or an
579 RGB color (if a truecolor image) which should be
580 considered 100% transparent. FOR TRUECOLOR IMAGES,
581 THIS IS IGNORED IF AN ALPHA CHANNEL IS BEING
582 SAVED. Use gdImageSaveAlpha(im, 0); to
583 turn off the saving of a full alpha channel in
584 a truecolor image. Note that gdImageColorTransparent
585 is usually compatible with older browsers that
586 do not understand full alpha channels well. TBB */
588
590void gdImagePng(gdImagePtr im, FILE *out);
592void gdImageGif(gdImagePtr im, FILE *out);
594
595void * gdImageBmpPtr(gdImagePtr im, int *size, int compression);
596void gdImageBmp(gdImagePtr im, FILE *outFile, int compression);
597void gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression);
598
599/* 2.0.12: Compression level: 0-9 or -1, where 0 is NO COMPRESSION at all,
600 * 1 is FASTEST but produces larger files, 9 provides the best
601 * compression (smallest files) but takes a long time to compress, and
602 * -1 selects the default compiled into the zlib library.
603 */
604void gdImagePngEx(gdImagePtr im, FILE * out, int level, int basefilter);
605void gdImagePngCtxEx(gdImagePtr im, gdIOCtx * out, int level, int basefilter);
606
607void gdImageWBMP(gdImagePtr image, int fg, FILE *out);
608void gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out);
609
610/* Guaranteed to correctly free memory returned
611 by the gdImage*Ptr functions */
612void gdFree(void *m);
613
614/* Best to free this memory with gdFree(), not free() */
615void *gdImageWBMPPtr(gdImagePtr im, int *size, int fg);
616
617/* 100 is highest quality (there is always a little loss with JPEG).
618 0 is lowest. 10 is about the lowest useful setting. */
619void gdImageJpeg(gdImagePtr im, FILE *out, int quality);
620void gdImageJpegCtx(gdImagePtr im, gdIOCtx *out, int quality);
621
633#define gdWebpLossless 101
634
635void gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quality);
636
637/* Best to free this memory with gdFree(), not free() */
638void *gdImageJpegPtr(gdImagePtr im, int *size, int quality);
639
643
644void gdImageAvif(gdImagePtr im, FILE *outfile);
645void gdImageAvifEx(gdImagePtr im, FILE *outfile, int quality, int speed);
647void *gdImageAvifPtrEx(gdImagePtr im, int *size, int quality, int speed);
648void gdImageAvifCtx(gdImagePtr im, gdIOCtx *outfile, int quality, int speed);
649
650/* A custom data sink. For backwards compatibility. Use
651 gdIOCtx instead. */
652/* The sink function must return -1 on error, otherwise the number
653 of bytes written, which must be equal to len. */
654/* context will be passed to your sink function. */
655typedef struct {
656 int (*sink) (void *context, const char *buffer, int len);
657 void *context;
659
661
662void gdImageGd(gdImagePtr im, FILE *out);
663void gdImageGd2(gdImagePtr im, FILE *out, int cs, int fmt);
664
665/* Best to free this memory with gdFree(), not free() */
667
668/* Best to free this memory with gdFree(), not free() */
669void* gdImageGdPtr(gdImagePtr im, int *size);
670void *gdImagePngPtrEx(gdImagePtr im, int *size, int level, int basefilter);
671
672/* Best to free this memory with gdFree(), not free() */
673void* gdImageGd2Ptr(gdImagePtr im, int cs, int fmt, int *size);
674
675void gdImageEllipse(gdImagePtr im, int cx, int cy, int w, int h, int c);
676
677/* Style is a bitwise OR ( | operator ) of these.
678 gdArc and gdChord are mutually exclusive;
679 gdChord just connects the starting and ending
680 angles with a straight line, while gdArc produces
681 a rounded edge. gdPie is a synonym for gdArc.
682 gdNoFill indicates that the arc or chord should be
683 outlined, not filled. gdEdged, used together with
684 gdNoFill, indicates that the beginning and ending
685 angles should be connected to the center; this is
686 a good way to outline (rather than fill) a
687 'pie slice'. */
688#define gdArc 0
689#define gdPie gdArc
690#define gdChord 1
691#define gdNoFill 2
692#define gdEdged 4
693
694void gdImageFilledArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int style);
695void gdImageArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color);
696void gdImageFilledEllipse(gdImagePtr im, int cx, int cy, int w, int h, int color);
697void gdImageFillToBorder(gdImagePtr im, int x, int y, int border, int color);
698void gdImageFill(gdImagePtr im, int x, int y, int color);
699void gdImageCopy(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h);
700void gdImageCopyMerge(gdImagePtr dst, gdImagePtr src, int dstX, int dstY,
701 int srcX, int srcY, int w, int h, int pct);
702void gdImageCopyMergeGray(gdImagePtr dst, gdImagePtr src, int dstX, int dstY,
703 int srcX, int srcY, int w, int h, int pct);
704
705/* Stretches or shrinks to fit, as needed. Does NOT attempt
706 to average the entire set of source pixels that scale down onto the
707 destination pixel. */
708void gdImageCopyResized(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH);
709
710/* gd 2.0: stretches or shrinks to fit, as needed. When called with a
711 truecolor destination image, this function averages the
712 entire set of source pixels that scale down onto the
713 destination pixel, taking into account what portion of the
714 destination pixel each source pixel represents. This is a
715 floating point operation, but this is not a performance issue
716 on modern hardware, except for some embedded devices. If the
717 destination is a palette image, gdImageCopyResized is
718 substituted automatically. */
719void gdImageCopyResampled(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH);
720
721gdImagePtr gdImageRotate90(gdImagePtr src, int ignoretransparent);
722gdImagePtr gdImageRotate180(gdImagePtr src, int ignoretransparent);
723gdImagePtr gdImageRotate270(gdImagePtr src, int ignoretransparent);
724gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor);
725
727
730void gdImageSetAntiAliased(gdImagePtr im, int c);
731void gdImageSetAntiAliasedDontBlend(gdImagePtr im, int c, int dont_blend);
732void gdImageSetStyle(gdImagePtr im, int *style, int noOfPixels);
733/* Line thickness (defaults to 1). Affects lines, ellipses,
734 rectangles, polygons and so forth. */
735void gdImageSetThickness(gdImagePtr im, int thickness);
736/* On or off (1 or 0) for all three of these. */
737void gdImageInterlace(gdImagePtr im, int interlaceArg);
738void gdImageAlphaBlending(gdImagePtr im, int alphaBlendingArg);
739void gdImageAntialias(gdImagePtr im, int antialias);
740void gdImageSaveAlpha(gdImagePtr im, int saveAlphaArg);
741
746
747int gdImagePixelate(gdImagePtr im, int block_size, const unsigned int mode);
748
749typedef struct {
750 int sub;
751 int plus;
752 unsigned int num_colors;
753 int *colors;
754 unsigned int seed;
756
757int gdImageScatter(gdImagePtr im, int sub, int plus);
758int gdImageScatterColor(gdImagePtr im, int sub, int plus, int colors[], unsigned int num_colors);
760
761/* Macros to access information about images. */
762
763/* Returns nonzero if the image is a truecolor image,
764 zero for a palette image. */
765
766#define gdImageTrueColor(im) ((im)->trueColor)
767
768#define gdImageSX(im) ((im)->sx)
769#define gdImageSY(im) ((im)->sy)
770#define gdImageColorsTotal(im) ((im)->colorsTotal)
771#define gdImageRed(im, c) ((im)->trueColor ? gdTrueColorGetRed(c) : \
772 (im)->red[(c)])
773#define gdImageGreen(im, c) ((im)->trueColor ? gdTrueColorGetGreen(c) : \
774 (im)->green[(c)])
775#define gdImageBlue(im, c) ((im)->trueColor ? gdTrueColorGetBlue(c) : \
776 (im)->blue[(c)])
777#define gdImageAlpha(im, c) ((im)->trueColor ? gdTrueColorGetAlpha(c) : \
778 (im)->alpha[(c)])
779#define gdImageGetTransparent(im) ((im)->transparent)
780#define gdImageGetInterlaced(im) ((im)->interlace)
781
782/* These macros provide direct access to pixels in
783 palette-based and truecolor images, respectively.
784 If you use these macros, you must perform your own
785 bounds checking. Use of the macro for the correct type
786 of image is also your responsibility. */
787#define gdImagePalettePixel(im, x, y) (im)->pixels[(y)][(x)]
788#define gdImageTrueColorPixel(im, x, y) (im)->tpixels[(y)][(x)]
789#define gdImageResolutionX(im) (im)->res_x
790#define gdImageResolutionY(im) (im)->res_y
791
792/* I/O Support routines. */
793
794gdIOCtx* gdNewFileCtx(FILE*);
795gdIOCtx* gdNewDynamicCtx(int, void*);
796gdIOCtx *gdNewDynamicCtxEx(int size, void *data, int freeFlag);
798void* gdDPExtractData(struct gdIOCtx* ctx, int *size);
799
800#define GD2_CHUNKSIZE 128
801#define GD2_CHUNKSIZE_MIN 64
802#define GD2_CHUNKSIZE_MAX 4096
803
804#define GD2_VERS 2
805#define GD2_ID "gd2"
806#define GD2_FMT_RAW 1
807#define GD2_FMT_COMPRESSED 2
808
809
810/* filters section
811 *
812 * Negate the imag src, white becomes black,
813 * The red, green, and blue intensities of an image are negated.
814 * White becomes black, yellow becomes blue, etc.
815 */
817
818/* Convert the image src to a grayscale image */
820
821/* Set the brightness level <brightness> for the image src */
822int gdImageBrightness(gdImagePtr src, int brightness);
823
824/* Set the contrast level <contrast> for the image <src> */
825int gdImageContrast(gdImagePtr src, double contrast);
826
827/* Simply adds or subtracts respectively red, green or blue to a pixel */
828int gdImageColor(gdImagePtr src, const int red, const int green, const int blue, const int alpha);
829
830/* Image convolution by a 3x3 custom matrix */
831int gdImageConvolution(gdImagePtr src, float ft[3][3], float filter_div, float offset);
832
834
836
838
840
842
843int gdImageSmooth(gdImagePtr im, float weight);
844
845/* Image comparison definitions */
847
851
852#define GD_FLIP_HORIZONTAL 1
853#define GD_FLIP_VERTICAL 2
854#define GD_FLIP_BOTH 3
855
877
879gdImagePtr gdImageCropAuto(gdImagePtr im, const unsigned int mode);
880gdImagePtr gdImageCropThreshold(gdImagePtr im, const unsigned int color, const float threshold);
881
884
885gdImagePtr gdImageScaleBilinear(gdImagePtr im, const unsigned int new_width, const unsigned int new_height);
886gdImagePtr gdImageScaleBicubic(gdImagePtr src_img, const unsigned int new_width, const unsigned int new_height);
887gdImagePtr gdImageScaleBicubicFixed(gdImagePtr src, const unsigned int width, const unsigned int height);
888gdImagePtr gdImageScaleNearestNeighbour(gdImagePtr im, const unsigned int width, const unsigned int height);
889gdImagePtr gdImageScaleTwoPass(const gdImagePtr pOrigImage, const unsigned int uOrigWidth, const unsigned int uOrigHeight, const unsigned int uNewWidth, const unsigned int uNewHeight);
890gdImagePtr gdImageScale(const gdImagePtr src, const unsigned int new_width, const unsigned int new_height);
891
892gdImagePtr gdImageRotateNearestNeighbour(gdImagePtr src, const float degrees, const int bgColor);
893gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int bgColor);
894gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const int bgColor);
895gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int bgColor);
896gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor);
897
905
906int gdAffineApplyToPointF (gdPointFPtr dst, const gdPointFPtr src, const double affine[6]);
907int gdAffineInvert (double dst[6], const double src[6]);
908int gdAffineFlip (double dst_affine[6], const double src_affine[6], const int flip_h, const int flip_v);
909int gdAffineConcat (double dst[6], const double m1[6], const double m2[6]);
910
911int gdAffineIdentity (double dst[6]);
912int gdAffineScale (double dst[6], const double scale_x, const double scale_y);
913int gdAffineRotate (double dst[6], const double angle);
914int gdAffineShearHorizontal (double dst[6], const double angle);
915int gdAffineShearVertical(double dst[6], const double angle);
916int gdAffineTranslate (double dst[6], const double offset_x, const double offset_y);
917double gdAffineExpansion (const double src[6]);
918int gdAffineRectilinear (const double src[6]);
919int gdAffineEqual (const double matrix1[6], const double matrix2[6]);
920int gdTransformAffineGetImage(gdImagePtr *dst, const gdImagePtr src, gdRectPtr src_area, const double affine[6]);
921int gdTransformAffineCopy(gdImagePtr dst, int dst_x, int dst_y, const gdImagePtr src, gdRectPtr src_region, const double affine[6]);
922/*
923gdTransformAffineCopy(gdImagePtr dst, int x0, int y0, int x1, int y1,
924 const gdImagePtr src, int src_width, int src_height,
925 const double affine[6]);
926*/
927int gdTransformAffineBoundingBox(gdRectPtr src, const double affine[6], gdRectPtr bbox);
928
929
930#define GD_CMP_IMAGE 1 /* Actual image IS different */
931#define GD_CMP_NUM_COLORS 2 /* Number of Colours in palette differ */
932#define GD_CMP_COLOR 4 /* Image colours differ */
933#define GD_CMP_SIZE_X 8 /* Image width differs */
934#define GD_CMP_SIZE_Y 16 /* Image heights differ */
935#define GD_CMP_TRANSPARENT 32 /* Transparent colour */
936#define GD_CMP_BACKGROUND 64 /* Background colour */
937#define GD_CMP_INTERLACE 128 /* Interlaced setting */
938#define GD_CMP_TRUECOLOR 256 /* Truecolor vs palette differs */
939
940/* resolution affects ttf font rendering, particularly hinting */
941#define GD_RESOLUTION 96 /* pixels per inch */
942
943#ifdef __cplusplus
944}
945#endif
946
947/* 2.0.12: this now checks the clipping rectangle */
948#define gdImageBoundsSafe(im, x, y) (!((((y) < (im)->cy1) || ((y) > (im)->cy2)) || (((x) < (im)->cx1) || ((x) > (im)->cx2))))
949
950#endif /* GD_H */
size_t len
Definition apprentice.c:174
char s[4]
Definition cdf.c:77
zend_long n
Definition ffi.c:4979
new_type size
Definition ffi.c:4365
zend_long offset
char * mode
char * gdImageStringFTEx(gdImage *im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string, gdFTStringExtraPtr strex)
Definition gdft.c:48
void gdImageSetTile(gdImagePtr im, gdImagePtr tile)
Definition gd.c:2887
void * gdImageBmpPtr(gdImagePtr im, int *size, int compression)
Definition gd_bmp.c:66
char * gdImageStringTTF(gdImage *im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string)
Definition gdft.c:39
void gdSetErrorMethod(gdErrorMethod)
Definition gd.c:123
void gdImageFilledPolygon(gdImagePtr im, gdPointPtr p, int n, int c)
Definition gd.c:2730
void gdImageRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color)
Definition gd.c:2142
gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int bgColor)
void gdImageCopyResized(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH)
Definition gd.c:2487
void gdImageAvifEx(gdImagePtr im, FILE *outfile, int quality, int speed)
void * gdDPExtractData(struct gdIOCtx *ctx, int *size)
Definition gd_io_dp.c:95
int gdImageColorAllocateAlpha(gdImagePtr im, int r, int g, int b, int a)
Definition gd.c:494
int gdFontCacheSetup(void)
void gdImageBmp(gdImagePtr im, FILE *outFile, int compression)
Definition gd_bmp.c:80
int gdImageScatterColor(gdImagePtr im, int sub, int plus, int colors[], unsigned int num_colors)
Definition gd_filter.c:40
gdImagePtr gdImageCreate(int sx, int sy)
Definition gd.c:141
void gdImageJpegCtx(gdImagePtr im, gdIOCtx *out, int quality)
int gdImageScatterEx(gdImagePtr im, gdScatterPtr s)
Definition gd_filter.c:52
int gdAffineInvert(double dst[6], const double src[6])
Definition gd_matrix.c:58
void gdImageAlphaBlending(gdImagePtr im, int alphaBlendingArg)
Definition gd.c:3037
void gdFontCacheMutexShutdown(void)
gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr in)
Definition gd_gif_in.c:128
void * gdImageWBMPPtr(gdImagePtr im, int *size, int fg)
Definition gd_wbmp.c:215
int gdTransformAffineGetImage(gdImagePtr *dst, const gdImagePtr src, gdRectPtr src_area, const double affine[6])
int gdImageSetInterpolationMethod(gdImagePtr im, gdInterpolationMethod id)
gdImagePtr gdImageClone(gdImagePtr src)
Definition gd.c:973
void * gdImagePngPtr(gdImagePtr im, int *size)
int gdAffineApplyToPointF(gdPointFPtr dst, const gdPointFPtr src, const double affine[6])
Definition gd_matrix.c:27
void gdImageFilledRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color)
Definition gd.c:2307
int gdAffineShearVertical(double dst[6], const double angle)
Definition gd_matrix.c:244
int gdImageEdgeDetectQuick(gdImagePtr src)
Definition gd_filter.c:516
void gdImageString(gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color)
Definition gd.c:1573
void * gdImageJpegPtr(gdImagePtr im, int *size, int quality)
gdImagePtr gdImageCreateFromBmpCtx(gdIOCtxPtr infile)
Definition gd_bmp.c:436
gdImagePtr gdImageCreateFromPngCtx(gdIOCtxPtr in)
int gdAffineIdentity(double dst[6])
Definition gd_matrix.c:150
void gdImageSetBrush(gdImagePtr im, gdImagePtr brush)
Definition gd.c:2874
struct gdRect * gdRectPtr
void gdImageLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color)
Definition gd.c:1096
gdImagePtr gdImageCreateFromGd2Ctx(gdIOCtxPtr in)
Definition gd_gd2.c:267
gdImagePtr gdImageScaleNearestNeighbour(gdImagePtr im, const unsigned int width, const unsigned int height)
gdImagePtr gdImageCreateFromGif(FILE *fd)
Definition gd_gif_in.c:115
int gdImageNegate(gdImagePtr src)
Definition gd_filter.c:114
void gdImageFilledArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int style)
Definition gd.c:1650
int gdImageTrueColorToPalette(gdImagePtr im, int ditherFlag, int colorsWanted)
Definition gd_topal.c:1440
void * gdImageGdPtr(gdImagePtr im, int *size)
Definition gd_gd.c:272
void gdImageColorDeallocate(gdImagePtr im, int color)
Definition gd.c:597
gdImagePtr gdImageCreateFromXbm(FILE *fd)
Definition gd_xbm.c:32
void gdImageCharUp(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color)
Definition gd.c:1545
int gdImageColorResolveAlpha(gdImagePtr im, int r, int g, int b, int a)
Definition gd.c:539
gdImagePtr gdImageRotate180(gdImagePtr src, int ignoretransparent)
Definition gd_rotate.c:248
gdImagePtr gdImageCreateFromTgaCtx(gdIOCtx *ctx)
Definition gd_tga.c:62
int gdImageGetTrueColorPixel(gdImagePtr im, int x, int y)
Definition gd.c:798
int gdLayerOverlay(int dst, int src)
Definition gd.c:3047
void * gdImagePngPtrEx(gdImagePtr im, int *size, int level, int basefilter)
gdImagePtr gdImageScale(const gdImagePtr src, const unsigned int new_width, const unsigned int new_height)
void gdImageEllipse(gdImagePtr im, int cx, int cy, int w, int h, int c)
Definition gd.c:1771
void gdImageOpenPolygon(gdImagePtr im, gdPointPtr p, int n, int c)
Definition gd.c:2701
void gdImageStringUp16(gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color)
Definition gd.c:1608
int gdImageGetPixel(gdImagePtr im, int x, int y)
Definition gd.c:953
gdImagePtr gdImageCreateFromWebp(FILE *fd)
void gdImagePngEx(gdImagePtr im, FILE *out, int level, int basefilter)
gdCropMode
Definition gd.h:869
@ GD_CROP_TRANSPARENT
Definition gd.h:871
@ GD_CROP_THRESHOLD
Definition gd.h:875
@ GD_CROP_WHITE
Definition gd.h:873
@ GD_CROP_BLACK
Definition gd.h:872
@ GD_CROP_SIDES
Definition gd.h:874
@ GD_CROP_DEFAULT
Definition gd.h:870
#define gdMaxColors
Definition gd.h:56
gdImagePtr gdImageScaleBicubic(gdImagePtr src_img, const unsigned int new_width, const unsigned int new_height)
void gdImageSetAntiAliased(gdImagePtr im, int c)
Definition gd.c:2900
gdPixelateMode
Definition gd.h:742
@ GD_PIXELATE_UPPERLEFT
Definition gd.h:743
@ GD_PIXELATE_AVERAGE
Definition gd.h:744
void gdFontCacheMutexSetup(void)
int gdAffineFlip(double dst_affine[6], const double src_affine[6], const int flip_h, const int flip_v)
Definition gd_matrix.c:93
void * gdImageAvifPtrEx(gdImagePtr im, int *size, int quality, int speed)
void gdImageDestroy(gdImagePtr im)
Definition gd.c:247
gdImagePtr gdImageCreateFromGd2Part(FILE *in, int srcx, int srcy, int w, int h)
Definition gd_gd2.c:422
gdImagePtr gdImageRotate90(gdImagePtr src, int ignoretransparent)
Definition gd_rotate.c:201
void gdImageSetClip(gdImagePtr im, int x1, int y1, int x2, int y2)
Definition gd.c:3102
struct gdScatter * gdScatterPtr
int gdAffineRectilinear(const double src[6])
Definition gd_matrix.c:305
gdImagePtr gdImageCreateFromAvifCtx(gdIOCtx *infile)
int gdImageGaussianBlur(gdImagePtr im)
Definition gd_filter.c:525
int gdTransformAffineCopy(gdImagePtr dst, int dst_x, int dst_y, const gdImagePtr src, gdRectPtr src_region, const double affine[6])
int gdAffineConcat(double dst[6], const double m1[6], const double m2[6])
Definition gd_matrix.c:121
gdImagePtr gdImageCreateFromWBMPCtx(gdIOCtx *infile)
Definition gd_wbmp.c:141
int gdAffineRotate(double dst[6], const double angle)
Definition gd_matrix.c:197
void gdImageAvifCtx(gdImagePtr im, gdIOCtx *outfile, int quality, int speed)
void gdFontCacheShutdown(void)
gdInterpolationMethod gdImageGetInterpolationMethod(gdImagePtr im)
void gdImagePng(gdImagePtr im, FILE *out)
gdFont * gdFontPtr
Definition gd.h:288
void gdImageSetAntiAliasedDontBlend(gdImagePtr im, int c, int dont_blend)
Definition gd.c:2907
gdImagePtr gdImageCreateFromJpegCtx(gdIOCtx *infile)
gdImagePtr gdImageCreateFromTga(FILE *fp)
Definition gd_tga.c:30
const char * gdJpegGetVersionString(void)
gdImagePtr gdImageCreateFromJpeg(FILE *infile)
gdImagePtr gdImageCreateFromBmpPtr(int size, void *data)
Definition gd_bmp.c:423
int gdTransformAffineBoundingBox(gdRectPtr src, const double affine[6], gdRectPtr bbox)
gdImagePtr gdImageCreateFromJpegPtr(int size, void *data)
gdImagePtr gdImageCreateFromJpegCtxEx(gdIOCtx *infile, int ignore_warning)
int gdImageEmboss(gdImagePtr im)
Definition gd_filter.c:534
void gdImageFlipVertical(gdImagePtr im)
Definition gd_transform.c:3
void(* gdErrorMethod)(int, const char *, va_list)
Definition gd.h:290
gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor)
int gdImageConvolution(gdImagePtr src, float ft[3][3], float filter_div, float offset)
Definition gd_filter.c:335
gdImagePtr gdImageCreateFromXpm(char *filename)
int gdAffineTranslate(double dst[6], const double offset_x, const double offset_y)
Definition gd_matrix.c:267
char * gdImageStringFT(gdImage *im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string)
Definition gdft.c:56
void gdImageGd(gdImagePtr im, FILE *out)
Definition gd_gd.c:265
int gdAffineEqual(const double matrix1[6], const double matrix2[6])
Definition gd_matrix.c:323
void gdImageFillToBorder(gdImagePtr im, int x, int y, int border, int color)
Definition gd.c:1858
gdImagePtr gdImageCropAuto(gdImagePtr im, const unsigned int mode)
Definition gd_crop.c:79
int gdAffineShearHorizontal(double dst[6], const double angle)
Definition gd_matrix.c:222
gdImagePtr gdImageRotate270(gdImagePtr src, int ignoretransparent)
Definition gd_rotate.c:296
int gdImageColorExact(gdImagePtr im, int r, int g, int b)
Definition gd.c:467
int gdLayerMultiply(int dest, int src)
Definition gd.c:3080
gdImagePtr gdImageCrop(gdImagePtr src, const gdRectPtr crop)
Definition gd_crop.c:44
void gdImageArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color)
Definition gd.c:1645
void gdImagePngCtxEx(gdImagePtr im, gdIOCtx *out, int level, int basefilter)
gdImagePtr gdImageCreateFromGd2PartCtx(gdIOCtxPtr in, int srcx, int srcy, int w, int h)
void gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out)
Definition gd_wbmp.c:96
void gdImageSetThickness(gdImagePtr im, int thickness)
Definition gd.c:2869
void gdImageAALine(gdImagePtr im, int x1, int y1, int x2, int y2, int color)
Definition gd.c:1292
void gdImagePngCtx(gdImagePtr im, gdIOCtx *out)
int gdImageColorClosest(gdImagePtr im, int r, int g, int b)
Definition gd.c:271
void gdImageAvif(gdImagePtr im, FILE *outfile)
gdImagePtr gdImageCreateFromAvif(FILE *infile)
struct gdSink * gdSinkPtr
gdImagePtr gdImageScaleBicubicFixed(gdImagePtr src, const unsigned int width, const unsigned int height)
int gdImagePixelate(gdImagePtr im, int block_size, const unsigned int mode)
Definition gd_pixelate.c:3
int gdImageColor(gdImagePtr src, const int red, const int green, const int blue, const int alpha)
Definition gd_filter.c:292
gdImagePtr gdImageCreateFromGifSource(gdSourcePtr in)
Definition gd_gif_in.c:102
double gdAffineExpansion(const double src[6])
Definition gd_matrix.c:289
void gdImageFlipBoth(gdImagePtr im)
gdImagePtr gdImageCreateFromPngSource(gdSourcePtr in)
Definition gd_ss.c:43
gdAffineStandardMatrix
Definition gd.h:898
@ GD_AFFINE_SCALE
Definition gd.h:900
@ GD_AFFINE_SHEAR_HORIZONTAL
Definition gd.h:902
@ GD_AFFINE_SHEAR_VERTICAL
Definition gd.h:903
@ GD_AFFINE_TRANSLATE
Definition gd.h:899
@ GD_AFFINE_ROTATE
Definition gd.h:901
void gdImageGetClip(gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P)
Definition gd.c:3134
gdImagePtr gdImageCreatePaletteFromTrueColor(gdImagePtr im, int ditherFlag, int colorsWanted)
Definition gd_topal.c:1431
gdImagePtr gdImageCreateFromBmp(FILE *inFile)
Definition gd_bmp.c:410
gdInterpolationMethod
Definition gd.h:139
@ GD_BELL
Definition gd.h:141
@ GD_TRIANGLE
Definition gd.h:160
@ GD_BESSEL
Definition gd.h:142
@ GD_CATMULLROM
Definition gd.h:149
@ GD_BSPLINE
Definition gd.h:148
@ GD_HAMMING
Definition gd.h:153
@ GD_BICUBIC
Definition gd.h:144
@ GD_DEFAULT
Definition gd.h:140
@ GD_BILINEAR_FIXED
Definition gd.h:143
@ GD_QUADRATIC
Definition gd.h:158
@ GD_POWER
Definition gd.h:157
@ GD_BLACKMAN
Definition gd.h:146
@ GD_NEAREST_NEIGHBOUR
Definition gd.h:156
@ GD_BOX
Definition gd.h:147
@ GD_HERMITE
Definition gd.h:152
@ GD_WEIGHTED4
Definition gd.h:161
@ GD_GENERALIZED_CUBIC
Definition gd.h:151
@ GD_BICUBIC_FIXED
Definition gd.h:145
@ GD_METHOD_COUNT
Definition gd.h:162
@ GD_HANNING
Definition gd.h:154
@ GD_SINC
Definition gd.h:159
@ GD_MITCHELL
Definition gd.h:155
@ GD_GAUSSIAN
Definition gd.h:150
gdImagePtr gdImageCreateFromWebpPtr(int size, void *data)
void gdImageSetResolution(gdImagePtr im, const unsigned int res_x, const unsigned int res_y)
Definition gd.c:3142
void gdImagePolygon(gdImagePtr im, gdPointPtr p, int n, int c)
Definition gd.c:2690
gdIOCtx * gdNewFileCtx(FILE *)
Definition gd_io_file.c:49
gdImagePtr gdImageCreateFromWBMP(FILE *inFile)
Definition gd_wbmp.c:183
int gdImageColorMatch(gdImagePtr im1, gdImagePtr im2)
void gdImageFilledEllipse(gdImagePtr im, int cx, int cy, int w, int h, int color)
Definition gd.c:1810
struct gdFTStringExtra * gdFTStringExtraPtr
void gdImageGifCtx(gdImagePtr im, gdIOCtx *out)
int gdImageMeanRemoval(gdImagePtr im)
Definition gd_filter.c:548
void gdImageDashedLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color)
Definition gd.c:1376
void gdImageCopyResampled(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH)
Definition gd.c:2597
gdImagePtr gdImageCreateFromAvifPtr(int size, void *data)
int gdImageColorExactAlpha(gdImagePtr im, int r, int g, int b, int a)
Definition gd.c:472
gdImagePtr gdImageCreateFromJpegEx(FILE *infile, int ignore_warning)
gdImagePtr gdImageCropThreshold(gdImagePtr im, const unsigned int color, const float threshold)
Definition gd_crop.c:181
void gdImageJpeg(gdImagePtr im, FILE *out, int quality)
int gdAlphaBlend(int dest, int src)
Definition gd.c:2992
void gdImageSetStyle(gdImagePtr im, int *style, int noOfPixels)
Definition gd.c:2855
void gdImageWBMP(gdImagePtr image, int fg, FILE *out)
Definition gd_wbmp.c:205
int gdImageColorResolve(gdImagePtr im, int r, int g, int b)
Definition gd.c:534
struct gdSource * gdSourcePtr
gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const int bgColor)
void gdImageAntialias(gdImagePtr im, int antialias)
gdIOCtx * gdNewDynamicCtx(int, void *)
Definition gd_io_dp.c:65
void gdImageWebpCtx(gdImagePtr im, gdIOCtx *outfile, int quality)
void gdImageFlipHorizontal(gdImagePtr im)
void gdClearErrorMethod(void)
Definition gd.c:131
struct gdImageStruct gdImage
int gdImagePaletteToTrueColor(gdImagePtr src)
Definition gd.c:3149
gdImagePtr gdImageRotateNearestNeighbour(gdImagePtr src, const float degrees, const int bgColor)
void * gdImageAvifPtr(gdImagePtr im, int *size)
void gdImageStringUp(gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color)
Definition gd.c:1584
struct gdPoint * gdPointPtr
int gdImageColorAllocate(gdImagePtr im, int r, int g, int b)
Definition gd.c:489
gdImagePtr gdImageCreateFromGdCtx(gdIOCtxPtr in)
Definition gd_gd.c:165
void gdImageCopyMerge(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct)
Definition gd.c:2393
int gdImageContrast(gdImagePtr src, double contrast)
Definition gd_filter.c:232
const char * gdPngGetVersionString(void)
double(* interpolation_method)(double)
Definition gd.h:168
void gdImageCopyMergeGray(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct)
Definition gd.c:2433
int gdImageBrightness(gdImagePtr src, int brightness)
Definition gd_filter.c:187
int gdImageSmooth(gdImagePtr im, float weight)
Definition gd_filter.c:557
gdIOCtx * gdNewSSCtx(gdSourcePtr in, gdSinkPtr out)
Definition gd_io_ss.c:50
int gdAffineScale(double dst[6], const double scale_x, const double scale_y)
Definition gd_matrix.c:172
gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int bgColor)
void gdImageCopy(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h)
Definition gd.c:2312
gdImagePtr gdImageCreateFromJpegPtrEx(int size, void *data, int ignore_warning)
gdImagePtr gdImageCreateFromTgaPtr(int size, void *data)
Definition gd_tga.c:43
gdIOCtx * gdNewDynamicCtxEx(int size, void *data, int freeFlag)
Definition gd_io_dp.c:70
void gdImageString16(gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color)
Definition gd.c:1597
void gdImagePaletteCopy(gdImagePtr dst, gdImagePtr src)
Definition gd.c:624
int gdImageGrayScale(gdImagePtr src)
Definition gd_filter.c:147
void gdImageInterlace(gdImagePtr im, int interlaceArg)
Definition gd.c:2915
struct gdPointF * gdPointFPtr
gdImagePtr gdImageCreateFromGd(FILE *in)
Definition gd_gd.c:142
gdImagePtr gdImageCreateTrueColor(int sx, int sy)
Definition gd.c:195
void gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression)
Definition gd_bmp.c:91
void gdImageGd2(gdImagePtr im, FILE *out, int cs, int fmt)
Definition gd_gd2.c:832
gdImagePtr gdImageScaleTwoPass(const gdImagePtr pOrigImage, const unsigned int uOrigWidth, const unsigned int uOrigHeight, const unsigned int uNewWidth, const unsigned int uNewHeight)
void * gdImageGd2Ptr(gdImagePtr im, int cs, int fmt, int *size)
Definition gd_gd2.c:841
void gdImageGif(gdImagePtr im, FILE *out)
Definition gd_gif_out.c:115
void gdImageFill(gdImagePtr im, int x, int y, int color)
Definition gd.c:1970
gdImagePtr gdImageCreateFromGd2(FILE *in)
Definition gd_gd2.c:245
void gdImageAABlend(gdImagePtr im)
Definition gd.c:966
gdImagePtr gdImageScaleBilinear(gdImagePtr im, const unsigned int new_width, const unsigned int new_height)
int gdImageColorClosestAlpha(gdImagePtr im, int r, int g, int b, int a)
Definition gd.c:276
gdImagePtr gdImageCreateFromWebpCtx(gdIOCtxPtr in)
gdImagePtr gdImageCreateFromPng(FILE *fd)
void gdImageColorTransparent(gdImagePtr im, int color)
Definition gd.c:606
int gdImageSelectiveBlur(gdImagePtr src)
Definition gd_filter.c:397
void gdImageChar(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color)
Definition gd.c:1517
void gdImageSetPixel(gdImagePtr im, int x, int y, int color)
Definition gd.c:733
int gdImageScatter(gdImagePtr im, int sub, int plus)
Definition gd_filter.c:29
void gdImageXbmCtx(gdImagePtr image, char *file_name, int fg, gdIOCtx *out)
Definition gd_xbm.c:177
int gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b)
Definition gd.c:442
void gdImagePngToSink(gdImagePtr im, gdSinkPtr out)
Definition gd_ss.c:39
int gdImageCompare(gdImagePtr im1, gdImagePtr im2)
Definition gd.c:2920
gdImage * gdImagePtr
Definition gd.h:248
void gdImageSaveAlpha(gdImagePtr im, int saveAlphaArg)
Definition gd.c:3042
struct gdIOCtx * gdIOCtxPtr
Definition gd_io.h:25
#define gdFree(ptr)
Definition gdhelpers.h:19
short color
int fd
Definition phpdbg.h:282
const phpdbg_color_t * colors[PHPDBG_COLORS]
Definition phpdbg.h:295
zend_constant * data
p
Definition session.c:1105
Definition file.h:177
int charmap
Definition gd.h:476
double linespacing
Definition gd.h:474
int flags
Definition gd.h:475
Definition gd.h:273
int offset
Definition gd.h:277
int w
Definition gd.h:279
int nchars
Definition gd.h:275
int h
Definition gd.h:280
char * data
Definition gd.h:284
unsigned int res_y
Definition gd.h:243
int trueColor
Definition gd.h:217
struct gdImageStruct * brush
Definition gd.h:196
int red[gdMaxColors]
Definition gd.h:179
int * style
Definition gd.h:202
int cy2
Definition gd.h:241
unsigned int res_x
Definition gd.h:242
unsigned char ** pixels
Definition gd.h:172
int blue[gdMaxColors]
Definition gd.h:181
int open[gdMaxColors]
Definition gd.h:182
int stylePos
Definition gd.h:201
int cy1
Definition gd.h:239
int tileColorMap[gdMaxColors]
Definition gd.h:199
int polyAllocated
Definition gd.h:195
interpolation_method interpolation
Definition gd.h:245
int alpha[gdMaxColors]
Definition gd.h:214
int interlace
Definition gd.h:203
int ** tpixels
Definition gd.h:218
int cx1
Definition gd.h:238
struct gdImageStruct * tile
Definition gd.h:197
gdInterpolationMethod interpolation_id
Definition gd.h:244
int sy
Definition gd.h:174
int AA_dont_blend
Definition gd.h:235
int styleLength
Definition gd.h:200
int saveAlphaFlag
Definition gd.h:229
int alphaBlendingFlag
Definition gd.h:225
int * polyInts
Definition gd.h:194
int thick
Definition gd.h:205
int sx
Definition gd.h:173
int AA
Definition gd.h:233
int cx2
Definition gd.h:240
int brushColorMap[gdMaxColors]
Definition gd.h:198
int green[gdMaxColors]
Definition gd.h:180
int transparent
Definition gd.h:193
int AA_color
Definition gd.h:234
int colorsTotal
Definition gd.h:178
Definition gd.h:268
double y
Definition gd.h:269
double x
Definition gd.h:269
Definition gd.h:503
int x
Definition gd.h:504
int y
Definition gd.h:504
Definition gd.h:313
int x
Definition gd.h:314
int height
Definition gd.h:315
int y
Definition gd.h:314
int width
Definition gd.h:315
int sub
Definition gd.h:750
unsigned int seed
Definition gd.h:754
int * colors
Definition gd.h:753
unsigned int num_colors
Definition gd.h:752
int plus
Definition gd.h:751
Definition gd.h:655
int(* sink)(void *context, const char *buffer, int len)
Definition gd.h:656
void * context
Definition gd.h:657
Definition gd.h:388
int(* source)(void *context, char *buffer, int len)
Definition gd.h:389
void * context
Definition gd.h:390
$obj a
Definition test.php:84
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)
out($f, $s)