Vips.Region.region

### Method

# Vips Regionregion

#### Declaration [src]

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

#### Description [src]

Make `VIPS_REGION_ADDR()` on `reg` go to `dest` instead.

`r` is the part of `reg` which you want to be able to address (this effectively becomes the valid field), (`x`, `y`) is the top LH corner of the corresponding area in `dest`.

Performs all clipping necessary to ensure that `reg`->valid is indeed valid.

If the region we attach to is moved or destroyed, we can be left with dangling pointers! If the region we attach to is on another image, the two images must have the same sizeof(pel).

#### Parameters

`dest`

  Type: `VipsRegion`

  Region to connect 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 for error.