123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- #ifndef BOOST_GIL_IO_READER_BASE_HPP
- #define BOOST_GIL_IO_READER_BASE_HPP
- #include <boost/gil/io/base.hpp>
- #include <boost/assert.hpp>
- namespace boost { namespace gil {
- template< typename FormatTag
- , typename ConversionPolicy
- >
- struct reader_base
- {
- public:
-
-
-
- reader_base()
- :_cc_policy()
- {}
-
-
-
- reader_base( const ConversionPolicy& cc )
- :_cc_policy( cc )
- {}
-
-
-
-
-
-
- template< typename Image >
- void init_image( Image& img
- , const image_read_settings< FormatTag >& settings
- )
- {
-
- BOOST_ASSERT(settings._dim.x && settings._dim.y);
- img.recreate( settings._dim.x
- , settings._dim.y
- );
- }
- template< typename View >
- void init_view( const View& view
- , const image_read_settings< FormatTag >&
- )
- {
- setup( view.dimensions() );
- }
- private:
- void setup( const point_t& )
- {
-
-
-
-
-
-
-
-
-
-
- }
- void check_coordinates( const point_t& )
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- protected:
- ConversionPolicy _cc_policy;
- };
- }
- }
- #endif
|