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

An output buffer implementation that cannot be resized.

The constructor takes a pointer to the already allocated buffer. The caller remains the owner of this buffer. If the buffer is not large enough to contain the full output, an exception will be thrown. The first dip::FixedOutputBuffer::size bytes of this buffer will contain the encoded image data after the image writing function has done its thing.

Base classes

class dip::OutputBuffer abstract
A pure virtual base class for output buffers.

Constructors, destructors, assignment and conversion operators

FixedOutputBuffer(dip::uint8* buffer, dip::uint size)
Constructor.

Functions

auto size() -> dip::uint override
Returns the size of the data stored in the buffer.
void set_size(dip::uint size) override
Sets the size of the data stored in the buffer.
auto capacity() -> dip::uint override
Returns the capacity of the buffer.
void assure_capacity(dip::uint capacity) override
Throws an exception if the buffer doesn’t have at least capacity bytes.
auto data() -> dip::uint8* override
Returns a pointer to the data.