### Method

# Gimp Brush get_buffer

#### Declaration [src]

    GeglBuffer*
    gimp_brush_get_buffer (
      GimpBrush* brush,
      gint max_width,
      gint max_height,
      const Babl* format
    )

#### Description [src]

Gets pixel data of the brush within the bounding box specified by `max_width` and `max_height`. The data will be scaled down so that it fits within this size without changing its ratio. If the brush is smaller than this size to begin with, it will not be scaled up.

If `max_width` or `max_height` are `NULL`, the buffer is returned in the brush’s native size.

When the brush is parametric or a raster mask, only the mask (as returned by `gimp_brush_get_mask()`) will be set. The returned buffer will be NULL.

Make sure you called `gegl_init()` before calling any function using `GEGL`.

#### Parameters

`max_width`

  Type: `gint`

  A maximum width for the returned buffer.

`max_height`

  Type: `gint`

  A maximum height for the returned buffer.

`format`

  Type: `Babl`

  An optional Babl format.

  The data is owned by the caller of the method.

#### Return value

Type: `GeglBuffer`

A `GeglBuffer` of `NULL` if the brush is parametric or mask only.

The caller of the method takes ownership of the data, and is responsible for freeing it.