---
name: "CL_SpriteProvider"
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_SpriteProvider"
---

# CL\_SpriteProvider(3)

ClanLib datafile sprite. Used to load surfaces stored in ClanLib's datafile sprite format.

## NAME

CL\_SpriteProvider - ClanLib datafile sprite. Used to load surfaces stored in ClanLib's datafile sprite format.

## CLASS MEMBERS

- static CL\_Surface \***create**(

  ```
  const char *surface_id,
  CL_InputSourceProvider *datafile)
  ```

- **CL\_SpriteProvider**(

  ```
  const char *surface_id,
  CL_InputSourceProvider *datafile)
  ```

- virtual **~CL\_SpriteProvider**()

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

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

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

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

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

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

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

  - 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 unsigned int **get\_depth**()

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

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

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

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

  ## MEMBERS WITH DESCRIPTIONS

- static CL\_Surface \***create**(

  ```
  const char *surface_id,
  CL_InputSourceProvider *datafile)
  ```

  ```
  Description:
  ```

  Loads the sprite *surface\_id* from the inputsource provider *datafile*. Creates a surface using this sprite (surfaceprovider) and returns it.This function is a easier way of typing: CL\_Surface::create(new CL\_Sprite(surface\_id, datafile), true);

- **CL\_SpriteProvider**(

  ```
  const char *surface_id,
  CL_InputSourceProvider *datafile)
  ```

  ```
  Description:
  ```

  Constructs a surface provider that represents the sprite *surface\_id* from the inputsource provider *datafile*.

- virtual **~CL\_SpriteProvider**()

  ```
  Description:
  ```

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

  ```
  Description:
  ```

  Returns the width of the sprite.

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

  ```
  Description:
  ```

  Returns the height of the sprite.

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

  ```
  Description:
  ```

  Returns the pitch of the sprite.

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

  ```
  Description:
  ```

  Returns the number of subsprites in this sprite.

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

  ```
  Description:
  ```

  Returns the palette used by the surface. NULL if the system palette is used.

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

  ```
  Description:
  ```

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

  ```
  Description:
  ```

  Returns the transparency color used, or -1 if none.

- 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 unsigned int **get\_depth**()

  ```
  Description:
  ```

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

  ```
  Description:
  ```

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

  ```
  Description:
  ```

  Returns a pointer to the sprites image data. Can only be called between lock() and unlock().

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

  ```
  Description:
  ```

  Locks the surface provider. This causes the sprite to retrieve its surface data from the datafile.

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

  ```
  Description:
  ```

  Unlocks the surface provider. The sprite releases its surface data whenit is called.

## 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.
