Skip to content

Commit a77519f

Browse files
committed
try to improve docs
see #2733 (reply in thread)
1 parent eaf34b8 commit a77519f

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

cplusplus/include/vips/VImage8.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -988,9 +988,16 @@ class VImage : public VObject
988988
}
989989

990990
/**
991-
* Make a new image by rendering self to a large memory area,
992-
* wrapping a VImage around it, and copying all metadata over from
993-
* self.
991+
* This operation allocates memory, renders self into it, builds a new
992+
* image around the memory area, and returns that.
993+
*
994+
* If the image is already a simple area of memory, it does nothing.
995+
*
996+
* Call this before using the draw operations to make sure you have a
997+
* memory image that can be modified.
998+
*
999+
* VImage::copy() adds a null "copy" node to a pipeline. Use that
1000+
* instead if you want to change metadata and not pixels.
9941001
*/
9951002
VImage
9961003
copy_memory() const

libvips/iofuncs/image.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3309,10 +3309,17 @@ vips_image_rewind_output( VipsImage *image )
33093309
* vips_image_copy_memory:
33103310
* @image: image to copy to a memory buffer
33113311
*
3312-
* Make an image which is an area of memory.
3312+
* This function allocates memory, renders @image into it, builds a new
3313+
* image around the memory area, and returns that.
33133314
*
3314-
* If @image is already a memory buffer, just ref and return. If it's a file on
3315-
* disc or a partial, allocate memory and copy the image to it.
3315+
* If the image is already a simple area of memory, it just refs @image and
3316+
* returns it.
3317+
*
3318+
* Call this before using the draw operations to make sure you have a
3319+
* memory image that can be modified.
3320+
*
3321+
* vips_image_copy() adds a null "copy" node to a pipeline. Use that
3322+
* instead if you want to change metadata and not pixels.
33163323
*
33173324
* This operation is thread-safe, unlike vips_image_wio_input().
33183325
*

0 commit comments

Comments
 (0)