---
name: "CL_SurfaceProvider"
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_SurfaceProvider"
---

# CL\_SurfaceProvider(3)

The image source interface.

## NAME

CL\_SurfaceProvider - The image source interface.

## DESCRIPTION

This is the interface used by a surface to load an image. For more information about the relationship between a surface and its provider, please the CL\_Surface class description.

The surface provider interface extends the renderer target interface with some blitting related functions. Currently, this is translation of the image and colorkey transparency.

ClanLib includes a large range of surface providers that can load an image from various sources: PCX, TGA, PNG and so on.

If you want to be able to load your (newly created) surface provider as a resource, you have to implement the CL\_ResourceSource\_Surface as well.

Inherited from public CL\_Target

## CLASS MEMBERS

- static CL\_SurfaceProvider \***load**(

  ```
   const char *resource_id,
  CL_ResourceManager *manager)
  ```

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

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

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

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

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

  ## MEMBERS WITH DESCRIPTIONS

- static CL\_SurfaceProvider \***load**(

  ```
   const char *resource_id,
  CL_ResourceManager *manager)
  ```

  ```
  Description:
  ```

  This function loads a surface provider from a resource file (usually a datafile).

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

  ```
  Description:
  ```

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

  ```
  Description:
  ```

  Returns the offset of the surface\_data returned by get\_data(). This translation will be applied to every putscreen using a given surfaceproviders data as input.

  ```
  Return value:
  ```

  The x-offset of the surface data.

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

  ```
  Description:
  ```

  Returns the offset of the surface\_data returned by get\_data(). This translation will be applied to every putscreen using a given surfaceproviders data as input.

  ```
  Return value:
  ```

  The y-offset of the surface data.

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

  ```
  Description:
  ```

  Returns true if the surface provider uses a source color key.

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

  ```
  Description:
  ```

  Returns the source color key.

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