From: Foster B. <fos...@us...> - 2006-02-03 18:34:24
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/gil/extension/conceptspace In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/gil/extension/conceptspace Modified Files: any_standard_image.hpp Log Message: asl 1.0.13 Index: any_standard_image.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/gil/extension/conceptspace/any_standard_image.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** any_standard_image.hpp 6 Jan 2006 18:02:59 -0000 1.1 --- any_standard_image.hpp 3 Feb 2006 18:33:37 -0000 1.2 *************** *** 1,6 **** /* ! Copyright 2005-2006 Adobe Systems Incorporated ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ --- 1,6 ---- /* ! Copyright 2005-2006 Adobe Systems Incorporated ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ *************** *** 11,18 **** //////////////////////////////////////////////////////////////////////////////////////// ! /// \file /// \brief Non-templated image /// \author Lubomir Bourdev and Hailin Jin \n ! /// Adobe Systems Incorporated /// /// --- 11,18 ---- //////////////////////////////////////////////////////////////////////////////////////// ! /// \file /// \brief Non-templated image /// \author Lubomir Bourdev and Hailin Jin \n ! /// Adobe Systems Incorporated /// /// *************** *** 29,33 **** /// \ingroup DynamicImage ! template <typename T> inline unsigned channel_typeid(); // unknown channel type template<> inline unsigned channel_typeid<bits8> () { return 0; } template<> inline unsigned channel_typeid<bits16>() { return 1; } --- 29,33 ---- /// \ingroup DynamicImage ! template <typename T> inline unsigned channel_typeid(); // unknown channel type template<> inline unsigned channel_typeid<bits8> () { return 0; } template<> inline unsigned channel_typeid<bits16>() { return 1; } *************** *** 40,51 **** /// \ingroup DynamicImage ! template <typename T> struct x_iterator_typeid { static const unsigned value=0; }; ! template <typename T> struct x_iterator_typeid<pixel<T,rgb_tag>*> { static const unsigned value=1; }; ! template <typename T> struct x_iterator_typeid<pixel<T,bgr_tag>*> { static const unsigned value=2; }; ! template <typename T> struct x_iterator_typeid<planar_ptr<T,rgb_tag> > { static const unsigned value=3; }; ! template <typename T> struct x_iterator_typeid<pixel<T,rgba_tag>*> { static const unsigned value=4; }; ! template <typename T> struct x_iterator_typeid<planar_ptr<T,rgba_tag> > { static const unsigned value=5; }; ! template <typename T> struct x_iterator_typeid<pixel<T,cmyk_tag>*> { static const unsigned value=6; }; ! template <typename T> struct x_iterator_typeid<planar_ptr<T,cmyk_tag> > { static const unsigned value=7; }; static const int num_pixel_types=8; template <typename I> struct x_iterator_typeid<pixel_step_iterator<I> > { static const unsigned value=num_pixel_types+x_iterator_typeid<I>::value; }; --- 40,51 ---- /// \ingroup DynamicImage ! template <typename T> struct x_iterator_typeid { static const unsigned value=0; }; ! template <typename T> struct x_iterator_typeid<pixel<T,rgb_tag>*> { static const unsigned value=1; }; ! template <typename T> struct x_iterator_typeid<pixel<T,bgr_tag>*> { static const unsigned value=2; }; ! template <typename T> struct x_iterator_typeid<planar_ptr<T,rgb_tag> > { static const unsigned value=3; }; ! template <typename T> struct x_iterator_typeid<pixel<T,rgba_tag>*> { static const unsigned value=4; }; ! template <typename T> struct x_iterator_typeid<planar_ptr<T,rgba_tag> > { static const unsigned value=5; }; ! template <typename T> struct x_iterator_typeid<pixel<T,cmyk_tag>*> { static const unsigned value=6; }; ! template <typename T> struct x_iterator_typeid<planar_ptr<T,cmyk_tag> > { static const unsigned value=7; }; static const int num_pixel_types=8; template <typename I> struct x_iterator_typeid<pixel_step_iterator<I> > { static const unsigned value=num_pixel_types+x_iterator_typeid<I>::value; }; *************** *** 56,76 **** // - must have a copy constructor, assignment and equality ! template <typename DERIVED, size_t MAX_BASE_SIZE> struct AnyImageConceptSpaceBase : public StackBasedConceptSpacePolicy<DERIVED, unsigned, MAX_BASE_SIZE> { typedef StackBasedConceptSpacePolicy<DERIVED, unsigned, MAX_BASE_SIZE> parent_type; typedef typename parent_type::type_id type_id; ! static type_id get_invalid_id() { return (unsigned)-1; } protected: ! /// \brief maps the template parameters of an image view to the non-negative integers ! template <typename V> static type_id get_view_type_id() { ! return x_iterator_typeid<typename V::x_iterator>::value * num_channel_types + channel_typeid<typename boost::remove_const<typename V::channel_type>::type>(); ! } }; // we need the size of the largest image and view so we know how much space to allocate for their bases ! #define LARGEST_IMAGE GIL::cmyk32_planar_image ! #define LARGEST_VIEW GIL::cmyk32_planar_step_view // Concept space of standard view that disallow modifying their pixels --- 56,76 ---- // - must have a copy constructor, assignment and equality ! template <typename DERIVED, std::size_t MAX_BASE_SIZE> struct AnyImageConceptSpaceBase : public StackBasedConceptSpacePolicy<DERIVED, unsigned, MAX_BASE_SIZE> { typedef StackBasedConceptSpacePolicy<DERIVED, unsigned, MAX_BASE_SIZE> parent_type; typedef typename parent_type::type_id type_id; ! static type_id get_invalid_id() { return (unsigned)-1; } protected: ! /// \brief maps the template parameters of an image view to the non-negative integers ! template <typename V> static type_id get_view_type_id() { ! return x_iterator_typeid<typename V::x_iterator>::value * num_channel_types + channel_typeid<typename boost::remove_const<typename V::channel_type>::type>(); ! } }; // we need the size of the largest image and view so we know how much space to allocate for their bases ! #define LARGEST_IMAGE GIL::cmyk32_planar_image ! #define LARGEST_VIEW GIL::cmyk32_planar_step_view // Concept space of standard view that disallow modifying their pixels *************** *** 80,198 **** typedef parent_type::type_id type_id; typedef parent_type::base_type base_type; ! typedef AnyConstImageViewConceptSpace const_type; ! template <typename IMG> static type_id get_type_id() { return get_view_type_id<IMG>(); } ! template <typename OP> ! static typename OP::result_type apply(const base_type& img, type_id id, OP& op) { ! switch (id) { ! case 0: return op(reinterpret_cast<const gray8c_view& >(img)); break; ! case 1: return op(reinterpret_cast<const gray16c_view& >(img)); break; ! case 2: return op(reinterpret_cast<const gray32c_view& >(img)); break; ! case 3: return op(reinterpret_cast<const rgb8c_view& >(img)); break; ! case 4: return op(reinterpret_cast<const rgb16c_view& >(img)); break; ! case 5: return op(reinterpret_cast<const rgb32c_view& >(img)); break; ! case 6: return op(reinterpret_cast<const bgr8c_view& >(img)); break; ! case 7: return op(reinterpret_cast<const bgr16c_view& >(img)); break; ! case 8: return op(reinterpret_cast<const bgr32c_view& >(img)); break; ! case 9: return op(reinterpret_cast<const rgb8c_planar_view& >(img)); break; ! case 10: return op(reinterpret_cast<const rgb16c_planar_view& >(img)); break; ! case 11: return op(reinterpret_cast<const rgb32c_planar_view& >(img)); break; ! case 12: return op(reinterpret_cast<const rgba8c_view& >(img)); break; ! case 13: return op(reinterpret_cast<const rgba16c_view& >(img)); break; ! case 14: return op(reinterpret_cast<const rgba32c_view& >(img)); break; ! case 15: return op(reinterpret_cast<const rgba8c_planar_view& >(img)); break; ! case 16: return op(reinterpret_cast<const rgba16c_planar_view& >(img)); break; ! case 17: return op(reinterpret_cast<const rgba32c_planar_view& >(img)); break; ! case 18: return op(reinterpret_cast<const cmyk8c_view& >(img)); break; ! case 19: return op(reinterpret_cast<const cmyk16c_view& >(img)); break; ! case 20: return op(reinterpret_cast<const cmyk32c_view& >(img)); break; ! case 21: return op(reinterpret_cast<const cmyk8c_planar_view& >(img)); break; ! case 22: return op(reinterpret_cast<const cmyk16c_planar_view& >(img)); break; ! case 23: return op(reinterpret_cast<const cmyk32c_planar_view& >(img)); break; ! case 24: return op(reinterpret_cast<const gray8c_step_view& >(img)); break; ! case 25: return op(reinterpret_cast<const gray16c_step_view& >(img)); break; ! case 26: return op(reinterpret_cast<const gray32c_step_view& >(img)); break; ! case 27: return op(reinterpret_cast<const rgb8c_step_view& >(img)); break; ! case 28: return op(reinterpret_cast<const rgb16c_step_view& >(img)); break; ! case 29: return op(reinterpret_cast<const rgb32c_step_view& >(img)); break; ! case 30: return op(reinterpret_cast<const bgr8c_step_view& >(img)); break; ! case 31: return op(reinterpret_cast<const bgr16c_step_view& >(img)); break; ! case 32: return op(reinterpret_cast<const bgr32c_step_view& >(img)); break; ! case 33: return op(reinterpret_cast<const rgb8c_planar_step_view& >(img)); break; ! case 34: return op(reinterpret_cast<const rgb16c_planar_step_view& >(img)); break; ! case 35: return op(reinterpret_cast<const rgb32c_planar_step_view& >(img)); break; ! case 36: return op(reinterpret_cast<const rgba8c_step_view& >(img)); break; ! case 37: return op(reinterpret_cast<const rgba16c_step_view& >(img)); break; ! case 38: return op(reinterpret_cast<const rgba32c_step_view& >(img)); break; ! case 39: return op(reinterpret_cast<const rgba8c_planar_step_view& >(img)); break; ! case 40: return op(reinterpret_cast<const rgba16c_planar_step_view& >(img)); break; ! case 41: return op(reinterpret_cast<const rgba32c_planar_step_view& >(img)); break; ! case 42: return op(reinterpret_cast<const cmyk8c_step_view& >(img)); break; ! case 43: return op(reinterpret_cast<const cmyk16c_step_view& >(img)); break; ! case 44: return op(reinterpret_cast<const cmyk32c_step_view& >(img)); break; ! case 45: return op(reinterpret_cast<const cmyk8c_planar_step_view& >(img)); break; ! case 46: return op(reinterpret_cast<const cmyk16c_planar_step_view& >(img)); break; ! case 47: return op(reinterpret_cast<const cmyk32c_planar_step_view& >(img)); break; ! default: ! throw std::bad_cast(); ! } ! } //#ifdef PROVIDE_CONST_VERSIONS ! template <typename OP> ! static typename OP::result_type apply(const base_type& img, type_id id, const OP& op) { ! switch (id) { ! case 0: return op(reinterpret_cast<const gray8c_view& >(img)); break; ! case 1: return op(reinterpret_cast<const gray16c_view& >(img)); break; ! case 2: return op(reinterpret_cast<const gray32c_view& >(img)); break; ! case 3: return op(reinterpret_cast<const rgb8c_view& >(img)); break; ! case 4: return op(reinterpret_cast<const rgb16c_view& >(img)); break; ! case 5: return op(reinterpret_cast<const rgb32c_view& >(img)); break; ! case 6: return op(reinterpret_cast<const bgr8c_view& >(img)); break; ! case 7: return op(reinterpret_cast<const bgr16c_view& >(img)); break; ! case 8: return op(reinterpret_cast<const bgr32c_view& >(img)); break; ! case 9: return op(reinterpret_cast<const rgb8c_planar_view& >(img)); break; ! case 10: return op(reinterpret_cast<const rgb16c_planar_view& >(img)); break; ! case 11: return op(reinterpret_cast<const rgb32c_planar_view& >(img)); break; ! case 12: return op(reinterpret_cast<const rgba8c_view& >(img)); break; ! case 13: return op(reinterpret_cast<const rgba16c_view& >(img)); break; ! case 14: return op(reinterpret_cast<const rgba32c_view& >(img)); break; ! case 15: return op(reinterpret_cast<const rgba8c_planar_view& >(img)); break; ! case 16: return op(reinterpret_cast<const rgba16c_planar_view& >(img)); break; ! case 17: return op(reinterpret_cast<const rgba32c_planar_view& >(img)); break; ! case 18: return op(reinterpret_cast<const cmyk8c_view& >(img)); break; ! case 19: return op(reinterpret_cast<const cmyk16c_view& >(img)); break; ! case 20: return op(reinterpret_cast<const cmyk32c_view& >(img)); break; ! case 21: return op(reinterpret_cast<const cmyk8c_planar_view& >(img)); break; ! case 22: return op(reinterpret_cast<const cmyk16c_planar_view& >(img)); break; ! case 23: return op(reinterpret_cast<const cmyk32c_planar_view& >(img)); break; ! case 24: return op(reinterpret_cast<const gray8c_step_view& >(img)); break; ! case 25: return op(reinterpret_cast<const gray16c_step_view& >(img)); break; ! case 26: return op(reinterpret_cast<const gray32c_step_view& >(img)); break; ! case 27: return op(reinterpret_cast<const rgb8c_step_view& >(img)); break; ! case 28: return op(reinterpret_cast<const rgb16c_step_view& >(img)); break; ! case 29: return op(reinterpret_cast<const rgb32c_step_view& >(img)); break; ! case 30: return op(reinterpret_cast<const bgr8c_step_view& >(img)); break; ! case 31: return op(reinterpret_cast<const bgr16c_step_view& >(img)); break; ! case 32: return op(reinterpret_cast<const bgr32c_step_view& >(img)); break; ! case 33: return op(reinterpret_cast<const rgb8c_planar_step_view& >(img)); break; ! case 34: return op(reinterpret_cast<const rgb16c_planar_step_view& >(img)); break; ! case 35: return op(reinterpret_cast<const rgb32c_planar_step_view& >(img)); break; ! case 36: return op(reinterpret_cast<const rgba8c_step_view& >(img)); break; ! case 37: return op(reinterpret_cast<const rgba16c_step_view& >(img)); break; ! case 38: return op(reinterpret_cast<const rgba32c_step_view& >(img)); break; ! case 39: return op(reinterpret_cast<const rgba8c_planar_step_view& >(img)); break; ! case 40: return op(reinterpret_cast<const rgba16c_planar_step_view& >(img)); break; ! case 41: return op(reinterpret_cast<const rgba32c_planar_step_view& >(img)); break; ! case 42: return op(reinterpret_cast<const cmyk8c_step_view& >(img)); break; ! case 43: return op(reinterpret_cast<const cmyk16c_step_view& >(img)); break; ! case 44: return op(reinterpret_cast<const cmyk32c_step_view& >(img)); break; ! case 45: return op(reinterpret_cast<const cmyk8c_planar_step_view& >(img)); break; ! case 46: return op(reinterpret_cast<const cmyk16c_planar_step_view& >(img)); break; ! case 47: return op(reinterpret_cast<const cmyk32c_planar_step_view& >(img)); break; ! default: ! throw std::bad_cast(); ! } ! } //#endif }; --- 80,198 ---- typedef parent_type::type_id type_id; typedef parent_type::base_type base_type; ! typedef AnyConstImageViewConceptSpace const_type; ! template <typename IMG> static type_id get_type_id() { return get_view_type_id<IMG>(); } ! template <typename OP> ! static typename OP::result_type apply(const base_type& img, type_id id, OP& op) { ! switch (id) { ! case 0: return op(reinterpret_cast<const gray8c_view& >(img)); break; ! case 1: return op(reinterpret_cast<const gray16c_view& >(img)); break; ! case 2: return op(reinterpret_cast<const gray32c_view& >(img)); break; ! case 3: return op(reinterpret_cast<const rgb8c_view& >(img)); break; ! case 4: return op(reinterpret_cast<const rgb16c_view& >(img)); break; ! case 5: return op(reinterpret_cast<const rgb32c_view& >(img)); break; ! case 6: return op(reinterpret_cast<const bgr8c_view& >(img)); break; ! case 7: return op(reinterpret_cast<const bgr16c_view& >(img)); break; ! case 8: return op(reinterpret_cast<const bgr32c_view& >(img)); break; ! case 9: return op(reinterpret_cast<const rgb8c_planar_view& >(img)); break; ! case 10: return op(reinterpret_cast<const rgb16c_planar_view& >(img)); break; ! case 11: return op(reinterpret_cast<const rgb32c_planar_view& >(img)); break; ! case 12: return op(reinterpret_cast<const rgba8c_view& >(img)); break; ! case 13: return op(reinterpret_cast<const rgba16c_view& >(img)); break; ! case 14: return op(reinterpret_cast<const rgba32c_view& >(img)); break; ! case 15: return op(reinterpret_cast<const rgba8c_planar_view& >(img)); break; ! case 16: return op(reinterpret_cast<const rgba16c_planar_view& >(img)); break; ! case 17: return op(reinterpret_cast<const rgba32c_planar_view& >(img)); break; ! case 18: return op(reinterpret_cast<const cmyk8c_view& >(img)); break; ! case 19: return op(reinterpret_cast<const cmyk16c_view& >(img)); break; ! case 20: return op(reinterpret_cast<const cmyk32c_view& >(img)); break; ! case 21: return op(reinterpret_cast<const cmyk8c_planar_view& >(img)); break; ! case 22: return op(reinterpret_cast<const cmyk16c_planar_view& >(img)); break; ! case 23: return op(reinterpret_cast<const cmyk32c_planar_view& >(img)); break; ! case 24: return op(reinterpret_cast<const gray8c_step_view& >(img)); break; ! case 25: return op(reinterpret_cast<const gray16c_step_view& >(img)); break; ! case 26: return op(reinterpret_cast<const gray32c_step_view& >(img)); break; ! case 27: return op(reinterpret_cast<const rgb8c_step_view& >(img)); break; ! case 28: return op(reinterpret_cast<const rgb16c_step_view& >(img)); break; ! case 29: return op(reinterpret_cast<const rgb32c_step_view& >(img)); break; ! case 30: return op(reinterpret_cast<const bgr8c_step_view& >(img)); break; ! case 31: return op(reinterpret_cast<const bgr16c_step_view& >(img)); break; ! case 32: return op(reinterpret_cast<const bgr32c_step_view& >(img)); break; ! case 33: return op(reinterpret_cast<const rgb8c_planar_step_view& >(img)); break; ! case 34: return op(reinterpret_cast<const rgb16c_planar_step_view& >(img)); break; ! case 35: return op(reinterpret_cast<const rgb32c_planar_step_view& >(img)); break; ! case 36: return op(reinterpret_cast<const rgba8c_step_view& >(img)); break; ! case 37: return op(reinterpret_cast<const rgba16c_step_view& >(img)); break; ! case 38: return op(reinterpret_cast<const rgba32c_step_view& >(img)); break; ! case 39: return op(reinterpret_cast<const rgba8c_planar_step_view& >(img)); break; ! case 40: return op(reinterpret_cast<const rgba16c_planar_step_view& >(img)); break; ! case 41: return op(reinterpret_cast<const rgba32c_planar_step_view& >(img)); break; ! case 42: return op(reinterpret_cast<const cmyk8c_step_view& >(img)); break; ! case 43: return op(reinterpret_cast<const cmyk16c_step_view& >(img)); break; ! case 44: return op(reinterpret_cast<const cmyk32c_step_view& >(img)); break; ! case 45: return op(reinterpret_cast<const cmyk8c_planar_step_view& >(img)); break; ! case 46: return op(reinterpret_cast<const cmyk16c_planar_step_view& >(img)); break; ! case 47: return op(reinterpret_cast<const cmyk32c_planar_step_view& >(img)); break; ! default: ! throw std::bad_cast(); ! } ! } //#ifdef PROVIDE_CONST_VERSIONS ! template <typename OP> ! static typename OP::result_type apply(const base_type& img, type_id id, const OP& op) { ! switch (id) { ! case 0: return op(reinterpret_cast<const gray8c_view& >(img)); break; ! case 1: return op(reinterpret_cast<const gray16c_view& >(img)); break; ! case 2: return op(reinterpret_cast<const gray32c_view& >(img)); break; ! case 3: return op(reinterpret_cast<const rgb8c_view& >(img)); break; ! case 4: return op(reinterpret_cast<const rgb16c_view& >(img)); break; ! case 5: return op(reinterpret_cast<const rgb32c_view& >(img)); break; ! case 6: return op(reinterpret_cast<const bgr8c_view& >(img)); break; ! case 7: return op(reinterpret_cast<const bgr16c_view& >(img)); break; ! case 8: return op(reinterpret_cast<const bgr32c_view& >(img)); break; ! case 9: return op(reinterpret_cast<const rgb8c_planar_view& >(img)); break; ! case 10: return op(reinterpret_cast<const rgb16c_planar_view& >(img)); break; ! case 11: return op(reinterpret_cast<const rgb32c_planar_view& >(img)); break; ! case 12: return op(reinterpret_cast<const rgba8c_view& >(img)); break; ! case 13: return op(reinterpret_cast<const rgba16c_view& >(img)); break; ! case 14: return op(reinterpret_cast<const rgba32c_view& >(img)); break; ! case 15: return op(reinterpret_cast<const rgba8c_planar_view& >(img)); break; ! case 16: return op(reinterpret_cast<const rgba16c_planar_view& >(img)); break; ! case 17: return op(reinterpret_cast<const rgba32c_planar_view& >(img)); break; ! case 18: return op(reinterpret_cast<const cmyk8c_view& >(img)); break; ! case 19: return op(reinterpret_cast<const cmyk16c_view& >(img)); break; ! case 20: return op(reinterpret_cast<const cmyk32c_view& >(img)); break; ! case 21: return op(reinterpret_cast<const cmyk8c_planar_view& >(img)); break; ! case 22: return op(reinterpret_cast<const cmyk16c_planar_view& >(img)); break; ! case 23: return op(reinterpret_cast<const cmyk32c_planar_view& >(img)); break; ! case 24: return op(reinterpret_cast<const gray8c_step_view& >(img)); break; ! case 25: return op(reinterpret_cast<const gray16c_step_view& >(img)); break; ! case 26: return op(reinterpret_cast<const gray32c_step_view& >(img)); break; ! case 27: return op(reinterpret_cast<const rgb8c_step_view& >(img)); break; ! case 28: return op(reinterpret_cast<const rgb16c_step_view& >(img)); break; ! case 29: return op(reinterpret_cast<const rgb32c_step_view& >(img)); break; ! case 30: return op(reinterpret_cast<const bgr8c_step_view& >(img)); break; ! case 31: return op(reinterpret_cast<const bgr16c_step_view& >(img)); break; ! case 32: return op(reinterpret_cast<const bgr32c_step_view& >(img)); break; ! case 33: return op(reinterpret_cast<const rgb8c_planar_step_view& >(img)); break; ! case 34: return op(reinterpret_cast<const rgb16c_planar_step_view& >(img)); break; ! case 35: return op(reinterpret_cast<const rgb32c_planar_step_view& >(img)); break; ! case 36: return op(reinterpret_cast<const rgba8c_step_view& >(img)); break; ! case 37: return op(reinterpret_cast<const rgba16c_step_view& >(img)); break; ! case 38: return op(reinterpret_cast<const rgba32c_step_view& >(img)); break; ! case 39: return op(reinterpret_cast<const rgba8c_planar_step_view& >(img)); break; ! case 40: return op(reinterpret_cast<const rgba16c_planar_step_view& >(img)); break; ! case 41: return op(reinterpret_cast<const rgba32c_planar_step_view& >(img)); break; ! case 42: return op(reinterpret_cast<const cmyk8c_step_view& >(img)); break; ! case 43: return op(reinterpret_cast<const cmyk16c_step_view& >(img)); break; ! case 44: return op(reinterpret_cast<const cmyk32c_step_view& >(img)); break; ! case 45: return op(reinterpret_cast<const cmyk8c_planar_step_view& >(img)); break; ! case 46: return op(reinterpret_cast<const cmyk16c_planar_step_view& >(img)); break; ! case 47: return op(reinterpret_cast<const cmyk32c_planar_step_view& >(img)); break; ! default: ! throw std::bad_cast(); ! } ! } //#endif }; *************** *** 204,320 **** typedef parent_type::type_id type_id; typedef parent_type::base_type base_type; ! typedef AnyConstImageViewConceptSpace const_type; template <typename IMG> static type_id get_type_id() { return get_view_type_id<IMG>(); } ! template <typename OP> ! static typename OP::result_type apply(const base_type& img, type_id id, OP& op) { ! switch (id) { ! case 0: return op(reinterpret_cast<const gray8_view& >(img)); break; ! case 1: return op(reinterpret_cast<const gray16_view& >(img)); break; ! case 2: return op(reinterpret_cast<const gray32_view& >(img)); break; ! case 3: return op(reinterpret_cast<const rgb8_view& >(img)); break; ! case 4: return op(reinterpret_cast<const rgb16_view& >(img)); break; ! case 5: return op(reinterpret_cast<const rgb32_view& >(img)); break; ! case 6: return op(reinterpret_cast<const bgr8_view& >(img)); break; ! case 7: return op(reinterpret_cast<const bgr16_view& >(img)); break; ! case 8: return op(reinterpret_cast<const bgr32_view& >(img)); break; ! case 9: return op(reinterpret_cast<const rgb8_planar_view& >(img)); break; ! case 10: return op(reinterpret_cast<const rgb16_planar_view& >(img)); break; ! case 11: return op(reinterpret_cast<const rgb32_planar_view& >(img)); break; ! case 12: return op(reinterpret_cast<const rgba8_view& >(img)); break; ! case 13: return op(reinterpret_cast<const rgba16_view& >(img)); break; ! case 14: return op(reinterpret_cast<const rgba32_view& >(img)); break; ! case 15: return op(reinterpret_cast<const rgba8_planar_view& >(img)); break; ! case 16: return op(reinterpret_cast<const rgba16_planar_view& >(img)); break; ! case 17: return op(reinterpret_cast<const rgba32_planar_view& >(img)); break; ! case 18: return op(reinterpret_cast<const cmyk8_view& >(img)); break; ! case 19: return op(reinterpret_cast<const cmyk16_view& >(img)); break; ! case 20: return op(reinterpret_cast<const cmyk32_view& >(img)); break; ! case 21: return op(reinterpret_cast<const cmyk8_planar_view& >(img)); break; ! case 22: return op(reinterpret_cast<const cmyk16_planar_view& >(img)); break; ! case 23: return op(reinterpret_cast<const cmyk32_planar_view& >(img)); break; ! case 24: return op(reinterpret_cast<const gray8_step_view& >(img)); break; ! case 25: return op(reinterpret_cast<const gray16_step_view& >(img)); break; ! case 26: return op(reinterpret_cast<const gray32_step_view& >(img)); break; ! case 27: return op(reinterpret_cast<const rgb8_step_view& >(img)); break; ! case 28: return op(reinterpret_cast<const rgb16_step_view& >(img)); break; ! case 29: return op(reinterpret_cast<const rgb32_step_view& >(img)); break; ! case 30: return op(reinterpret_cast<const bgr8_step_view& >(img)); break; ! case 31: return op(reinterpret_cast<const bgr16_step_view& >(img)); break; ! case 32: return op(reinterpret_cast<const bgr32_step_view& >(img)); break; ! case 33: return op(reinterpret_cast<const rgb8_planar_step_view& >(img)); break; ! case 34: return op(reinterpret_cast<const rgb16_planar_step_view& >(img)); break; ! case 35: return op(reinterpret_cast<const rgb32_planar_step_view& >(img)); break; ! case 36: return op(reinterpret_cast<const rgba8_step_view& >(img)); break; ! case 37: return op(reinterpret_cast<const rgba16_step_view& >(img)); break; ! case 38: return op(reinterpret_cast<const rgba32_step_view& >(img)); break; ! case 39: return op(reinterpret_cast<const rgba8_planar_step_view& >(img)); break; ! case 40: return op(reinterpret_cast<const rgba16_planar_step_view& >(img)); break; ! case 41: return op(reinterpret_cast<const rgba32_planar_step_view& >(img)); break; ! case 42: return op(reinterpret_cast<const cmyk8_step_view& >(img)); break; ! case 43: return op(reinterpret_cast<const cmyk16_step_view& >(img)); break; ! case 44: return op(reinterpret_cast<const cmyk32_step_view& >(img)); break; ! case 45: return op(reinterpret_cast<const cmyk8_planar_step_view& >(img)); break; ! case 46: return op(reinterpret_cast<const cmyk16_planar_step_view& >(img)); break; ! case 47: return op(reinterpret_cast<const cmyk32_planar_step_view& >(img)); break; ! default: throw std::bad_cast(); ! } ! } //#ifdef PROVIDE_CONST_VERSIONS ! template <typename OP> ! static typename OP::result_type apply(const base_type& img, type_id id, const OP& op) { ! switch (id) { ! case 0: return op(reinterpret_cast<const gray8_view& >(img)); break; ! case 1: return op(reinterpret_cast<const gray16_view& >(img)); break; ! case 2: return op(reinterpret_cast<const gray32_view& >(img)); break; ! case 3: return op(reinterpret_cast<const rgb8_view& >(img)); break; ! case 4: return op(reinterpret_cast<const rgb16_view& >(img)); break; ! case 5: return op(reinterpret_cast<const rgb32_view& >(img)); break; ! case 6: return op(reinterpret_cast<const bgr8_view& >(img)); break; ! case 7: return op(reinterpret_cast<const bgr16_view& >(img)); break; ! case 8: return op(reinterpret_cast<const bgr32_view& >(img)); break; ! case 9: return op(reinterpret_cast<const rgb8_planar_view& >(img)); break; ! case 10: return op(reinterpret_cast<const rgb16_planar_view& >(img)); break; ! case 11: return op(reinterpret_cast<const rgb32_planar_view& >(img)); break; ! case 12: return op(reinterpret_cast<const rgba8_view& >(img)); break; ! case 13: return op(reinterpret_cast<const rgba16_view& >(img)); break; ! case 14: return op(reinterpret_cast<const rgba32_view& >(img)); break; ! case 15: return op(reinterpret_cast<const rgba8_planar_view& >(img)); break; ! case 16: return op(reinterpret_cast<const rgba16_planar_view& >(img)); break; ! case 17: return op(reinterpret_cast<const rgba32_planar_view& >(img)); break; ! case 18: return op(reinterpret_cast<const cmyk8_view& >(img)); break; ! case 19: return op(reinterpret_cast<const cmyk16_view& >(img)); break; ! case 20: return op(reinterpret_cast<const cmyk32_view& >(img)); break; ! case 21: return op(reinterpret_cast<const cmyk8_planar_view& >(img)); break; ! case 22: return op(reinterpret_cast<const cmyk16_planar_view& >(img)); break; ! case 23: return op(reinterpret_cast<const cmyk32_planar_view& >(img)); break; ! case 24: return op(reinterpret_cast<const gray8_step_view& >(img)); break; ! case 25: return op(reinterpret_cast<const gray16_step_view& >(img)); break; ! case 26: return op(reinterpret_cast<const gray32_step_view& >(img)); break; ! case 27: return op(reinterpret_cast<const rgb8_step_view& >(img)); break; ! case 28: return op(reinterpret_cast<const rgb16_step_view& >(img)); break; ! case 29: return op(reinterpret_cast<const rgb32_step_view& >(img)); break; ! case 30: return op(reinterpret_cast<const bgr8_step_view& >(img)); break; ! case 31: return op(reinterpret_cast<const bgr16_step_view& >(img)); break; ! case 32: return op(reinterpret_cast<const bgr32_step_view& >(img)); break; ! case 33: return op(reinterpret_cast<const rgb8_planar_step_view& >(img)); break; ! case 34: return op(reinterpret_cast<const rgb16_planar_step_view& >(img)); break; ! case 35: return op(reinterpret_cast<const rgb32_planar_step_view& >(img)); break; ! case 36: return op(reinterpret_cast<const rgba8_step_view& >(img)); break; ! case 37: return op(reinterpret_cast<const rgba16_step_view& >(img)); break; ! case 38: return op(reinterpret_cast<const rgba32_step_view& >(img)); break; ! case 39: return op(reinterpret_cast<const rgba8_planar_step_view& >(img)); break; ! case 40: return op(reinterpret_cast<const rgba16_planar_step_view& >(img)); break; ! case 41: return op(reinterpret_cast<const rgba32_planar_step_view& >(img)); break; ! case 42: return op(reinterpret_cast<const cmyk8_step_view& >(img)); break; ! case 43: return op(reinterpret_cast<const cmyk16_step_view& >(img)); break; ! case 44: return op(reinterpret_cast<const cmyk32_step_view& >(img)); break; ! case 45: return op(reinterpret_cast<const cmyk8_planar_step_view& >(img)); break; ! case 46: return op(reinterpret_cast<const cmyk16_planar_step_view& >(img)); break; ! case 47: return op(reinterpret_cast<const cmyk32_planar_step_view& >(img)); break; ! default: throw std::bad_cast(); ! } ! } //#endif }; --- 204,320 ---- typedef parent_type::type_id type_id; typedef parent_type::base_type base_type; ! typedef AnyConstImageViewConceptSpace const_type; template <typename IMG> static type_id get_type_id() { return get_view_type_id<IMG>(); } ! template <typename OP> ! static typename OP::result_type apply(const base_type& img, type_id id, OP& op) { ! switch (id) { ! case 0: return op(reinterpret_cast<const gray8_view& >(img)); break; ! case 1: return op(reinterpret_cast<const gray16_view& >(img)); break; ! case 2: return op(reinterpret_cast<const gray32_view& >(img)); break; ! case 3: return op(reinterpret_cast<const rgb8_view& >(img)); break; ! case 4: return op(reinterpret_cast<const rgb16_view& >(img)); break; ! case 5: return op(reinterpret_cast<const rgb32_view& >(img)); break; ! case 6: return op(reinterpret_cast<const bgr8_view& >(img)); break; ! case 7: return op(reinterpret_cast<const bgr16_view& >(img)); break; ! case 8: return op(reinterpret_cast<const bgr32_view& >(img)); break; ! case 9: return op(reinterpret_cast<const rgb8_planar_view& >(img)); break; ! case 10: return op(reinterpret_cast<const rgb16_planar_view& >(img)); break; ! case 11: return op(reinterpret_cast<const rgb32_planar_view& >(img)); break; ! case 12: return op(reinterpret_cast<const rgba8_view& >(img)); break; ! case 13: return op(reinterpret_cast<const rgba16_view& >(img)); break; ! case 14: return op(reinterpret_cast<const rgba32_view& >(img)); break; ! case 15: return op(reinterpret_cast<const rgba8_planar_view& >(img)); break; ! case 16: return op(reinterpret_cast<const rgba16_planar_view& >(img)); break; ! case 17: return op(reinterpret_cast<const rgba32_planar_view& >(img)); break; ! case 18: return op(reinterpret_cast<const cmyk8_view& >(img)); break; ! case 19: return op(reinterpret_cast<const cmyk16_view& >(img)); break; ! case 20: return op(reinterpret_cast<const cmyk32_view& >(img)); break; ! case 21: return op(reinterpret_cast<const cmyk8_planar_view& >(img)); break; ! case 22: return op(reinterpret_cast<const cmyk16_planar_view& >(img)); break; ! case 23: return op(reinterpret_cast<const cmyk32_planar_view& >(img)); break; ! case 24: return op(reinterpret_cast<const gray8_step_view& >(img)); break; ! case 25: return op(reinterpret_cast<const gray16_step_view& >(img)); break; ! case 26: return op(reinterpret_cast<const gray32_step_view& >(img)); break; ! case 27: return op(reinterpret_cast<const rgb8_step_view& >(img)); break; ! case 28: return op(reinterpret_cast<const rgb16_step_view& >(img)); break; ! case 29: return op(reinterpret_cast<const rgb32_step_view& >(img)); break; ! case 30: return op(reinterpret_cast<const bgr8_step_view& >(img)); break; ! case 31: return op(reinterpret_cast<const bgr16_step_view& >(img)); break; ! case 32: return op(reinterpret_cast<const bgr32_step_view& >(img)); break; ! case 33: return op(reinterpret_cast<const rgb8_planar_step_view& >(img)); break; ! case 34: return op(reinterpret_cast<const rgb16_planar_step_view& >(img)); break; ! case 35: return op(reinterpret_cast<const rgb32_planar_step_view& >(img)); break; ! case 36: return op(reinterpret_cast<const rgba8_step_view& >(img)); break; ! case 37: return op(reinterpret_cast<const rgba16_step_view& >(img)); break; ! case 38: return op(reinterpret_cast<const rgba32_step_view& >(img)); break; ! case 39: return op(reinterpret_cast<const rgba8_planar_step_view& >(img)); break; ! case 40: return op(reinterpret_cast<const rgba16_planar_step_view& >(img)); break; ! case 41: return op(reinterpret_cast<const rgba32_planar_step_view& >(img)); break; ! case 42: return op(reinterpret_cast<const cmyk8_step_view& >(img)); break; ! case 43: return op(reinterpret_cast<const cmyk16_step_view& >(img)); break; ! case 44: return op(reinterpret_cast<const cmyk32_step_view& >(img)); break; ! case 45: return op(reinterpret_cast<const cmyk8_planar_step_view& >(img)); break; ! case 46: return op(reinterpret_cast<const cmyk16_planar_step_view& >(img)); break; ! case 47: return op(reinterpret_cast<const cmyk32_planar_step_view& >(img)); break; ! default: throw std::bad_cast(); ! } ! } //#ifdef PROVIDE_CONST_VERSIONS ! template <typename OP> ! static typename OP::result_type apply(const base_type& img, type_id id, const OP& op) { ! switch (id) { ! case 0: return op(reinterpret_cast<const gray8_view& >(img)); break; ! case 1: return op(reinterpret_cast<const gray16_view& >(img)); break; ! case 2: return op(reinterpret_cast<const gray32_view& >(img)); break; ! case 3: return op(reinterpret_cast<const rgb8_view& >(img)); break; ! case 4: return op(reinterpret_cast<const rgb16_view& >(img)); break; ! case 5: return op(reinterpret_cast<const rgb32_view& >(img)); break; ! case 6: return op(reinterpret_cast<const bgr8_view& >(img)); break; ! case 7: return op(reinterpret_cast<const bgr16_view& >(img)); break; ! case 8: return op(reinterpret_cast<const bgr32_view& >(img)); break; ! case 9: return op(reinterpret_cast<const rgb8_planar_view& >(img)); break; ! case 10: return op(reinterpret_cast<const rgb16_planar_view& >(img)); break; ! case 11: return op(reinterpret_cast<const rgb32_planar_view& >(img)); break; ! case 12: return op(reinterpret_cast<const rgba8_view& >(img)); break; ! case 13: return op(reinterpret_cast<const rgba16_view& >(img)); break; ! case 14: return op(reinterpret_cast<const rgba32_view& >(img)); break; ! case 15: return op(reinterpret_cast<const rgba8_planar_view& >(img)); break; ! case 16: return op(reinterpret_cast<const rgba16_planar_view& >(img)); break; ! case 17: return op(reinterpret_cast<const rgba32_planar_view& >(img)); break; ! case 18: return op(reinterpret_cast<const cmyk8_view& >(img)); break; ! case 19: return op(reinterpret_cast<const cmyk16_view& >(img)); break; ! case 20: return op(reinterpret_cast<const cmyk32_view& >(img)); break; ! case 21: return op(reinterpret_cast<const cmyk8_planar_view& >(img)); break; ! case 22: return op(reinterpret_cast<const cmyk16_planar_view& >(img)); break; ! case 23: return op(reinterpret_cast<const cmyk32_planar_view& >(img)); break; ! case 24: return op(reinterpret_cast<const gray8_step_view& >(img)); break; ! case 25: return op(reinterpret_cast<const gray16_step_view& >(img)); break; ! case 26: return op(reinterpret_cast<const gray32_step_view& >(img)); break; ! case 27: return op(reinterpret_cast<const rgb8_step_view& >(img)); break; ! case 28: return op(reinterpret_cast<const rgb16_step_view& >(img)); break; ! case 29: return op(reinterpret_cast<const rgb32_step_view& >(img)); break; ! case 30: return op(reinterpret_cast<const bgr8_step_view& >(img)); break; ! case 31: return op(reinterpret_cast<const bgr16_step_view& >(img)); break; ! case 32: return op(reinterpret_cast<const bgr32_step_view& >(img)); break; ! case 33: return op(reinterpret_cast<const rgb8_planar_step_view& >(img)); break; ! case 34: return op(reinterpret_cast<const rgb16_planar_step_view& >(img)); break; ! case 35: return op(reinterpret_cast<const rgb32_planar_step_view& >(img)); break; ! case 36: return op(reinterpret_cast<const rgba8_step_view& >(img)); break; ! case 37: return op(reinterpret_cast<const rgba16_step_view& >(img)); break; ! case 38: return op(reinterpret_cast<const rgba32_step_view& >(img)); break; ! case 39: return op(reinterpret_cast<const rgba8_planar_step_view& >(img)); break; ! case 40: return op(reinterpret_cast<const rgba16_planar_step_view& >(img)); break; ! case 41: return op(reinterpret_cast<const rgba32_planar_step_view& >(img)); break; ! case 42: return op(reinterpret_cast<const cmyk8_step_view& >(img)); break; ! case 43: return op(reinterpret_cast<const cmyk16_step_view& >(img)); break; ! case 44: return op(reinterpret_cast<const cmyk32_step_view& >(img)); break; ! case 45: return op(reinterpret_cast<const cmyk8_planar_step_view& >(img)); break; ! case 46: return op(reinterpret_cast<const cmyk16_planar_step_view& >(img)); break; ! case 47: return op(reinterpret_cast<const cmyk32_planar_step_view& >(img)); break; ! default: throw std::bad_cast(); ! } ! } //#endif }; *************** *** 326,338 **** typedef parent_type::base_type base_type; ! typedef AnyConstImageViewConceptSpace const_view_concept_space; ! typedef AnyImageViewConceptSpace view_concept_space; ! /// \brief maps the template parameters of an image to the non-negative integers ! template <typename IMG> static type_id get_type_id() { return get_view_type_id<typename IMG::view_type>(); } ! template <typename OP> ! static typename OP::result_type apply(base_type& img, type_id id, OP& op) { ! switch (id) { case 0: return op(reinterpret_cast<gray8_image& >(img)); break; case 1: return op(reinterpret_cast<gray16_image& >(img)); break; --- 326,338 ---- typedef parent_type::base_type base_type; ! typedef AnyConstImageViewConceptSpace const_view_concept_space; ! typedef AnyImageViewConceptSpace view_concept_space; ! /// \brief maps the template parameters of an image to the non-negative integers ! template <typename IMG> static type_id get_type_id() { return get_view_type_id<typename IMG::view_type>(); } ! template <typename OP> ! static typename OP::result_type apply(base_type& img, type_id id, OP& op) { ! switch (id) { case 0: return op(reinterpret_cast<gray8_image& >(img)); break; case 1: return op(reinterpret_cast<gray16_image& >(img)); break; *************** *** 393,399 **** } //#ifdef PROVIDE_CONST_VERSIONS ! template <typename OP> ! static typename OP::result_type apply(base_type& img, type_id id, const OP& op) { ! switch (id) { case 0: return op(reinterpret_cast<gray8_image& >(img)); break; case 1: return op(reinterpret_cast<gray16_image& >(img)); break; --- 393,399 ---- } //#ifdef PROVIDE_CONST_VERSIONS ! template <typename OP> ! static typename OP::result_type apply(base_type& img, type_id id, const OP& op) { ! switch (id) { case 0: return op(reinterpret_cast<gray8_image& >(img)); break; case 1: return op(reinterpret_cast<gray16_image& >(img)); break; |