claw::graphic::jpeg::writer::destination_manager Struct Reference

Destination manager that allow us to write in a std::ostream. More...

#include <jpeg.hpp>

List of all members.

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.

Detailed Description

Destination manager that allow us to write in a std::ostream.

Author:
Julien Jorge

Definition at line 195 of file jpeg.hpp.


Constructor & Destructor Documentation

claw::graphic::jpeg::writer::destination_manager::destination_manager ( std::ostream &  os  ) 

Constructor.

Parameters:
os The stream we write in.

Definition at line 91 of file jpeg_writer.cpp.

00092   : m_output(os), m_buffer_size(1024)
00093 {
00094   m_buffer = new JOCTET[m_buffer_size];
00095   pub.next_output_byte = m_buffer;
00096   pub.free_in_buffer = m_buffer_size;
00097 } // 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.

00104 {
00105   delete[] m_buffer;
00106 } // jpeg::writer::destination_manager::~destination_manager()


Member Function Documentation

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.

References m_buffer, m_buffer_size, m_output, and pub.

00113 {
00114   m_output.write((char*)m_buffer, m_buffer_size);
00115 
00116   pub.next_output_byte = m_buffer;
00117   pub.free_in_buffer = m_buffer_size;
00118 } // 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.

References m_buffer, m_buffer_size, m_output, and pub.

00126 {
00127   m_output.write((char*)m_buffer, m_buffer_size - pub.free_in_buffer);
00128 } // jpeg::writer::destination_manager::term()


Member Data Documentation

Pointer on the begining of the buffer.

Definition at line 213 of file jpeg.hpp.

Referenced by flush(), term(), and ~destination_manager().

Number of bytes in the buffer.

Definition at line 216 of file jpeg.hpp.

Referenced by flush(), and term().

The stream in which we write the data.

Definition at line 210 of file jpeg.hpp.

Referenced by flush(), and term().

struct jpeg_destination_mgr claw::graphic::jpeg::writer::destination_manager::pub [read]

"public" fields, needed by the jpeg library.

Definition at line 206 of file jpeg.hpp.

Referenced by claw::graphic::jpeg::writer::create_compress_info(), flush(), and term().


The documentation for this struct was generated from the following files:

Generated on 9 Nov 2009 for CLAW Library (a C++ Library Absolutely Wonderful) by  doxygen 1.6.1