Cogl.Texture3D.new_from_data
function new_from_data(context: Cogl.Context, width: Number(gint), height: Number(gint), depth: Number(gint), format: Cogl.PixelFormat, rowstride: Number(gint), image_stride: Number(gint), data: Number(guint8)): Cogl.Texture3D { // Gjs wrapper for cogl_texture_3d_new_from_data() }
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.
<note>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.</note>
Since 1.10
- context
- width
width of the texture in pixels.
- height
height of the texture in pixels.
- depth
depth of the texture in pixels.
- format
the Cogl.PixelFormat the buffer is stored in in RAM
- rowstride
the memory offset in bytes between the starts of scanlines in data or 0 to infer it from the width and format
- image_stride
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
pointer the memory region where the source buffer resides
- Returns
the newly created Cogl.Texture3D or null if there was an error and an exception will be returned through @error.