| Bsoft 2.0.5 Bernard's software package

Functions | Variables
rwTGA.cpp File Reference

Functions for reading and writing Truevision TGA files. More...

`#include "rwTGA.h"`
`#include "file_util.h"`
`#include "utilities.h"`

Go to the source code of this file.

## Functions
RGB< unsigned char > | TGA_to_RGB (const unsigned char *pColorData, unsigned int bitsPerColor)
RGBA< unsigned char > | TGA_to_RGBA (const unsigned char *pColorData, unsigned int bitsPerColor)
int | readTGA (Bimage *p, int readdata)
| Reading a Truevision TGA image file format. More...
int | writeTGA (Bimage *p)
| Writing a Truevision TGA map image file format. More...

## Variables
int | verbose

## Detailed Description

Functions for reading and writing Truevision TGA files.

Author
  Bernard Heymann

Date
  Created: 20150811
  Modified: 20150815

Definition in file rwTGA.cpp.

## Function Documentation

## ◆ readTGA()

int readTGA | ( | Bimage * | p,
|  | int | readdata
| ) |  |

Reading a Truevision TGA image file format.

Parameters

  *p | the image structure.
  readdata | flag to activate reading of image data.

Returns
  int error code (<0 means failure). A color image format. Header size: 18 bytes (fixed). File format extensions: .tga The identifier is ???. Byte order: Little endian. Data types: 1 = byte, 2 = float, 3 = complex float 4 = 3-value vector, 5 = view

Definition at line 134 of file rwTGA.cpp.

## ◆ TGA_to_RGB()

RGB<unsigned char> TGA_to_RGB | ( | const unsigned char * | pColorData,
|  | unsigned int | bitsPerColor
| ) |  |

Definition at line 18 of file rwTGA.cpp.

## ◆ TGA_to_RGBA()

RGBA<unsigned char> TGA_to_RGBA | ( | const unsigned char * | pColorData,
|  | unsigned int | bitsPerColor
| ) |  |

Definition at line 54 of file rwTGA.cpp.

## ◆ writeTGA()

int writeTGA | ( | Bimage * | p | ) |

Writing a Truevision TGA map image file format.

Parameters

  *p | the image structure.

Returns
  int error code (<0 means failure).

Definition at line 266 of file rwTGA.cpp.

## Variable Documentation

## ◆ verbose

int verbose