Vips.Region.prepare

### Method

# Vips Regionprepare

#### Declaration [src]

    int
    vips_region_prepare (
      VipsRegion* reg,
      const VipsRect* r
    )

#### Description [src]

`vips_region_prepare()` fills `reg` with pixels. After calling, you can address at least the area `r` with `VIPS_REGION_ADDR()` and get valid pixels.

`vips_region_prepare()` runs in-line, that is, computation is done by the calling thread, no new threads are involved, and computation blocks until the pixels are ready.

Use `vips_sink_screen()` to calculate an area of pixels in the background.

See also

`vips_sink_screen()`, `vips_region_prepare_to()`.

#### Parameters

`r`

  Type: `VipsRect`

  `VipsRect` of pixels you need to be able to address.

  The data is owned by the caller of the method.

#### Return value

Type: `int`

0 on success, or -1 on error.