|
LibGd 2.4.0-dev
GD Graphics library
|
Read Truevision TGA images. More...

TGA Reading | |
| gdImagePtr | gdImageCreateFromTga (FILE *fp) |
| Create an image from TGA data in a stdio stream. | |
| gdImagePtr | gdImageCreateFromTgaCtx (gdIOCtxPtr ctx) |
| Create an image from TGA data in a gdIOCtx. | |
| gdImagePtr | gdImageCreateFromTgaPtr (int size, void *data) |
| Create an image from a TGA memory buffer. | |
Read Truevision TGA images.
TGA support is read-only. The reader accepts stdio streams, gdIOCtx streams, and caller-provided memory buffers, and returns a new truecolor gd image. The returned image is owned by the caller and must be destroyed with gdImageDestroy().
GD reads uncompressed and RLE-compressed color-mapped, truecolor, and grayscale TGA images. Supported inputs include 8-bit indexed data with 15-, 16-, 24-, or 32-bit color map entries, 16- and 24-bit truecolor data, 32-bit truecolor data with 8 alpha bits, and 8-bit grayscale data. Image origin flags are applied so the returned gd image has the expected orientation. When decoded alpha is present, alpha saving is enabled on the returned image.
| gdImagePtr gdImageCreateFromTga | ( | FILE * | fp | ) |
Create an image from TGA data in a stdio stream.
gdImageCreateFromTga() borrows fp for the duration of the call and does not close it. On success, the returned image is owned by the caller and must be destroyed with gdImageDestroy().
| fp | Pointer to the input FILE stream. |
| gdImagePtr gdImageCreateFromTgaCtx | ( | gdIOCtxPtr | ctx | ) |
Create an image from TGA data in a gdIOCtx.
gdImageCreateFromTgaCtx() borrows ctx for the duration of the call and does not close it. On success, the returned image is owned by the caller and must be destroyed with gdImageDestroy().
| ctx | Pointer to the gdIOCtx input context. |
| gdImagePtr gdImageCreateFromTgaPtr | ( | int | size, |
| void * | data | ||
| ) |
Create an image from a TGA memory buffer.
gdImageCreateFromTgaPtr() borrows data for the duration of the call. The caller retains ownership of the input buffer. On success, the returned image is owned by the caller and must be destroyed with gdImageDestroy().
| size | Size of the TGA memory buffer in bytes. |
| data | Pointer to the TGA memory buffer. |