Method

VipsImagecopy

Declaration [src]

int
vips_copy (
  VipsImage* in,
  VipsImage** out,
  ...
)

Description [src]

Copy an image, optionally modifying the header. VIPS copies images by copying pointers, so this operation is instant, even for very large images.

You can optionally change any or all header fields during the copy. You can make any change which does not change the size of a pel, so for example you can turn a 4-band uchar image into a 2-band ushort image, but you cannot change a 100 x 100 RGB image into a 300 x 100 mono image.

::: tip “Optional arguments” * width: gint, set image width * height: gint, set image height * bands: gint, set image bands * format: VipsBandFormat, set image format * coding: VipsCoding, set image coding * interpretation: VipsInterpretation, set image interpretation * xres: gdouble, set image xres * yres: gdouble, set image yres * xoffset: gint, set image xoffset * yoffset: gint, set image yoffset

::: seealso vips_byteswap(), vips_bandfold(), vips_bandunfold().

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.
... none
 

NULL-terminated list of optional named arguments.

Return value

Returns: int
 

0 on success, -1 on error.