Cogl.Texture.prototype.set_premultiplied

function set_premultiplied(premultiplied: Cogl.Bool): void {
    // Gjs wrapper for cogl_texture_set_premultiplied()
}
  

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.Texture2D.new_with_size and then upload data via Cogl.Texture.prototype.set_data passing a source format of Cogl.PixelFormat.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.PixelFormat.rgba_8888_pre as the source format to Cogl.Texture.prototype.set_data then the data can be uploaded without being converted.

By default the @premultipled state is @TRUE.

Since 1.18

premultiplied

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