13 #ifndef GIL_DYNAMICIMAGE_ANY_IMAGEVIEW_HPP
14 #define GIL_DYNAMICIMAGE_ANY_IMAGEVIEW_HPP
26 #include "../../image_view.hpp"
27 #include "../../image.hpp"
29 namespace boost {
namespace gil {
32 template <
typename View>
struct get_const_t {
typedef typename View::const_t type; };
33 template <
typename Views>
struct views_get_const_t :
public mpl::transform<Views, get_const_t<mpl::_1> > {};
35 template <
typename View>
struct dynamic_xy_step_type;
36 template <
typename View>
struct dynamic_xy_step_transposed_type;
39 struct any_type_get_num_channels {
40 typedef int result_type;
41 template <
typename T> result_type operator()(
const T&)
const {
return num_channels<T>::value; }
43 struct any_type_get_dimensions {
44 typedef point2<std::ptrdiff_t> result_type;
45 template <
typename T> result_type operator()(
const T& v)
const {
return v.dimensions(); }
63 template <
typename ImageViewTypes>
68 typedef std::ptrdiff_t x_coord_t;
69 typedef std::ptrdiff_t y_coord_t;
77 template <
typename T>
any_image_view& operator=(
const T& obj) { parent_t::operator=(obj);
return *
this; }
83 x_coord_t width()
const {
return dimensions().x; }
84 y_coord_t height()
const {
return dimensions().y; }
91 template <
typename IVTypes>
100 template <
typename IVTypes>
101 struct dynamic_y_step_type<any_image_view<IVTypes> > {
102 typedef any_image_view<typename mpl::transform<IVTypes, dynamic_y_step_type<mpl::_1> >::type> type;
105 template <
typename IVTypes>
106 struct dynamic_xy_step_type<any_image_view<IVTypes> > {
107 typedef any_image_view<typename mpl::transform<IVTypes, dynamic_xy_step_type<mpl::_1> >::type> type;
110 template <
typename IVTypes>
111 struct dynamic_xy_step_transposed_type<any_image_view<IVTypes> > {
112 typedef any_image_view<typename mpl::transform<IVTypes, dynamic_xy_step_transposed_type<mpl::_1> >::type> type;
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
Support for run-time instantiated types.
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
Returns the number of channels of a pixel-based GIL construct.
Definition: gil_concept.hpp:66