Cogl.Texture.get_data

### Method

# Cogl Textureget_data

#### Declaration [src]

    int
    cogl_texture_get_data (
      CoglTexture* texture,
      CoglPixelFormat format,
      unsigned int rowstride,
      uint8_t* data
    )

#### Description [src]

Copies the pixel data from a cogl texture to system memory.

Don’t pass the value of `cogl_texture_get_rowstride()` as the `rowstride` argument, the rowstride should be the rowstride you want for the destination `data` buffer not the rowstride of the source texture

#### Parameters

`format` | `CoglPixelFormat`
| The `CoglPixelFormat` to store the texture as.
`rowstride` | `unsigned int`
| The rowstride of `data` in bytes or pass 0 to calculate from the bytes-per-pixel of `format` multiplied by the `texture` width.
`data` | An array of `uint8_t`
| Memory location to write the `texture`‘s contents, or `NULL` to only query the data size through the return value.
| The argument can be `NULL`.
| The data is owned by the caller of the function.

#### Return value

Returns: | `int`
| The size of the texture data in bytes.