Next: 3.7 Type conversions Up: 3. The VImage class Previous: 3.5 Computing with VImages Contents

# 3.6 Writing results

Once you have computed some result, you can write it to a file with the member `write()`. It takes the following forms:

    VImage write( const char *name );
    VImage write( VImage out );
    VImage write();

The first form simply writes the image to the named file. The second form writes the image to the specified `VImage` object, for example:

    VImage fred( "fred.v" );
    VImage jim( "jim buffer", "t" );

    Vimage result = (fred + 42).write( jim );

This creates a temporary memory buffer called `jim`, and fills it with the result of adding 42 to every pixel in `fred.v`.

The final form of `write()` writes the image to a memory buffer, and returns that.