SimpleOutputBuffer class
A simple output buffer implementation.
Contents
The constructor takes a std::vector< dip::uint8 > by reference. This vector needs to remain in scope wherever the
SimpleOutputBuffer object is in scope. The first dip::SimpleOutputBuffer::size bytes of this vector will contain the encoded image
data after the image writing function has done its thing.
Base classes
-
class dip::
OutputBuffer abstract - An abstract base class for output buffers. more...
Constructors, destructors, assignment and conversion operators
- SimpleOutputBuffer(std::vector<dip::uint8>& buffer)
- Constructor.
Functions
- void assure_capacity(dip::uint capacity) override
- Increases the buffer’s
dip::SimpleOutputBuffer::capacityto be at leastcapacity. This call invalidates the pointer previously returned bydip::SimpleOutputBuffer::data. - auto capacity() -> dip::uint override
- Returns the capacity of the buffer.
- auto data() -> dip::uint8* override
- Returns a pointer to the data.
- void set_size(dip::uint size) override
- Sets the size of the data stored in the buffer.
- auto size() -> dip::uint override
- Returns the size of the data stored in the buffer.
Function documentation
SimpleOutputBuffer( std::vector<dip::uint8>& buffer)
Constructor.
void assure_capacity( dip::uint capacity) override
Increases the buffer’s dip::SimpleOutputBuffer::capacity to be at least capacity.
This call invalidates the pointer previously returned by dip::SimpleOutputBuffer::data.
dip::uint8* data( ) override
Returns a pointer to the data.