Cogl.AtlasTexture¶
- Subclasses:
None
Methods¶
- Inherited:
class |
|
class |
|
class |
|
class |
|
Virtual Methods¶
None
Fields¶
None
Class Details¶
- class Cogl.AtlasTexture¶
- Bases:
- Abstract:
No
- classmethod new_from_bitmap(bmp)¶
- Parameters:
bmp (
Cogl.Bitmap
) –- Returns:
A new
Cogl.AtlasTexture
object.- Return type:
Creates a new
Cogl.AtlasTexture
texture based on data residing in a bitmap. ACogl.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
() andCogl.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
) – ACogl.Context
width (
int
) – width of texture in pixelsheight (
int
) – height of texture in pixelsformat (
Cogl.PixelFormat
) – theCogl.PixelFormat
the buffer is stored in in RAMrowstride (
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:
- Returns:
A new
Cogl.AtlasTexture
object orNone
on failure and error will be updated.- Return type:
Creates a new
Cogl.AtlasTexture
texture based on data residing in memory. ACogl.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 useCogl.AtlasTexture.new_from_bitmap
() or useCogl.AtlasTexture.new_with_size
() and then upload data usingCogl.Texture.set_data
() Allocate call can fail if Cogl considers the internal format to be incompatible with the format of its internal atlases. The returnedCogl.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:
ctx (
Cogl.Context
) – ACogl.Context
filename (
str
) – the file to load
- Raises:
- Returns:
A new
Cogl.AtlasTexture
object orNone
on failure and error will be updated.- Return type:
Creates a
Cogl.AtlasTexture
from an image file. ACogl.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
() andCogl.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:
ctx (
Cogl.Context
) – ACogl.Context
width (
int
) – The width of your atlased texture.height (
int
) – The height of your atlased texture.
- Returns:
A new
Cogl.AtlasTexture
object.- Return type:
Creates a
Cogl.AtlasTexture
with a given width and height. ACogl.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
() andCogl.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.