Method

CoglFramebufferread_pixels_into_bitmap

Declaration [src]

gboolean
cogl_framebuffer_read_pixels_into_bitmap (
  CoglFramebuffer* framebuffer,
  int x,
  int y,
  CoglReadPixelsFlags source,
  CoglBitmap* bitmap
)

Description [src]

This reads a rectangle of pixels from the given framebuffer where position (0, 0) is the top left. The pixel at (x, y) is the first read, and a rectangle of pixels with the same size as the bitmap is read right and downwards from that point.

Currently Cogl assumes that the framebuffer is in a premultiplied format so if the format of bitmap is non-premultiplied it will convert it. To read the pixel values without any conversion you should either specify a format that doesn’t use an alpha channel or use one of the formats ending in PRE.

Stability:Unstable
Available since:1.10

Parameters

x int
 

The x position to read from.

y int
 

The y position to read from.

source CoglReadPixelsFlags
 

Identifies which auxiliary buffer you want to read (only COGL_READ_PIXELS_COLOR_BUFFER supported currently)

bitmap CoglBitmap
 

The bitmap to store the results in.

 The data is owned by the caller of the function.

Return value

Returns: gboolean
 

TRUE if the read succeeded or FALSE otherwise. The function is only likely to fail if the bitmap points to a pixel buffer and it could not be mapped.