VImage
defines copy and assignment, with reference-counted
pointer-style semantics. For example, if you write:
VImage fred( "fred.v" ); VImage jim( "jim.v" ); fred = jim;
This will automatically close the file fred.v
, and make the variable
fred
point to the image jim.v
instead. Both jim
and
fred
now point to the same underlying image object.
Internally, a VImage
object is just a pointer to a reference-counting
block, which in turn holds a pointer to the underlying VIPS IMAGE
type.
You can therefore efficiently pass VImage
objects to functions by
value, and return VImage
objects as function results.