Method

CoglTextureset_premultiplied

Declaration [src]

void
cogl_texture_set_premultiplied (
  CoglTexture* texture,
  gboolean premultiplied
)

Description [src]

Affects the internal storage format for this texture by specifying whether red, green and blue color components should be stored as pre-multiplied alpha values.

This api affects how data is uploaded to the GPU since Cogl will convert source data to have premultiplied or unpremultiplied components according to this state.

For example if you create a texture via cogl_texture_2d_new_with_size() and then upload data via cogl_texture_set_data() passing a source format of COGL_PIXEL_FORMAT_RGBA_8888 then Cogl will internally multiply the red, green and blue components of the source data by the alpha component, for each pixel so that the internally stored data has pre-multiplied alpha components. If you instead upload data that already has pre-multiplied components by passing COGL_PIXEL_FORMAT_RGBA_8888_PRE as the source format to cogl_texture_set_data() then the data can be uploaded without being converted.

By default the premultipled state is TRUE.

Available since:1.18

Parameters

premultiplied gboolean
 

Whether any internally stored red, green or blue components are pre-multiplied by an alpha component.