Method

VipsImagecopy_memory

Declaration [src]

VipsImage*
vips_image_copy_memory (
  VipsImage* image
)

Description [src]

This function allocates memory, renders image into it, builds a new image around the memory area, and returns that.

If the image is already a simple area of memory, it just refs image and returns it.

Call this before using the draw operations to make sure you have a memory image that can be modified.

vips_copy() adds a null “copy” node to a pipeline. Use that instead if you want to change metadata and not pixels.

This operation is thread-safe, unlike vips_image_wio_input().

If you are sure that image is not shared with another thread (perhaps you have made it yourself), use vips_image_wio_input() instead.

Return value

Type: VipsImage

The new VipsImage, or NULL on error.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.