Example #1
0
		input_impl ( tu_file *in )
			:
			m_compressor_opened ( false )
			// Constructor.  Read the header data from in, and
			// prepare to read data.
		{
			setup_jpeg_err ( &m_jerr );
			m_cinfo.err = &m_jerr;
			// Initialize decompression object.
			jpeg_create_decompress ( &m_cinfo );
			setup_rw_source ( &m_cinfo, in );
			start_image();
		}
Example #2
0
JpegImageInput::JpegImageInput(boost::shared_ptr<IOChannel> in)
    :
    ImageInput(in),
    _errorOccurred(0),
    _compressorOpened(false)
{
    setup_jpeg_err(&m_jerr);
    m_cinfo.err = &m_jerr;
    m_cinfo.client_data = this;

    // Initialize decompression object.
    jpeg_create_decompress(&m_cinfo);

    rw_source_IOChannel::setup(&m_cinfo, in);
}
Example #3
0
		input_impl ( SWF_DEFINE_BITS_JPEG2_HEADER_ONLY e, tu_file *in )
			:
			m_compressor_opened ( false )
			// The SWF file format stores JPEG images with the
			// encoding tables separate from the image data.  This
			// constructor reads the encoding table only and keeps
			// them in this object.  You need to call
			// start_image() and finish_image() around any calls
			// to get_width/height/components and read_scanline.
		{
			setup_jpeg_err ( &m_jerr );
			m_cinfo.err = &m_jerr;
			// Initialize decompression object.
			jpeg_create_decompress ( &m_cinfo );
			setup_rw_source ( &m_cinfo, in );
			// Read the encoding tables.
			jpeg_read_header ( &m_cinfo, FALSE );
			// Don't start reading any image data!
			// App does that manually using start_image.
		}