gd.h | |
Transform | |
gdInterpolationMethod | |
Types | |
gdImage | |
gdImagePtr | The data structure in which gd stores images. |
Types | |
gdPointF | Defines a point in a 2D coordinate system using floating point values. |
gdPointFPtr | Pointer to a gdPointF |
Types | |
gdFont | |
gdFontPtr | A font structure, containing the bitmaps of all characters in a font. |
Types | |
gdSource | |
gdSourcePtr | Note: This interface is obsolete and kept only for *compatibility. |
Types | |
gdFTStringExtra | |
gdFTStringExtraPtr | A structure and associated pointer type used to pass additional parameters to the gdImageStringFTEx function. |
Types | |
gdPoint | |
gdPointPtr | Represents a point in the coordinate space of the image; used by gdImagePolygon, gdImageOpenPolygon and gdImageFilledPolygon for polygon drawing. |
GifAnim | Legal values for Disposal. |
gdImageGifAnim | |
Types | |
gdSink | |
gdSinkPtr | Note: This interface is obsolete and kept only for *compatibility. |
Crop | |
gdCropMode |
<gdSetInterpolationMethod>
The data structure in which gd stores images. gdImageCreate, gdImageCreateTrueColor and the various image file-loading functions return a pointer to this type, and the other functions expect to receive a pointer to this type as their first argument.
gdImagePtr is a pointer to gdImage.
(Previous versions of this library encouraged directly manipulating the contents ofthe struct but we are attempting to move away from this practice so the fields are no longer documented here. If you need to poke at the internals of this struct, feel free to look at gd.h.)
A font structure, containing the bitmaps of all characters in a font. Used to declare the characteristics of a font. Text-output functions expect these as their second argument, following the gdImagePtr argument. <gdFontSmall> and gdFontGetLarge both return one.
You can provide your own font data by providing such a structure and the associated pixel array. You can determine the width and height of a single character in a font by examining the w and h members of the structure. If you will not be creating your own fonts, you will not need to concern yourself with the rest of the components of this structure.
Please see the files gdfontl.c and gdfontl.h for an example of the proper declaration of this structure.
typedef struct { // # of characters in font int nchars; // First character is numbered... (usually 32 = space) int offset; // Character width and height int w; int h; // Font data; array of characters, one row after another. // Easily included in code, also easily loaded from // data files. char *data; } gdFont;
gdFontPtr is a pointer to gdFont.
Note: This interface is obsolete and kept only for *compatibility. Use gdIOCtx instead.
Represents a source from which a PNG can be read. Programmers who do not wish to read PNGs from a file can provide their own alternate input mechanism, using the gdImageCreateFromPngSource function. See the documentation of that function for an example of the proper use of this type.
typedef struct { int (*source) (void *context, char *buffer, int len); void *context; } gdSource, *gdSourcePtr;
The source function must return -1 on error, otherwise the number of bytes fetched. 0 is EOF, not an error!
’context’ will be passed to your source function.
A structure and associated pointer type used to pass additional parameters to the gdImageStringFTEx function. See gdImageStringFTEx for the structure definition.
Thanks to Wez Furlong.
Represents a point in the coordinate space of the image; used by gdImagePolygon, gdImageOpenPolygon and gdImageFilledPolygon for polygon drawing.
typedef struct { int x, y; } gdPoint, *gdPointPtr;
gdDisposalUnknown | Not recommended |
gdDisposalNone | Preserve previous frame |
gdDisposalRestoreBackground | First allocated color of palette |
gdDisposalRestorePrevious | Restore to before start of frame |
See also: gdImageGifAnimAdd
Note: This interface is obsolete and kept only for *compatibility. Use gdIOCtx instead.
Represents a “sink” (destination) to which a PNG can be written. Programmers who do not wish to write PNGs to a file can provide their own alternate output mechanism, using the gdImagePngToSink function. See the documentation of that function for an example of the proper use of this type.
typedef struct { int (*sink) (void *context, char *buffer, int len); void *context; } gdSink, *gdSinkPtr;
The sink function must return -1 on error, otherwise the number of bytes written, which must be equal to len.
context will be passed to your sink function.
void gdImagePolygon ( gdImagePtr im, gdPointPtr p, int n, int c )
void gdImageOpenPolygon ( gdImagePtr im, gdPointPtr p, int n, int c )
void gdImageFilledPolygon ( gdImagePtr im, gdPointPtr p, int n, int c )
gdImageCreate is called to create palette-based images, with no more than 256 colors.
gdImagePtr gdImageCreate ( int sx, int sy )
gdImageCreateTrueColor is called to create truecolor images, with an essentially unlimited number of colors.
gdImagePtr gdImageCreateTrueColor ( int sx, int sy )
gdFontPtr gdFontGetLarge ( void )
See gdImageCreateFromPng for documentation.
gdImagePtr gdImageCreateFromPngSource ( gdSourcePtr inSource )
This function writes GIF animation frames to GIF animation, which was initialized with gdImageGifAnimBegin.
void gdImageGifAnimAdd( gdImagePtr im, FILE * outFile, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal, gdImagePtr previm )
void gdImagePngToSink ( gdImagePtr im, gdSinkPtr outSink )