Cogl.Bitmap.new_from_buffer

function new_from_buffer(buffer: Cogl.Buffer, format: Cogl.PixelFormat, width: Number(gint), height: Number(gint), rowstride: Number(gint), offset: Number(gint)): Cogl.Bitmap {
    // Gjs wrapper for cogl_bitmap_new_from_buffer()
}
  

Wraps some image data that has been uploaded into a Cogl.Buffer as a Cogl.Bitmap. The data is not copied in this process.

Since 1.8

buffer

A Cogl.Buffer containing image data

format

The Cogl.PixelFormat defining the format of the image data in the given buffer.

width

The width of the image data in the given buffer.

height

The height of the image data in the given buffer.

rowstride

The rowstride in bytes of the image data in the given buffer.

offset

The offset into the given buffer to the first pixel that should be considered part of the Cogl.Bitmap.

Returns

a Cogl.Bitmap encapsulating the given buffer.