Cogl.AtlasTexture

g Cogl.AtlasTexture Cogl.AtlasTexture Cogl.Object Cogl.Object Cogl.Object->Cogl.AtlasTexture

Subclasses:

None

Methods

Inherited:

Cogl.Object (2)

class

new_from_bitmap (bmp)

class

new_from_data (ctx, width, height, format, rowstride, data)

class

new_from_file (ctx, filename)

class

new_with_size (ctx, width, height)

Virtual Methods

None

Fields

None

Class Details

class Cogl.AtlasTexture
Bases:

Cogl.Object

Abstract:

No

classmethod new_from_bitmap(bmp)
Parameters:

bmp (Cogl.Bitmap) –

Returns:

A new Cogl.AtlasTexture object.

Return type:

Cogl.AtlasTexture

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.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.set_components() and Cogl.Texture.set_premultiplied().

Allocate call can fail if Cogl considers the internal format to be incompatible with the format of its internal atlases. The returned Cogl.AtlasTexture is a high-level meta-texture with some limitations. See the documentation for #CoglMetaTexture for more details.

New in version 1.16.

classmethod new_from_data(ctx, width, height, format, rowstride, data)
Parameters:
  • ctx (Cogl.Context) – A Cogl.Context

  • width (int) – width of texture in pixels

  • height (int) – height of texture in pixels

  • format (Cogl.PixelFormat) – the Cogl.PixelFormat the buffer is stored in in RAM

  • rowstride (int) – the memory offset in bytes between the start of each row in data. A value of 0 will make Cogl automatically calculate rowstride from width and format.

  • data (int) – pointer to the memory region where the source buffer resides

Raises:

GLib.Error

Returns:

A new Cogl.AtlasTexture object or None on failure and error will be updated.

Return type:

Cogl.AtlasTexture

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

This api will always immediately allocate GPU memory for the texture and upload the given data so that the data pointer does not need to remain valid once this function returns. This means it is not possible to configure the texture before it is allocated. If you do need to configure the texture before allocation (to specify constraints on the internal format for example) then you can instead create a Cogl.Bitmap for your data and use Cogl.AtlasTexture.new_from_bitmap() or use Cogl.AtlasTexture.new_with_size() and then upload data using Cogl.Texture.set_data() Allocate call can fail if Cogl considers the internal format to be incompatible with the format of its internal atlases. The returned Cogl.AtlasTexture is a high-level meta-texture with some limitations. See the documentation for #CoglMetaTexture for more details.

New in version 1.16.

classmethod new_from_file(ctx, filename)
Parameters:
Raises:

GLib.Error

Returns:

A new Cogl.AtlasTexture object or None on failure and error will be updated.

Return type:

Cogl.AtlasTexture

Creates a Cogl.AtlasTexture from an image file. 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.allocate() to explicitly allocate the underlying storage or let Cogl automatically allocate storage lazily.

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.set_components() and Cogl.Texture.set_premultiplied().

Allocate call can fail if Cogl considers the internal format to be incompatible with the format of its internal atlases. The returned Cogl.AtlasTexture is a high-level meta-texture with some limitations. See the documentation for #CoglMetaTexture for more details.

New in version 1.16.

classmethod new_with_size(ctx, width, height)
Parameters:
Returns:

A new Cogl.AtlasTexture object.

Return type:

Cogl.AtlasTexture

Creates a Cogl.AtlasTexture with a given width and height. 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.allocate() to explicitly allocate the underlying storage or let Cogl automatically allocate storage lazily.

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.set_components() and Cogl.Texture.set_premultiplied().

Allocate call can fail if Cogl considers the internal format to be incompatible with the format of its internal atlases. The returned Cogl.AtlasTexture is a high-level meta-texture with some limitations. See the documentation for #CoglMetaTexture for more details.

New in version 1.16.