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.AtlasTextureobject.- Return type:
Creates a new
Cogl.AtlasTexturetexture based on data residing in a bitmap. ACogl.AtlasTexturerepresents 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.AtlasTextureis 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.Contextwidth (
int) – width of texture in pixelsheight (
int) – height of texture in pixelsformat (
Cogl.PixelFormat) – theCogl.PixelFormatthe 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.AtlasTextureobject orNoneon failure and error will be updated.- Return type:
Creates a new
Cogl.AtlasTexturetexture based on data residing in memory. ACogl.AtlasTexturerepresents 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.Bitmapfor 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.AtlasTextureis 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.Contextfilename (
str) – the file to load
- Raises:
- Returns:
A new
Cogl.AtlasTextureobject orNoneon failure and error will be updated.- Return type:
Creates a
Cogl.AtlasTexturefrom an image file. ACogl.AtlasTexturerepresents 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.AtlasTextureis 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.Contextwidth (
int) – The width of your atlased texture.height (
int) – The height of your atlased texture.
- Returns:
A new
Cogl.AtlasTextureobject.- Return type:
Creates a
Cogl.AtlasTexturewith a given width and height. ACogl.AtlasTexturerepresents 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.AtlasTextureis a high-level meta-texture with some limitations. See the documentation for #CoglMetaTexture for more details.New in version 1.16.