Cogl.Texture.prototype.get_data

function get_data(format: Cogl.PixelFormat, rowstride: Number(guint), data: Number(guint8)): Number(gint) {
    // Gjs wrapper for cogl_texture_get_data()
}
  

Copies the pixel data from a cogl texture to system memory.

<note>Don't pass the value of cogl_texture_get_rowstride() as the rowstride argument, the rowstride should be the rowstride you want for the destination data buffer not the rowstride of the source texture</note>

format

the Cogl.PixelFormat to store the texture as.

rowstride

the rowstride of data in bytes or pass 0 to calculate from the bytes-per-pixel of format multiplied by the texture width.

data

memory location to write the texture's contents, or null to only query the data size through the return value.

Returns

the size of the texture data in bytes