Method

VipsImagesubsample

Declaration [src]

int
vips_subsample (
  VipsImage* in,
  VipsImage** out,
  int xfac,
  int yfac,
  ...
)

Description [src]

Subsample an image by an integer fraction. This is fast, nearest-neighbour shrink.

For small horizontal shrinks, this operation will fetch lines of pixels from in and then subsample that line. For large shrinks it will fetch single pixels.

If point is set, in will always be sampled in points. This can be faster if the previous operations in the pipeline are very slow.

::: tip “Optional arguments” * point: gboolean, turn on point sample mode

::: seealso vips_affine(), vips_shrink(), vips_zoom().

Parameters

out VipsImage
 

Output image.

 The argument will be set by the function.
 The instance takes ownership of the data, and is responsible for freeing it.
xfac int
 

Horizontal shrink factor.

yfac int
 

Vertical shrink factor.

... none
 

NULL-terminated list of optional named arguments.

Return value

Returns: int
 

0 on success, -1 on error.