File I/O module
#include "diplib/file_io.h"
dip::OutputBuffer class

A pure virtual base class for output buffers.

Contents

Some image writing functions can write the file to a memory buffer. They do so through an object derived from this class.

Derived classes

class dip::SimpleOutputBuffer
A simple output buffer implementation.
class dip::FixedOutputBuffer
An output buffer implementation that cannot be resized.

Functions

auto size() -> dip::uint virtual
Returns the size of the data stored in the buffer.
void set_size(dip::uint ) virtual
Sets the size of the data stored in the buffer. Must never be larger than dip::OutputBuffer::capacity or bad things will happen.
auto capacity() -> dip::uint virtual
Returns the capacity of the buffer (i.e. the size of the memory allocated for the buffer).
void assure_capacity(dip::uint ) virtual
Increases the buffer’s dip::OutputBuffer::capacity to be at least capacity. This is used by the writing functions when the buffer is full. Can throw an exception if the buffer implementation doesn’t support resizing.
auto data() -> dip::uint8* pure virtual
Returns a pointer to the data.