Vips.Image.sink_disc

### Method

# Vips Imagesink_disc

#### Declaration [src]

    int
    vips_sink_disc (
      VipsImage* im,
      VipsRegionWrite write_fn,
      void* a
    )

#### Description [src]

`vips_sink_disc()` loops over `im`, top-to-bottom, generating it in sections. As each section is produced, `write_fn` is called.

`write_fn` is always called single-threaded (though not always from the same thread), it’s always given image sections in top-to-bottom order, and there are never any gaps.

This operation is handy for making image sinks which output to things like disc files. Things like `vips_jpegsave()`, for example, use this to write images to files in JPEG format.

See also

`vips_concurrency_set()`.

#### Parameters

`write_fn`

  Type: `VipsRegionWrite`

  Called for every batch of pixels.

`a`

  Type: `void*`

  Client data.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

#### Return value

Type: `int`

0 on success, -1 on error.