CLAW Library (a C++ Library Absolutely Wonderful) 1.5.5
|
Destination manager that allow us to write in a std::ostream. More...
#include <jpeg.hpp>
Public Member Functions | |
destination_manager (std::ostream &os) | |
Constructor. | |
~destination_manager () | |
Destructor. | |
void | flush () |
Write the content of the buffer in the file. | |
void | term () |
Write the last pending bytes in the file. | |
Public Attributes | |
struct jpeg_destination_mgr | pub |
"public" fields, needed by the jpeg library. | |
Private Attributes | |
std::ostream & | m_output |
The stream in which we write the data. | |
JOCTET * | m_buffer |
Pointer on the begining of the buffer. | |
const unsigned int | m_buffer_size |
Number of bytes in the buffer. |
Destination manager that allow us to write in a std::ostream.
claw::graphic::jpeg::writer::destination_manager::destination_manager | ( | std::ostream & | os | ) |
Constructor.
os | The stream we write in. |
Definition at line 91 of file jpeg_writer.cpp.
: m_output(os), m_buffer_size(1024) { m_buffer = new JOCTET[m_buffer_size]; pub.next_output_byte = m_buffer; pub.free_in_buffer = m_buffer_size; } // jpeg::writer::destination_manager::destination_manager()
claw::graphic::jpeg::writer::destination_manager::~destination_manager | ( | ) |
Destructor.
Definition at line 103 of file jpeg_writer.cpp.
References m_buffer.
{ delete[] m_buffer; } // jpeg::writer::destination_manager::~destination_manager()
void claw::graphic::jpeg::writer::destination_manager::flush | ( | ) |
Write the content of the buffer in the file.
Definition at line 112 of file jpeg_writer.cpp.
{ m_output.write((char*)m_buffer, m_buffer_size); pub.next_output_byte = m_buffer; pub.free_in_buffer = m_buffer_size; } // jpeg::writer::destination_manager::fill_output_buffer()
void claw::graphic::jpeg::writer::destination_manager::term | ( | ) |
Write the last pending bytes in the file.
Definition at line 125 of file jpeg_writer.cpp.
{ m_output.write((char*)m_buffer, m_buffer_size - pub.free_in_buffer); } // jpeg::writer::destination_manager::term()
JOCTET* claw::graphic::jpeg::writer::destination_manager::m_buffer [private] |
Pointer on the begining of the buffer.
Definition at line 213 of file jpeg.hpp.
Referenced by ~destination_manager().
const unsigned int claw::graphic::jpeg::writer::destination_manager::m_buffer_size [private] |
std::ostream& claw::graphic::jpeg::writer::destination_manager::m_output [private] |
struct jpeg_destination_mgr claw::graphic::jpeg::writer::destination_manager::pub |
"public" fields, needed by the jpeg library.
Definition at line 206 of file jpeg.hpp.
Referenced by claw::graphic::jpeg::writer::create_compress_info().