php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
gd_tga.c File Reference
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "gd_tga.h"
#include "gd.h"
#include "gd_errors.h"
#include "gdhelpers.h"

Go to the source code of this file.

Functions

gdImagePtr gdImageCreateFromTga (FILE *fp)
 
gdImagePtr gdImageCreateFromTgaPtr (int size, void *data)
 
gdImagePtr gdImageCreateFromTgaCtx (gdIOCtx *ctx)
 
int read_header_tga (gdIOCtx *ctx, oTga *tga)
 Reads a TGA header. Reads the header block from a binary TGA file populating the referenced TGA structure.
 
int read_image_tga (gdIOCtx *ctx, oTga *tga)
 Reads a TGA image data into buffer. Reads the image data block from a binary TGA file populating the referenced TGA structure.
 
void free_tga (oTga *tga)
 Cleans up a TGA structure. Dereferences the bitmap referenced in a TGA structure, then the structure itself.
 

Function Documentation

◆ free_tga()

void free_tga ( oTga * tga)

Cleans up a TGA structure. Dereferences the bitmap referenced in a TGA structure, then the structure itself.

Parameters
tgaPointer to TGA structure

Definition at line 354 of file gd_tga.c.

◆ gdImageCreateFromTga()

gdImagePtr gdImageCreateFromTga ( FILE * fp)

File: TGA Input

Read TGA images.

Definition at line 30 of file gd_tga.c.

◆ gdImageCreateFromTgaCtx()

gdImagePtr gdImageCreateFromTgaCtx ( gdIOCtx * ctx)

Populate GD image object Copy the pixel data from our tga bitmap buffer into the GD image Disable blending and save the alpha channel per default

Definition at line 62 of file gd_tga.c.

◆ gdImageCreateFromTgaPtr()

gdImagePtr gdImageCreateFromTgaPtr ( int size,
void * data )

Definition at line 43 of file gd_tga.c.

◆ read_header_tga()

int read_header_tga ( gdIOCtx * ctx,
oTga * tga )

Reads a TGA header. Reads the header block from a binary TGA file populating the referenced TGA structure.

Parameters
ctxPointer to TGA binary file
tgaPointer to TGA structure
Returns
int 1 on success, -1 on failure

Definition at line 146 of file gd_tga.c.

◆ read_image_tga()

int read_image_tga ( gdIOCtx * ctx,
oTga * tga )

Reads a TGA image data into buffer. Reads the image data block from a binary TGA file populating the referenced TGA structure.

Parameters
ctxPointer to TGA binary file
tgaPointer to TGA structure
Returns
int 0 on success, -1 on failure
Todo
Add more image type support.

Allocate memmory for image block Allocate a chunk of memory for the image block to be passed into.

Read in uncompressed RGB TGA Chunk load the pixel data from an uncompressed RGB type TGA.

Read in RLE compressed RGB TGA Chunk load the pixel data from an RLE compressed RGB type TGA.

Definition at line 209 of file gd_tga.c.