Cogl.Bitmap.new_for_data
function new_for_data(context: Cogl.Context, width: Number(gint), height: Number(gint), format: Cogl.PixelFormat, rowstride: Number(gint), data: Number(guint8)): Cogl.Bitmap { // Gjs wrapper for cogl_bitmap_new_for_data() }
Creates a bitmap using some existing data. The data is not copied so the application must keep the buffer alive for the lifetime of the Cogl.Bitmap. This can be used for example with Cogl.Framebuffer.prototype.read_pixels_into_bitmap to read data directly into an application buffer with the specified rowstride.
Since 1.10
- context
- width
The width of the bitmap.
- height
The height of the bitmap.
- format
The format of the pixel data.
- rowstride
The rowstride of the bitmap (the number of bytes from the start of one row of the bitmap to the next).
- data
A pointer to the data. The bitmap will take ownership of this data.
- Returns
A new Cogl.Bitmap.