| Cogl 2.0 Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
CoglTexture; gboolean cogl_is_texture (void *object); unsigned int cogl_texture_get_width (CoglTexture *texture); unsigned int cogl_texture_get_height (CoglTexture *texture); CoglPixelFormat cogl_texture_get_format (CoglTexture *texture); gboolean cogl_texture_is_sliced (CoglTexture *texture); int cogl_texture_get_data (CoglTexture *texture,CoglPixelFormat format,unsigned int rowstride,guint8 *data); gboolean cogl_texture_set_region (CoglTexture *texture,int src_x,int src_y,int dst_x,int dst_y,unsigned int dst_width,unsigned int dst_height,int width,int height,CoglPixelFormat format,unsigned int rowstride,const guint8 *data); enum CoglTextureType;
Cogl allows creating and manipulating textures using a uniform API that tries to hide all the various complexities of creating, loading and manipulating textures.
gboolean cogl_is_texture (void *object);
Gets whether the given object references a texture object.
|
A CoglObject pointer |
Returns : |
TRUE if the handle references a texture, and
FALSE otherwise |
unsigned int cogl_texture_get_width (CoglTexture *texture);
Queries the width of a cogl texture.
Returns : |
the width of the GPU side texture in pixels |
unsigned int cogl_texture_get_height (CoglTexture *texture);
Queries the height of a cogl texture.
Returns : |
the height of the GPU side texture in pixels |
CoglPixelFormat cogl_texture_get_format (CoglTexture *texture);
Queries the CoglPixelFormat of a cogl texture.
Returns : |
the CoglPixelFormat of the GPU side texture |
gboolean cogl_texture_is_sliced (CoglTexture *texture);
Queries if a texture is sliced (stored as multiple GPU side tecture objects).
int cogl_texture_get_data (CoglTexture *texture,CoglPixelFormat format,unsigned int rowstride,guint8 *data);
Copies the pixel data from a cogl texture to system memory.
cogl_texture_get_rowstride() as the
rowstride argument, the rowstride should be the rowstride you
want for the destination data buffer not the rowstride of the
source texture
|
the CoglPixelFormat to store the texture as. |
|
the rowstride of data in bytes or pass 0 to calculate
from the bytes-per-pixel of format multiplied by the
texture width. |
|
memory location to write the texture's contents, or NULL
to only query the data size through the return value. |
Returns : |
the size of the texture data in bytes |
gboolean cogl_texture_set_region (CoglTexture *texture,int src_x,int src_y,int dst_x,int dst_y,unsigned int dst_width,unsigned int dst_height,int width,int height,CoglPixelFormat format,unsigned int rowstride,const guint8 *data);
Sets the pixels in a rectangular subregion of texture from an in-memory
buffer containing pixel data.
data
|
upper left coordinate to use from source data. |
|
upper left coordinate to use from source data. |
|
upper left destination horizontal coordinate. |
|
upper left destination vertical coordinate. |
|
width of destination region to write. (Must be less
than or equal to width) |
|
height of destination region to write. (Must be less
than or equal to height) |
|
width of source data buffer. |
|
height of source data buffer. |
|
the CoglPixelFormat used in the source buffer. |
|
rowstride of source buffer (computed from width if none specified) |
|
the actual pixel data. |
Returns : |
TRUE if the subregion upload was successful, and
FALSE otherwise |
typedef enum {
COGL_TEXTURE_TYPE_2D,
COGL_TEXTURE_TYPE_3D,
COGL_TEXTURE_TYPE_RECTANGLE
} CoglTextureType;
Constants representing the underlying hardware texture type of a CoglTexture.
Since 1.10
Stability Level: Unstable