Entire Class Index | Main Class Index | Cross Index | Global Index

# Class CL_TargaProvider

Surface provider that can load targa (.tga) files.
Contained in: global
Derived from: CL_SurfaceProvider_Generic
Derived by: none
Group: Display (Surface Providers)

#include <ClanLib/display.h>

### public function member index:

### Construction:

``static` `CL_Surface`*` | `create` | `(`std::string` `handle`, `CL_InputSourceProvider`* `provider`, `bool` `transparent`=false, `bool` `ignore_alphachannel`=false, `unsigned` `char` `trans_red`=0, `unsigned` `char` `trans_green`=0, `unsigned` `char` `trans_blue`=0)`;
`` | `CL_TargaProvider` | `(`std::string` `name`, `CL_InputSourceProvider`* `provider`, `bool` `transparent`=false, `bool` `ignore_alphachannel`=false, `unsigned` `char` `trans_red`=0, `unsigned` `char` `trans_green`=0, `unsigned` `char` `trans_blue`=0)`;
``virtual`` | `~CL_TargaProvider` | `()`;

### Attributes:

``virtual` `unsigned` `int`` | `get_pitch` | `() `const``;
``virtual` `int`` | `get_translate_x` | `() `const``;
``virtual` `int`` | `get_translate_y` | `() `const``;
``virtual` `unsigned` `int`` | `get_width` | `() `const``;
``virtual` `unsigned` `int`` | `get_height` | `() `const``;
``virtual` `unsigned` `int`` | `get_num_frames` | `() `const``;
``virtual` `unsigned` `int`` | `get_depth` | `() `const``;
``virtual` `unsigned` `int`` | `get_red_mask` | `() `const``;
``virtual` `unsigned` `int`` | `get_green_mask` | `() `const``;
``virtual` `unsigned` `int`` | `get_blue_mask` | `() `const``;
``virtual` `unsigned` `int`` | `get_alpha_mask` | `() `const``;
``virtual` `bool`` | `is_indexed` | `() `const``;
``virtual` `CL_Palette`*` | `get_palette` | `() `const``;
``virtual` `bool`` | `uses_src_colorkey` | `() `const``;
``virtual` `unsigned` `int`` | `get_src_colorkey` | `() `const``;
``virtual` `void`*` | `get_data` | `() `const``;

### Operations:

``virtual` `void`` | `perform_lock` | `()`;
``virtual` `void`` | `perform_unlock` | `()`;

### private function member index:

``inline` `bool`` | `read_rgb_16` | `(`unsigned` `char`* `a`, `unsigned` `char`* `b`, `unsigned` `char`* `g`, `unsigned` `char`* `r`)`;
``inline` `bool`` | `read_rgb_24` | `(`unsigned` `char`* `a`, `unsigned` `char`* `b`, `unsigned` `char`* `g`, `unsigned` `char`* `r`)`;
``inline` `bool`` | `read_rgb_32` | `(`unsigned` `char`* `a`, `unsigned` `char`* `b`, `unsigned` `char`* `g`, `unsigned` `char`* `r`)`;
``inline` `bool`` | `read_rgb` | `(`unsigned` `char`* `a`, `unsigned` `char`* `b`, `unsigned` `char`* `g`, `unsigned` `char`* `r`)`;
``void`` | `read_from_colormap` | `(`unsigned` `char`* `a`, `unsigned` `char`* `b`, `unsigned` `char`* `g`, `unsigned` `char`* `r`)`;
``void`` | `read_data` | `()`;
``void`` | `read_header` | `(`bool` `read_colormap`)`;
``void`` | `read_colormapped` | `()`;
``void`` | `read_uncompressed_rgb` | `()`;
``void`` | `read_runlength_encoded_colormapped_rgb` | `()`;
``void`` | `read_runlength_encoded_rgb` | `()`;

## Description:

## Function Member Descriptions:

