Cogl.Texture3D

g Cogl.Object Cogl.Object Cogl.Texture3D Cogl.Texture3D Cogl.Object->Cogl.Texture3D Cogl.Texture Cogl.Texture Cogl.Texture->Cogl.Texture3D GObject.GInterface GObject.GInterface GObject.GInterface->Cogl.Texture

Implementations:

None

Methods

Inherited:

Cogl.Object (2), Cogl.Texture (14)

class

new_from_bitmap (bitmap, height, depth)

class

new_from_data (context, width, height, depth, format, rowstride, image_stride, data)

class

new_with_size (context, width, height, depth)

Virtual Methods

None

Properties

None

Signals

None

Fields

None

Class Details

class Cogl.Texture3D
Bases:

Cogl.Object, Cogl.Texture

classmethod new_from_bitmap(bitmap, height, depth)
Parameters:
  • bitmap (Cogl.Bitmap) – A Cogl.Bitmap object.

  • height (int) – height of the texture in pixels.

  • depth (int) – depth of the texture in pixels.

Returns:

a newly created Cogl.Texture3D

Return type:

Cogl.Texture3D

Creates a low-level 3D texture and initializes it with the images in bitmap. The images are assumed to be packed together after one another in the increasing y axis. The height of individual image is given as height and the number of images is given in depth. The actual height of the bitmap can be larger than height × depth. In this case it assumes there is padding between the images.

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 going to be 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().

This texture will fail to allocate later if Cogl.FeatureID.OGL_FEATURE_ID_TEXTURE_3D is not advertised. Allocation can also fail if the requested dimensions are not supported by the GPU.

New in version 2.0.

classmethod new_from_data(context, width, height, depth, format, rowstride, image_stride, data)
Parameters:
  • context (Cogl.Context) – a Cogl.Context

  • width (int) – width of the texture in pixels.

  • height (int) – height of the texture in pixels.

  • depth (int) – depth of the 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 starts of scanlines in data or 0 to infer it from the width and format

  • image_stride (int) – the number of bytes from one image to the next. This can be used to add padding between the images in a similar way that the rowstride can be used to add padding between rows. Alternatively 0 can be passed to infer the image_stride from the height.

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

Raises:

GLib.Error

Returns:

the newly created Cogl.Texture3D or None if there was an error and an exception will be returned through error.

Return type:

Cogl.Texture3D

Creates a low-level 3D texture and initializes it with data. The data is assumed to be packed array of depth images. There can be padding between the images using image_stride.

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.Texture3D.new_from_bitmap().

New in version 1.10.

classmethod new_with_size(context, width, height, depth)
Parameters:
  • context (Cogl.Context) – a Cogl.Context

  • width (int) – width of the texture in pixels.

  • height (int) – height of the texture in pixels.

  • depth (int) – depth of the texture in pixels.

Returns:

A new Cogl.Texture3D object with no storage yet allocated.

Return type:

Cogl.Texture3D

Creates a low-level Cogl.Texture3D texture with the specified dimensions and pixel format.

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 going to be 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().

This texture will fail to allocate later if Cogl.FeatureID.OGL_FEATURE_ID_TEXTURE_3D is not advertised. Allocation can also fail if the requested dimensions are not supported by the GPU.

New in version 1.10.