|
any_image.hpp
Go to the documentation of this file.
10 /*************************************************************************************************/
29 //#pragma warning(disable : 4244) // conversion from 'std::ptrdiff_t' to 'int', possible loss of data. even if we static-assert the two types are the same (on visual studio 8)
41 template <typename Images> struct images_get_views_t : public mpl::transform<Images, get_view_t<mpl::_1> > {};
44 template <typename Images> struct images_get_const_views_t : public mpl::transform<Images, get_const_view_t<mpl::_1> > {};
51 recreate_image_fnobj(const point2<std::ptrdiff_t>& dims, unsigned alignment) : _dimensions(dims), _alignment(alignment) {}
52 template <typename Image> result_type operator()(Image& img) const { img.recreate(_dimensions,_alignment); }
58 template <typename Image> result_type operator()( Image& img) const { return result_type(view(img)); }
64 template <typename Image> result_type operator()(const Image& img) const { return result_type(const_view(img)); }
82 typedef any_image_view<typename detail::images_get_const_views_t<ImageTypes>::type> const_view_t;
92 template <typename Types> any_image(const any_image<Types>& v) : parent_t((const variant<Types>&)v) {}
94 template <typename T> any_image& operator=(const T& obj) { parent_t::operator=(obj); return *this; }
95 any_image& operator=(const any_image& v) { parent_t::operator=((const parent_t&)v); return *this;}
96 template <typename Types> any_image& operator=(const any_image<Types>& v) { parent_t::operator=((const variant<Types>&)v); return *this;}
98 void recreate(const point_t& dims, unsigned alignment=1) { apply_operation(*this,detail::recreate_image_fnobj(dims,alignment)); }
99 void recreate(x_coord_t width, y_coord_t height, unsigned alignment=1) { recreate(point2<std::ptrdiff_t>(width,height),alignment); }
101 std::size_t num_channels() const { return apply_operation(*this, detail::any_type_get_num_channels()); }
102 point_t dimensions() const { return apply_operation(*this, detail::any_type_get_dimensions()); }
116 return apply_operation(anyImage, detail::any_image_get_view<typename any_image<Types>::view_t>());
122 return apply_operation(anyImage, detail::any_image_get_const_view<typename any_image<Types>::const_view_t>());
BOOST_FORCEINLINE any_image< Types >::const_view_t const_view(const any_image< Types > &anyImage) Returns the constant-pixel view of any image. The returned view is any view. Definition: any_image.hpp:121 Represents a run-time specified image. Note it does NOT model ImageConcept. Definition: any_image.hpp:79 BOOST_FORCEINLINE UnaryOp::result_type apply_operation(variant< Types > &arg, UnaryOp op) Invokes a generic mutable operation (represented as a unary function object) on a variant... Definition: apply_operation.hpp:35 Represents a concrete instance of a run-time specified type from a set of typesA concept is typically... Definition: variant.hpp:89 Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon... Definition: any_image_view.hpp:64 BOOST_FORCEINLINE any_image< Types >::view_t view(any_image< Types > &anyImage) Returns the non-constant-pixel view of any image. The returned view is any view. Definition: any_image.hpp:115 Returns the number of channels of a pixel-based GIL construct. Definition: gil_concept.hpp:61 Support for run-time instantiated image view. Generated on Mon Mar 26 2018 12:01:35 for Generic Image Library by
1.8.6
|