mirror of
https://github.com/boostorg/gil.git
synced 2026-02-22 03:22:15 +00:00
Replace writer<Device,jpeg_tag> where writer_backend<Device,jpeg_tag> expected (#177)
The reference to `writer<Device,jpeg_tag>` is clearly incorrect: - writer has no members `init_device`, `empty_buffer`, `closed_buffer` - if use of writer was correct there, it would require `#include <boost/gil/extension/io/jpeg/detail/writer.hpp>`, but that would impose cyclic-dependency between writer.hpp and writer_backend.hpp.
This commit is contained in:
@@ -95,16 +95,16 @@ public:
|
||||
get()->client_data = this;
|
||||
|
||||
// Error exit handler: does not return to caller.
|
||||
_jerr.error_exit = &writer< Device, jpeg_tag >::error_exit;
|
||||
_jerr.error_exit = &writer_backend< Device, jpeg_tag >::error_exit;
|
||||
|
||||
// Fire exception in case of error.
|
||||
if( setjmp( _mark )) { raise_error(); }
|
||||
|
||||
_dest._jdest.free_in_buffer = sizeof( buffer );
|
||||
_dest._jdest.next_output_byte = buffer;
|
||||
_dest._jdest.init_destination = reinterpret_cast< void(*) ( j_compress_ptr ) >( &writer< Device, jpeg_tag >::init_device );
|
||||
_dest._jdest.empty_output_buffer = reinterpret_cast< boolean(*)( j_compress_ptr ) >( &writer< Device, jpeg_tag >::empty_buffer );
|
||||
_dest._jdest.term_destination = reinterpret_cast< void(*) ( j_compress_ptr ) >( &writer< Device, jpeg_tag >::close_device );
|
||||
_dest._jdest.init_destination = reinterpret_cast< void(*) ( j_compress_ptr ) >( &writer_backend< Device, jpeg_tag >::init_device );
|
||||
_dest._jdest.empty_output_buffer = reinterpret_cast< boolean(*)( j_compress_ptr ) >( &writer_backend< Device, jpeg_tag >::empty_buffer );
|
||||
_dest._jdest.term_destination = reinterpret_cast< void(*) ( j_compress_ptr ) >( &writer_backend< Device, jpeg_tag >::close_device );
|
||||
_dest._this = this;
|
||||
|
||||
jpeg_create_compress( get() );
|
||||
@@ -143,7 +143,7 @@ protected:
|
||||
, buffer_size
|
||||
);
|
||||
|
||||
writer<Device,jpeg_tag>::init_device( cinfo );
|
||||
writer_backend<Device,jpeg_tag>::init_device( cinfo );
|
||||
return static_cast<boolean>(TRUE);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ protected:
|
||||
|
||||
static void error_exit( j_common_ptr cinfo )
|
||||
{
|
||||
writer< Device, jpeg_tag >* mgr = reinterpret_cast< writer< Device, jpeg_tag >* >( cinfo->client_data );
|
||||
writer_backend< Device, jpeg_tag >* mgr = reinterpret_cast< writer_backend< Device, jpeg_tag >* >( cinfo->client_data );
|
||||
|
||||
longjmp( mgr->_mark, 1 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user