CL_TargaProvider::CL_TargaProvider - Constructs a surface provider that can read targa files.
`` `CL_TargaProvider` `(`std::string` `name`, `CL_InputSourceProvider`* `provider`, `bool` `transparent`=false, `bool` `ignore_alphachannel`=false, `unsigned` `char` `trans_red`=0, `unsigned` `char` `trans_green`=0, `unsigned` `char` `trans_blue`=0)`;

> name - Name of the targa file to load.
> provider - Input source provider that delivers the targa file.
> transparent - True if a transparency color should be used.
> ignore_alphachannel - True if the alpha component should be ignored.
> trans_red - Red component of the transparency color.
> trans_green - Green component of the transparency color.
> trans_blue - blue component of the transparency color.

CL_TargaProvider::create - Loads the targa file 'handle' from the inputsource provider 'provider.
Creates a CL_Surface using the targa image and returns it.
If you just want to load a file, use 'handle' for filename, and set provider to NULL
``static` `CL_Surface`*` `create` `(`std::string` `handle`, `CL_InputSourceProvider`* `provider`, `bool` `transparent`=false, `bool` `ignore_alphachannel`=false, `unsigned` `char` `trans_red`=0, `unsigned` `char` `trans_green`=0, `unsigned` `char` `trans_blue`=0)`;

CL_TargaProvider::get_alpha_mask - Get alpha mask
``virtual` `unsigned` `int`` `get_alpha_mask` `() `const``;

CL_TargaProvider::get_blue_mask - Get blue mask
``virtual` `unsigned` `int`` `get_blue_mask` `() `const``;

CL_TargaProvider::get_data - Returns the image data. Provider must be locked before pointer is valid.
``virtual` `void`*` `get_data` `() `const``;

CL_TargaProvider::get_depth - Returns the pixelformat used by the image.
``virtual` `unsigned` `int`` `get_depth` `() `const``;

CL_TargaProvider::get_green_mask - Get green mask
``virtual` `unsigned` `int`` `get_green_mask` `() `const``;

CL_TargaProvider::get_height - Returns the height of the image.
``virtual` `unsigned` `int`` `get_height` `() `const``;

CL_TargaProvider::get_num_frames - Returns the number of subsprites in the image.
``virtual` `unsigned` `int`` `get_num_frames` `() `const``;

CL_TargaProvider::get_palette - Returns the palette used by the image. NULL if system palette.
``virtual` `CL_Palette`*` `get_palette` `() `const``;

CL_TargaProvider::get_pitch - Returns the pitch of the image (bytes per line).
``virtual` `unsigned` `int`` `get_pitch` `() `const``;

CL_TargaProvider::get_red_mask - Get red mask
``virtual` `unsigned` `int`` `get_red_mask` `() `const``;

CL_TargaProvider::get_src_colorkey - Returns the transparency color used, -1 if none.
``virtual` `unsigned` `int`` `get_src_colorkey` `() `const``;

CL_TargaProvider::get_translate_x - Returns how many pixels to translate the image (X axis).
``virtual` `int`` `get_translate_x` `() `const``;

CL_TargaProvider::get_translate_y - Returns how many pixels to translate the image (Y axis).
``virtual` `int`` `get_translate_y` `() `const``;

CL_TargaProvider::get_width - Returns the width of the image.
``virtual` `unsigned` `int`` `get_width` `() `const``;

CL_TargaProvider::is_indexed - Is indexed
``virtual` `bool`` `is_indexed` `() `const``;

CL_TargaProvider::perform_lock - Locks the surface provider.
``virtual` `void`` `perform_lock` `()`;

CL_TargaProvider::perform_unlock - Unlocks the surface provider.
``virtual` `void`` `perform_unlock` `()`;

CL_TargaProvider::uses_src_colorkey - Uses src colour key
``virtual` `bool`` `uses_src_colorkey` `() `const``;

CL_TargaProvider::~CL_TargaProvider - Target Provider Destructor
``virtual`` `~CL_TargaProvider` `()`;

## Variable Member Descriptions: