---
name: "CL_TargaProvider"
section: "3"
platform: "linux"
package: "clanlib0-common-dev"
version: "0.4.4-8"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/CL_TargaProvider"
---

# CL\_TargaProvider(3)

Surface provider that can load targa (.tga) files.

## NAME

CL\_TargaProvider - Surface provider that can load targa (.tga) files.

## CLASS MEMBERS

- 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)
  ```

- virtual int **get\_translate\_x**()

  - virtual int **get\_translate\_y**()

  - virtual unsigned int **get\_width**()

  - virtual unsigned int **get\_height**()

  - virtual unsigned int **get\_num\_frames**()

  - virtual unsigned int **get\_depth**()

  - virtual unsigned int **get\_red\_mask**()

  - virtual unsigned int **get\_green\_mask**()

  - virtual unsigned int **get\_blue\_mask**()

  - virtual unsigned int **get\_alpha\_mask**()

  - virtual bool **is\_indexed**()

  - virtual CL\_Palette \***get\_palette**()

  - virtual bool **uses\_src\_colorkey**()

  - virtual unsigned int **get\_src\_colorkey**()

  - virtual void \***get\_data**()

  - virtual void **perform\_lock**()

  - virtual void **perform\_unlock**()

  ## MEMBERS WITH DESCRIPTIONS

- 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)
  ```

  ```
  Description:
  ```

  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 NULLReturns the pitch of the image (bytes per line).

- virtual int **get\_translate\_x**()

  ```
  Description:
  ```

  Returns how many pixels to translate the image (X axis).

- virtual int **get\_translate\_y**()

  ```
  Description:
  ```

  Returns how many pixels to translate the image (Y axis).

- virtual unsigned int **get\_width**()

  ```
  Description:
  ```

  Returns the width of the image.

- virtual unsigned int **get\_height**()

  ```
  Description:
  ```

  Returns the height of the image.

- virtual unsigned int **get\_num\_frames**()

  ```
  Description:
  ```

  Returns the number of subsprites in the image.

- virtual unsigned int **get\_depth**()

  ```
  Description:
  ```

  Returns the pixelformat used by the image.

- virtual unsigned int **get\_red\_mask**()

  ```
  Description:
  ```

- virtual unsigned int **get\_green\_mask**()

  ```
  Description:
  ```

- virtual unsigned int **get\_blue\_mask**()

  ```
  Description:
  ```

- virtual unsigned int **get\_alpha\_mask**()

  ```
  Description:
  ```

- virtual bool **is\_indexed**()

  ```
  Description:
  ```

- virtual CL\_Palette \***get\_palette**()

  ```
  Description:
  ```

  Returns the palette used by the image. NULL if system palette.

- virtual bool **uses\_src\_colorkey**()

  ```
  Description:
  ```

- virtual unsigned int **get\_src\_colorkey**()

  ```
  Description:
  ```

  Returns the transparency color used, -1 if none.

- virtual void \***get\_data**()

  ```
  Description:
  ```

  Returns the image data. Provider must be locked before pointer is valid.

- virtual void **perform\_lock**()

  ```
  Description:
  ```

  Locks the surface provider.

- virtual void **perform\_unlock**()

  ```
  Description:
  ```

  Unlocks the surface provider.

## SEE ALSO

All ClanLib API classes can be found in **clanlib (3)**.

## AUTHORS

Originally written by Magnus Norddahl \<*mbn@dark.x.dtu.dk*\> and Martin Starch \<*starch@dark.x.dtu.dk*\>. ClanLib is now developed by the ClanLib Development team as an Open Source project.

The ClanLib man pages was created using the Perceps documentation system (another excellent piece of Open Source software, available at **http://somewhere.in.the.world.org**).

See **clanlib (3)** to find out how to get a full list of contributors and details on how to submit bug reports, comments etc.
