Boost logo

Boost :

From: John Femiani (JOHN.FEMIANI_at_[hidden])
Date: 2008-04-24 19:13:45


> You're right. I will scope it inside a compiler symbol (
> ENABLE_GRAY_ALPHA ) for now. I probably need to talk to
> Lubomir asking him if he wants to add gray_alpha. It's a
> pretty straight forward change to the current lib. This
> reminds me that there are some other additions that should be added.
>

I really think that all of the other formats are important. Hopefully
Lubomir does make them an official part of gil, or an official extension
that can be part of the boost svn.

> Can you try to compile again?

I fixed some parts, but it still fails.

g++ is really picky about dependant names. When a base class is
dependant on a template parameter, I think you need to use 'this->' in
order to let the compiler know that the symbol comes from a base class
instead of the global scope. I attached a patch, which was created
inside the io_new folder.

Also, there are references to deail::read_and_no_convert used in
read_image.hpp. I can not find a declaration for read_and_no_convert,
did you forget to add a file to svn?

> Are you planning on using the lib?

I will probably use the library, but I am not ready to switch yet
(timing issues).
Is it possible to have read_image deduce the file format from the file /
filename itself? That feature would make a gil io lib. perfect for me.

-- John

Index: detail/jpeg_io_read.hpp
===================================================================
--- detail/jpeg_io_read.hpp (revision 317)
+++ detail/jpeg_io_read.hpp (working copy)
@@ -194,28 +194,29 @@
     template<typename View>
     void apply_impl( const View& view )
     {
- start_decompress();
+
+ this->start_decompress();
 
- switch( _info._color_space )
+ switch(this->_info._color_space )
         {
         case JCS_GRAYSCALE:
- io_error_if(_info._num_components!=1,"reader<jpeg>: error
in image data");
+ io_error_if(this->_info._num_components!=1,"reader<jpeg>:
error in image data");
             read_rows<gray8_pixel_t>( view );
             break;
         case JCS_RGB:
- io_error_if(_info._num_components!=3,"reader<jpeg>: error
in image data");
+ io_error_if(this->_info._num_components!=3,"reader<jpeg>:
error in image data");
             read_rows<rgb8_pixel_t>( view );
         case JCS_YCbCr:
- io_error_if(_info._num_components!=3,"reader<jpeg>: error
in image data");
+ io_error_if(this->_info._num_components!=3,"reader<jpeg>:
error in image data");
             //!\todo add Y'CbCr? We loose image quality when reading
JCS_YCbCr as JCS_RGB
             read_rows<rgb8_pixel_t>( view );
             break;
         case JCS_CMYK:
- io_error_if(_info._num_components!=4,"reader<jpeg>: error
in image data");
+ io_error_if(this->_info._num_components!=4,"reader<jpeg>:
error in image data");
             read_rows<cmyk8_pixel_t>( view );
             break;
         case JCS_YCCK:
- io_error_if(_info._num_components!=4,"reader<jpeg>: error
in image data");
+ io_error_if(this->_info._num_components!=4,"reader<jpeg>:
error in image data");
             //!\todo add Y'CbCrK? We loose image quality when reading
JCS_YCCK as JCS_CMYK
             this->_cinfo.out_color_space = JCS_CMYK;
             read_rows<cmyk8_pixel_t>( view );
@@ -225,7 +226,7 @@
             // unknown
         }
 
- finish_decompress();
+ this->finish_decompress();
     }
 
     template< typename ImagePixel
@@ -240,14 +241,14 @@
                 );
 
       
- std::vector<ImagePixel> buffer( _info._width );
+ std::vector<ImagePixel> buffer( this->_info._width );
 
       JSAMPLE *row_adr = reinterpret_cast< JSAMPLE* >( &buffer[0] );
 
       //Skip scanlines if necessary.
- for( int y = 0; y < _top_left.y; ++y )
+ for( int y = 0; y < this->_top_left.y; ++y )
       {
- io_error_if( jpeg_read_scanlines( &_cinfo
+ io_error_if( jpeg_read_scanlines( &this->_cinfo
                                          , &row_adr
                                          , 1
                                          ) !=1
@@ -257,22 +258,22 @@
       // Read data.
       for( int y = 0; y < view.height(); ++y )
       {
- io_error_if( jpeg_read_scanlines( &_cinfo
+ io_error_if( jpeg_read_scanlines( &this->_cinfo
                                          , &row_adr
                                          , 1
                                          ) !=1
                     , "jpeg_read_scanlines: fail to read JPEG file" );
 
- _cc_policy.read( buffer.begin() + _top_left.x
- , buffer.begin() + _dim.x
- , view.row_begin( y )
- );
+ this->_cc_policy.read( buffer.begin() + this->_top_left.x
+ , buffer.begin() + this->_dim.x
+ , view.row_begin( y )
+ );
       }
 
       //@todo: Finish up. There might be a better way to do that.
- while( _cinfo.output_scanline < _cinfo.image_height )
+ while( this->_cinfo.output_scanline < this->_cinfo.image_height
)
       {
- io_error_if( jpeg_read_scanlines( &_cinfo
+ io_error_if( jpeg_read_scanlines( &this->_cinfo
                                          , &row_adr
                                          , 1
                                          ) !=1
Index: detail/path_spec.hpp
===================================================================
--- detail/path_spec.hpp (revision 317)
+++ detail/path_spec.hpp (working copy)
@@ -75,4 +75,4 @@
 
 }}}
 
-#endif BOOST_GIL_EXTENSION_IO_DETAIL_PATH_SPEC_HPP_INCLUDED
+#endif //BOOST_GIL_EXTENSION_IO_DETAIL_PATH_SPEC_HPP_INCLUDED




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk