### Method

# Vips Region prepare_to

#### Declaration [src]

    int
    vips_region_prepare_to (
      VipsRegion* reg,
      VipsRegion* dest,
      const VipsRect* r,
      int x,
      int y
    )

#### Description [src]

Like `vips_region_prepare()`: fill `reg` with the pixels in area `r`.

Unlike `vips_region_prepare()`, rather than writing the result to `reg`, the pixels are written into `dest` at offset `x`, `y`.

Also unlike `vips_region_prepare()`, `dest` is not set up for writing for you with `vips_region_buffer()`. You can point `dest` at anything, and pixels really will be written there. This makes `vips_region_prepare_to()` useful for making the ends of pipelines.

See also

`vips_region_prepare()`, `vips_sink_disc()`.

#### Parameters

`dest`

  Type: `VipsRegion`

  Region to write to.

  The data is owned by the caller of the method.

`r`

  Type: `VipsRect`

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

  The data is owned by the caller of the method.

`x`

  Type: `int`

  Position of `r` in `dest`.

`y`

  Type: `int`

  Position of `r` in `dest`.

#### Return value

Type: `int`

0 on success, or -1 on error.