Cogl.Bitmap.new_for_data
Description: Reference for Cogl.Bitmap.new_for_data

### Constructor

# Cogl Bitmapnew_for_data

#### Declaration [src]

    CoglBitmap*
    cogl_bitmap_new_for_data (
      CoglContext* context,
      int width,
      int height,
      CoglPixelFormat format,
      int rowstride,
      uint8_t* data
    )

#### Description [src]

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 `CoglBitmap`. This can be used for example with `cogl_framebuffer_read_pixels_into_bitmap()` to read data directly into an application buffer with the specified rowstride.

Stability: | Unstable
Available since: | 1.10
This constructor is not directly available to language bindings

#### Parameters

`context` | `CoglContext`
| A `CoglContext`.
| The data is owned by the caller of the function.
`width` | `int`
| The width of the bitmap.
`height` | `int`
| The height of the bitmap.
`format` | `CoglPixelFormat`
| The format of the pixel data.
`rowstride` | `int`
| The rowstride of the bitmap (the number of bytes from the start of one row of the bitmap to the next).
`data` | `uint8_t*`
| A pointer to the data. The bitmap will take ownership of this data.
| The data is owned by the caller of the function.

#### Return value

Returns: | `CoglBitmap`
| A new `CoglBitmap`.
| The caller of the function takes ownership of the data, and is responsible for freeing it.