|
image_view.hpp
Go to the documentation of this file.
10 /*************************************************************************************************/
31 //#pragma warning(disable : 4244) // conversion from 'gil::image<V,Alloc>::coord_t' to 'int', possible loss of data (visual studio compiler doesn't realize that the two types are the same)
82 typedef typename Loc::template axis<D>::iterator iterator; // 1D iterator type along each dimension
84 typedef iterator_from_2d<Loc> iterator; // 1D iterator type for each pixel left-to-right inside top-to-bottom
97 static type make(const image_view<Loc>& iv, const Deref& d) { return type(iv.dimensions(), Loc::template add_deref<Deref>::make(iv.pixels(),d)); }
101 template <typename View> image_view(const View& iv) : _dimensions(iv.dimensions()), _pixels(iv.pixels()) {}
103 template <typename L2> image_view(const point_t& sz , const L2& loc) : _dimensions(sz), _pixels(loc) {}
104 template <typename L2> image_view(coord_t width, coord_t height, const L2& loc) : _dimensions(x_coord_t(width),y_coord_t(height)), _pixels(loc) {}
106 template <typename View> image_view& operator=(const View& iv) { _pixels=iv.pixels(); _dimensions=iv.dimensions(); return *this; }
107 image_view& operator=(const image_view& iv) { _pixels=iv.pixels(); _dimensions=iv.dimensions(); return *this; }
109 template <typename View> bool operator==(const View& v) const { return pixels()==v.pixels() && dimensions()==v.dimensions(); }
125 iterator end() const { return begin()+(difference_type)size(); } // potential performance problem!
128 reference operator[](difference_type i) const { return begin()[i]; } // potential performance problem!
139 template <std::size_t D> typename axis<D>::iterator axis_iterator(const point_t& p) const { return _pixels.axis_iterator<D>(p); }
140 xy_locator xy_at(x_coord_t x, y_coord_t y) const { return _pixels+point_t(x_coord_t(x),y_coord_t(y)); }
A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept. Definition: image_view.hpp:68 Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept. Definition: iterator_from_2d.hpp:52 GIL configuration file. Returns an MPL integral type specifying the number of elements in a color base. Definition: color_base_algorithm.hpp:61 Returns the number of channels of a pixel-based GIL construct. Definition: gil_concept.hpp:61 pixel step iterator, pixel image iterator and pixel dereference iterator Generated on Mon Mar 26 2018 16:26:15 for Generic Image Library by
1.8.6
|