8 #ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ANY_IMAGE_VIEW_HPP 9 #define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ANY_IMAGE_VIEW_HPP 11 #include <boost/gil/dynamic_step.hpp> 12 #include <boost/gil/image.hpp> 13 #include <boost/gil/image_view.hpp> 14 #include <boost/gil/point.hpp> 15 #include <boost/gil/detail/mp11.hpp> 17 #include <boost/variant.hpp> 19 namespace boost {
namespace gil {
21 template <
typename View>
22 struct dynamic_xy_step_transposed_type;
26 template <
typename View>
27 struct get_const_t {
using type =
typename View::const_t; };
29 template <
typename Views>
30 struct views_get_const_t : mp11::mp_transform<get_const_t, Views> {};
33 struct any_type_get_num_channels
35 using result_type = int;
37 result_type operator()(
const T&)
const {
return num_channels<T>::value; }
41 struct any_type_get_dimensions
43 using result_type = point<std::ptrdiff_t>;
45 result_type operator()(
const T& v)
const {
return v.dimensions(); }
49 struct any_type_get_size
51 using result_type = std::size_t;
53 result_type operator()(
const T& v)
const {
return v.size(); }
73 template <
typename Views>
76 using parent_t =
typename make_variant_over<Views>::type;
79 using x_coord_t = std::ptrdiff_t;
80 using y_coord_t = std::ptrdiff_t;
82 using size_type = std::size_t;
87 template <
typename View>
90 template <
typename OtherViews>
92 : parent_t((
typename make_variant_over<OtherViews>::type
const&)
view)
97 parent_t::operator=((parent_t
const&)
view);
101 template <
typename View>
104 parent_t::operator=(
view);
108 template <
typename OtherViews>
111 parent_t::operator=((
typename make_variant_over<OtherViews>::type
const&)
view);
118 x_coord_t width()
const {
return dimensions().x; }
119 y_coord_t height()
const {
return dimensions().y; }
126 template <
typename Views>
134 template <
typename T>
145 template <
typename Views>
146 struct dynamic_y_step_type<any_image_view<Views>>
153 template <
typename T>
157 using type = any_image_view<mp11::mp_transform<dynamic_step_view, Views>>;
160 template <
typename Views>
161 struct dynamic_xy_step_type<any_image_view<Views>>
168 template <
typename T>
169 using dynamic_step_view =
typename gil::dynamic_xy_step_type<T>::type;
172 using type = any_image_view<mp11::mp_transform<dynamic_step_view, Views>>;
175 template <
typename Views>
176 struct dynamic_xy_step_transposed_type<any_image_view<Views>>
183 template <
typename T>
184 using dynamic_step_view =
typename gil::dynamic_xy_step_type<T>::type;
187 using type = any_image_view<mp11::mp_transform<dynamic_step_view, Views>>;
BOOST_FORCEINLINE auto 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:21
Base template for types that model HasDynamicYStepTypeConcept.
Definition: dynamic_step.hpp:21
Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
Definition: any_image_view.hpp:74
const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
Returns the non-constant-pixel view of an image.
Definition: image.hpp:535
Returns an integral constant type specifying the number of elements in a color base.
Definition: color_base_algorithm.hpp:42
Returns the number of channels of a pixel-based GIL construct.
Definition: locator.hpp:38
Base template for types that model HasDynamicXStepTypeConcept.
Definition: dynamic_step.hpp:17