php-internal-docs
8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
gd_tga.h
Go to the documentation of this file.
1
#ifndef __TGA_H
2
#define __TGA_H 1
3
4
#include "
gd.h
"
5
#include "
gdhelpers.h
"
6
7
#include "
gd_intern.h
"
8
9
typedef
struct
oTga_
{
10
uint8_t
identsize
;
// size of ID field that follows 18 uint8_t header (0 usually)
11
uint8_t
colormaptype
;
// type of colour map 0=none, 1=has palette [IGNORED] Adrian requested no support
12
uint8_t
imagetype
;
// type of image 0=none,1=indexed,2=rgb,3=grey,+8=rle packed
13
14
int
colormapstart
;
// first colour map entry in palette [IGNORED] Adrian requested no support
15
int
colormaplength
;
// number of colours in palette [IGNORED] Adrian requested no support
16
uint8_t
colormapbits
;
// number of bits per palette entry 15,16,24,32 [IGNORED] Adrian requested no support
17
18
int
xstart
;
// image x origin
19
int
ystart
;
// image y origin
20
int
width
;
// image width in pixels
21
int
height
;
// image height in pixels
22
uint8_t
bits
;
// image bits per pixel 8,16,24,32
23
uint8_t
alphabits
;
// alpha bits (low 4bits of header 17)
24
uint8_t
fliph
;
// horizontal or vertical
25
uint8_t
flipv
;
// flip
26
char
*
ident
;
// identifcation tag string
27
int
*
bitmap
;
// bitmap data
28
29
}
oTga
;
30
31
#define TGA_TYPE_NO_IMAGE 0
32
#define TGA_TYPE_INDEXED 1
33
#define TGA_TYPE_RGB 2
34
#define TGA_TYPE_GREYSCALE 3
35
#define TGA_TYPE_INDEXED_RLE 9
36
#define TGA_TYPE_RGB_RLE 10
37
#define TGA_TYPE_GREYSCALE_RLE 11
38
#define TGA_TYPE_INDEXED_HUFFMAN_DELTA_RLE 32
39
#define TGA_TYPE_RGB_HUFFMAN_DELTA_QUADTREE_RLE 33
40
41
#define TGA_BPP_8 8
42
#define TGA_BPP_16 16
43
#define TGA_BPP_24 24
44
#define TGA_BPP_32 32
45
46
#define TGA_RLE_FLAG 128
47
48
int
read_header_tga
(
gdIOCtx
*ctx,
oTga
*tga);
49
int
read_image_tga
(
gdIOCtx
*ctx,
oTga
*tga);
50
void
free_tga
(
oTga
*tga);
51
52
#endif
//__TGA_H
gd.h
gd_intern.h
free_tga
void free_tga(oTga *tga)
Cleans up a TGA structure. Dereferences the bitmap referenced in a TGA structure, then the structure ...
Definition
gd_tga.c:354
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 ...
Definition
gd_tga.c:209
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 struc...
Definition
gd_tga.c:146
oTga
struct oTga_ oTga
gdhelpers.h
gdIOCtx
Definition
gd_io.h:10
oTga_
Definition
gd_tga.h:9
oTga_::ident
char * ident
Definition
gd_tga.h:26
oTga_::width
int width
Definition
gd_tga.h:20
oTga_::ystart
int ystart
Definition
gd_tga.h:19
oTga_::colormaplength
int colormaplength
Definition
gd_tga.h:15
oTga_::alphabits
uint8_t alphabits
Definition
gd_tga.h:23
oTga_::bits
uint8_t bits
Definition
gd_tga.h:22
oTga_::colormapstart
int colormapstart
Definition
gd_tga.h:14
oTga_::colormapbits
uint8_t colormapbits
Definition
gd_tga.h:16
oTga_::height
int height
Definition
gd_tga.h:21
oTga_::identsize
uint8_t identsize
Definition
gd_tga.h:10
oTga_::fliph
uint8_t fliph
Definition
gd_tga.h:24
oTga_::flipv
uint8_t flipv
Definition
gd_tga.h:25
oTga_::imagetype
uint8_t imagetype
Definition
gd_tga.h:12
oTga_::bitmap
int * bitmap
Definition
gd_tga.h:27
oTga_::xstart
int xstart
Definition
gd_tga.h:18
oTga_::colormaptype
uint8_t colormaptype
Definition
gd_tga.h:11
ext
gd
libgd
gd_tga.h
Generated on Sat Aug 23 2025 01:46:08 for php-internal-docs by
1.13.2