- typedef any_image_view<typename detail::images_get_const_views_t<ImageTypes>::type> const_view_t;
- typedef any_image_view<typename detail::images_get_views_t<ImageTypes>::type> view_t;
- typedef std::ptrdiff_t x_coord_t;
- typedef std::ptrdiff_t y_coord_t;
- typedef point2<std::ptrdiff_t> point_t;
-
- any_image() : parent_t() {}
- template <typename T> explicit any_image(const T& obj) : parent_t(obj) {}
- template <typename T> explicit any_image(T& obj, bool do_swap) : parent_t(obj,do_swap) {}
- any_image(const any_image& v) : parent_t((const parent_t&)v) {}
-
- template <typename T> any_image& operator=(const T& obj) { parent_t::operator=(obj); return *this; }
- any_image& operator=(const any_image& v) { parent_t::operator=((const parent_t&)v); return *this;}
-
- void recreate(const point_t& dims, unsigned alignment=1) { apply_operation(*this,detail::recreate_image_fnobj(dims,alignment)); }
- void recreate(x_coord_t width, y_coord_t height, unsigned alignment=1) { recreate(point2<std::ptrdiff_t>(width,height),alignment); }
-
- std::size_t num_channels() const { return apply_operation(*this, detail::any_type_get_num_channels()); }
- point_t dimensions() const { return apply_operation(*this, detail::any_type_get_dimensions()); }
- x_coord_t width() const { return dimensions().x; }
- y_coord_t height() const { return dimensions().y; }
+ using view_t = any_image_view<detail::images_get_views_t<Images>>;
+ using const_view_t = any_image_view<detail::images_get_const_views_t<Images>>;
+ using x_coord_t = std::ptrdiff_t;
+ using y_coord_t = std::ptrdiff_t;
+ using point_t = point<std::ptrdiff_t>;
+
+ any_image() = default;
+ any_image(any_image const& img) : parent_t((parent_t const&)img) {}
+
+ template <typename Image>
+ explicit any_image(Image const& img) : parent_t(img) {}
+
+ template <typename Image>
+ explicit any_image(Image& img, bool do_swap) : parent_t(img, do_swap) {}
+
+ template <typename OtherImages>
+ any_image(any_image<OtherImages> const& img)
+ : parent_t((typename make_variant_over<OtherImages>::type const&)img)
+ {}
+
+ any_image& operator=(any_image const& img)
+ {
+ parent_t::operator=((parent_t const&)img);
+ return *this;
+ }
+
+ template <typename Image>
+ any_image& operator=(Image const& img)
+ {
+ parent_t::operator=(img);
+ return *this;
+ }
+
+ template <typename OtherImages>
+ any_image& operator=(any_image<OtherImages> const& img)
+ {
+ parent_t::operator=((typename make_variant_over<OtherImages>::type const&)img);
+ return *this;
+ }
+
+ void recreate(const point_t& dims, unsigned alignment=1)
+ {
+ apply_operation(*this, detail::recreate_image_fnobj(dims, alignment));
+ }
+
+ void recreate(x_coord_t width, y_coord_t height, unsigned alignment=1)
+ {
+ recreate({ width, height }, alignment);
+ }
+
+ std::size_t num_channels() const
+ {
+ return apply_operation(*this, detail::any_type_get_num_channels());
+ }
+
+ point_t dimensions() const
+ {
+ return apply_operation(*this, detail::any_type_get_dimensions());
+ }
+
+ x_coord_t width() const { return dimensions().x; }
+ y_coord_t height() const { return dimensions().y; }