Cogl.AtlasTexture.new_from_bitmap

function new_from_bitmap(bmp: Cogl.Bitmap): Cogl.AtlasTexture {
    // Gjs wrapper for cogl_atlas_texture_new_from_bitmap()
}
  

Creates a new Cogl.AtlasTexture texture based on data residing in a @bitmap. A Cogl.AtlasTexture represents a sub-region within one of Cogl's shared texture atlases.

The storage for the texture is not allocated before this function returns. You can call Cogl.Texture.prototype.allocate to explicitly allocate the underlying storage or preferably let Cogl automatically allocate storage lazily when it may know more about how the texture is being used and can optimize how it is allocated.

The texture is still configurable until it has been allocated so for example you can influence the internal format of the texture using Cogl.Texture.prototype.set_components and Cogl.Texture.prototype.set_premultiplied.

<note>Allocate call can fail if Cogl considers the internal format to be incompatible with the format of its internal atlases.</note>

<note>The returned Cogl.AtlasTexture is a high-level meta-texture with some limitations. See the documentation for Cogl.MetaTexture for more details.</note>

Since 1.16

bmp
Returns

A new Cogl.AtlasTexture object.