gd_gd2.c | |
Functions | |
gdImageCreateFromGd2 | gdImageCreateFromGd2 is called to load images from gd2 format files. |
gdImageCreateFromGd2Ptr | |
gdImageCreateFromGd2Ctx | Reads in a GD2 image via a gdIOCtx struct. |
gdImageCreateFromGd2Part | gdImageCreateFromGd2Part is called to load parts of images from gd2 format files. |
gdImageCreateFromGd2PartPtr | |
gdImageCreateFromGd2PartCtx |
gdImagePtr gdImageCreateFromGd2 ( FILE * inFile )
gdImageCreateFromGd2 is called to load images from gd2 format files. Invoke gdImageCreateFromGd2 with an already opened pointer to a file containing the desired image in the gd2 file format, which is specific to gd2 and intended for fast loading of parts of large images. (It is a compressed format, but generally not as good as maximum compression of the entire image would be.)
gdImageCreateFromGd2 returns a gdImagePtr to the new image, or NULL if unable to load the image (most often because the file is corrupt or does not contain a gd format image). gdImageCreateFromGd2 does not close the file. You can inspect the sx and sy members of the image to determine its size. The image must eventually be destroyed using gdImageDestroy.
gdImageCreateFromGd2Ptr creates an image from GD data (i.e. the contents of a GD2 file) already in memory.
gdImageCreateFromGd2Ctx reads in an image using the functions in a gdIOCtx struct.
infile | The input FILE pointer |
A pointer to the new image or NULL if an error occurred.
gdImagePtr im; FILE *in; in = fopen("mygd.gd2", "rb"); im = gdImageCreateFromGd2(in); fclose(in); // ... Use the image ... gdImageDestroy(im);
gdImagePtr gdImageCreateFromGd2Ptr ( int size, void * data )
size | size of GD2 data in bytes. |
data | GD2 data (i.e. contents of a GIF file). |
See gdImageCreateFromGd2.
gdImagePtr gdImageCreateFromGd2Ctx ( gdIOCtxPtr in )
Reads in a GD2 image via a gdIOCtx struct. See gdImageCreateFromGd2.
gdImagePtr gdImageCreateFromGd2Part ( FILE * inFile, int srcx, int srcy, int w, int h )
gdImageCreateFromGd2Part is called to load parts of images from gd2 format files. Invoked in the same way as gdImageCreateFromGd2, but with extra parameters indicating the source (x, y) and width/height of the desired image. gdImageCreateFromGd2Part returns a gdImagePtr to the new image, or NULL if unable to load the image. The image must eventually be destroyed using gdImageDestroy.
gdImageCreateFromGd2PartPtr creates an image from GD2 data (i.e. the contents of a GD2 file) already in memory.
gdImageCreateFromGd2Ctx reads in an image using the functions in a gdIOCtx struct.
infile | The input FILE pointer |
srcx, srcy | The source X and Y coordinates |
w, h | The resulting image’s width and height |
A pointer to the new image or NULL if an error occurred.
gdImagePtr gdImageCreateFromGd2PartPtr ( int size, void * data, int srcx, int srcy, int w, int h )
size | size of GD data in bytes. |
data | GD data (i.e. contents of a GIF file). |
srcx, srcy | The source X and Y coordinates |
w, h | The resulting image’s width and height |
Reads in part of a GD2 image file stored from memory. See gdImageCreateFromGd2Part.
gdImagePtr gdImageCreateFromGd2PartCtx ( gdIOCtx * in, int srcx, int srcy, int w, int h )
in | The data source. |
srcx, srcy | The source X and Y coordinates |
w, h | The resulting image’s width and height |
Reads in part of a GD2 data image file via a gdIOCtx struct. See gdImageCreateFromGd2Part.
gdImageCreateFromGd2 is called to load images from gd2 format files.
gdImagePtr gdImageCreateFromGd2 ( FILE * inFile )
gdImagePtr gdImageCreateFromGd2Ptr ( int size, void * data )
Reads in a GD2 image via a gdIOCtx struct.
gdImagePtr gdImageCreateFromGd2Ctx ( gdIOCtxPtr in )
gdImageCreateFromGd2Part is called to load parts of images from gd2 format files.
gdImagePtr gdImageCreateFromGd2Part ( FILE * inFile, int srcx, int srcy, int w, int h )
gdImagePtr gdImageCreateFromGd2PartPtr ( int size, void * data, int srcx, int srcy, int w, int h )
gdImagePtr gdImageCreateFromGd2PartCtx ( gdIOCtx * in, int srcx, int srcy, int w, int h )
gdImageDestroy is used to free the memory associated with an image.
void gdImageDestroy ( gdImagePtr im )