next up previous contents
Next: 5.4 Computing with VMask Up: 5. The VMask class Previous: 5.2 Projection functions   Contents

5.3 Assignment

VMask defines copy and assignment with pointer-style semantics. You can write stuff like:

VIMask fred( "mask" );
VMask jim;

jim = fred;

This reads the file mask, noting a pointer to the mask in fred. It then makes jim also point to it, so jim and fred are sharing the same underlying matrix values.

Internally, a VMask object is just a pointer to a reference-counting block, which in turn holds a pointer to the underlying VIPS MASK type. You can therefore efficiently pass VMask objects to functions by value, and return VMask objects as function results.



John Cupitt 2003-07-21