read_pixels


Description:

public Bool read_pixels (int x, int y, int width, int height, PixelFormat format, uint8 pixels)

This is a convenience wrapper around read_pixels_into_bitmap which allocates a temporary Bitmap to read pixel data directly into the given buffer.

The rowstride of the buffer is assumed to be the width of the region times the bytes per pixel of the format. The source for the data is always taken from the color buffer. If you want to use any other rowstride or source, please use the read_pixels_into_bitmap function directly.

The implementation of the function looks like this:

bitmap = cogl_bitmap_new_for_data (context,
width, height,
format,
/<!-- -->* rowstride *<!-- -->/
bpp * width,
pixels);
cogl_framebuffer_read_pixels_into_bitmap (framebuffer,
x, y,
COGL_READ_PIXELS_COLOR_BUFFER,
bitmap);
cogl_object_unref (bitmap);

Parameters:

this

A Framebuffer

x

The x position to read from

y

The y position to read from

width

The width of the region of rectangles to read

height

The height of the region of rectangles to read

format

The pixel format to store the data in

pixels

The address of the buffer to store the data in

Returns:

true if the read succeeded or false otherwise.