Reads and writes TGA files. More...
Public Types | |
enum | { TGA_NOIMAGE =0 , TGA_RGBINDEXED =1 , TGA_RGB =2 , TGA_GRAY =3 , TGA_RLEINDEXED =9 , TGA_RLERGB =10 , TGA_RLEGRAY =11 } |
Public Member Functions | |
uint_t | Load (Image *pOutput, InputMemoryStream *pInput) |
Parses a TGA file. | |
const RGBAWord8_t * | GetPalette (void) const |
Get the file image's palette. | |
RGBAWord8_t * | GetPalette (void) |
Get the file image's palette. | |
void | SetPalette (const RGBWord8_t *pInput, uint_t uStartIndex=0, uint_t uPaletteSize=256) |
Set the file image's palette (RGB) | |
void | SetPalette (const RGBAWord8_t *pInput, uint_t uStartIndex=0, uint_t uPaletteSize=256) |
Set the file image's palette (RGBA) | |
Static Public Member Functions | |
static void | UnpackPixel8 (uint8_t *pOutput, uintptr_t uOutputLength, InputMemoryStream *pInput) |
Decompress 8 bit pixels. | |
static void | UnpackPixel16 (uint8_t *pOutput, uintptr_t uOutputLength, InputMemoryStream *pInput) |
Decompress 16 bit pixels. | |
static void | UnpackPixel24 (uint8_t *pOutput, uintptr_t uOutputLength, InputMemoryStream *pInput) |
Decompress 24 bit pixels. | |
static void | UnpackPixel32 (uint8_t *pOutput, uintptr_t uOutputLength, InputMemoryStream *pInput) |
Decompress 32 bit pixels. | |
Static Public Attributes | |
static const uint32_t | FILETYPE = 0x54504943 |
'TPIC' Mac File type for TGA files (Byte swapped on little endian machines) | |
static const uint32_t | AUXTYPE = 0x474B4F4E |
'GKON' Mac creator code for TGA files (Byte swapped on little endian machines) | |
Private Attributes | |
RGBAWord8_t | m_Palette [256] |
Palette found in the image. | |
Reads and writes TGA files.
This class will read and write out TGA files and use Burger::Image class instances as data transporters
anonymous enum |
Enumerator | |
---|---|
TGA_NOIMAGE | Palette only. |
TGA_RGBINDEXED | 8 bit uncompressed |
TGA_RGB | RGB uncompressed. |
TGA_GRAY | Grayscale uncompressed. |
TGA_RLEINDEXED | 8 bit compressed |
TGA_RLERGB | RGB compressed. |
TGA_RLEGRAY | Grayscale compressed. |
|
inline |
Get the file image's palette.
Obtain a pointer to the 256 entry RGBA color palette found in the TGA file
|
inline |
Get the file image's palette.
Obtain a constant pointer to the 256 entry RGBA color palette found in the TGA file
uint_t BURGER_API Burger::FileTGA::Load | ( | Image * | pOutput, |
InputMemoryStream * | pInput ) |
Parses a TGA file.
Read in a TGA file and set the extra variables
Will parse 24 bit uncompressed and 8 bit compressed and uncompressed TGA files only. Other formats are not supported
pOutput | Pointer to an Image record to store the new image into |
pInput | Pointer to a memory stream that has a TGA file image |
|
inline |
Set the file image's palette (RGBA)
Given a pointer to a palette, copy the colors into this class for writing to an 8 bit TGA file.
If the starting index is greater than 255, this function does nothing. If the color entry count exceeds 256 colors, the remaining colors are ignored to prevent buffer overruns
pInput | Pointer to the palette to copy |
uStartIndex | Color index of the 256 color internal palette to start modification |
uPaletteSize | Number of color entries in the palette (Maximum 256) |
|
inline |
Set the file image's palette (RGB)
Given a pointer to a palette, copy the colors into this class for writing to an 8 bit TGA file. Since the Alpha is missing from the input, each entry set will have the alpha set to zero.
If the starting index is greater than 255, this function does nothing. If the color entry count exceeds 256 colors, the remaining colors are ignored to prevent buffer overruns
pInput | Pointer to the palette to copy |
uStartIndex | Color index of the 256 color internal palette to start modification |
uPaletteSize | Number of color entries in the palette (Maximum 256) |
|
static |
Decompress 16 bit pixels.
pOutput | Buffer to accept the decompressed data |
uOutputLength | Length of the buffer in uint16_t for decompressed data |
pInput | Data stream to read compressed data from |
|
static |
Decompress 24 bit pixels.
pOutput | Buffer to accept the decompressed data |
uOutputLength | Length of the buffer in 24 bit chunks for decompressed data |
pInput | Data stream to read compressed data from |
|
static |
Decompress 32 bit pixels.
pOutput | Buffer to accept the decompressed data |
uOutputLength | Length of the buffer in 24 bit chunks for decompressed data |
pInput | Data stream to read compressed data from |
|
static |
Decompress 8 bit pixels.
pOutput | Buffer to accept the decompressed data |
uOutputLength | Length of the buffer for decompressed data |
pInput | Data stream to read compressed data from |
|
static |
'GKON' Mac creator code for TGA files (Byte swapped on little endian machines)
|
static |
'TPIC' Mac File type for TGA files (Byte swapped on little endian machines)
|
private |
Palette found in the image.