|
using | value_type = typename Loc::value_type |
|
using | reference = typename Loc::reference |
|
using | coord_t = typename Loc::coord_t |
|
using | difference_type = coord_t |
|
using | point_t = typename Loc::point_t |
|
using | locator = Loc |
|
using | const_t = image_view< typename Loc::const_t > |
|
using | iterator = iterator_from_2d< Loc > |
|
using | const_iterator = typename const_t::iterator |
|
using | const_reference = typename const_t::reference |
|
using | pointer = typename std::iterator_traits< iterator >::pointer |
|
using | reverse_iterator = std::reverse_iterator< iterator > |
|
using | size_type = std::size_t |
|
using | xy_locator = locator |
|
using | x_iterator = typename xy_locator::x_iterator |
|
using | y_iterator = typename xy_locator::y_iterator |
|
using | x_coord_t = typename xy_locator::x_coord_t |
|
using | y_coord_t = typename xy_locator::y_coord_t |
|
|
| image_view (image_view const &img_view) |
|
template<typename View > |
| image_view (View const &view) |
|
template<typename L2 > |
| image_view (point_t const &dims, L2 const &loc) |
|
template<typename L2 > |
| image_view (coord_t width, coord_t height, L2 const &loc) |
|
template<typename View > |
image_view & | operator= (View const &view) |
|
image_view & | operator= (image_view const &view) |
|
template<typename View > |
bool | operator== (View const &view) const |
|
template<typename View > |
bool | operator!= (View const &view) const |
|
void | swap (image_view< Loc > &other) |
| Exchanges the elements of the current view with those of other in constant time. More...
|
|
auto | dimensions () const -> point_t const & |
|
auto | pixels () const -> locator const & |
|
auto | width () const -> x_coord_t |
|
auto | height () const -> y_coord_t |
|
auto | num_channels () const -> std::size_t |
|
bool | is_1d_traversable () const |
|
bool | empty () const |
| Returns true if the view has no elements, false otherwise. More...
|
|
auto | front () const -> reference |
| Returns a reference to the first element in raster order. More...
|
|
auto | back () const -> reference |
| Returns a reference to the last element in raster order. More...
|
|
template<typename Loc>
class boost::gil::image_view< Loc >
A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept.
Image view consists of a pixel 2D locator (defining the mechanism for navigating in 2D) and the image dimensions.
Image views to images are what ranges are to STL containers. They are lightweight objects, that don't own the pixels. It is the user's responsibility that the underlying data remains valid for the lifetime of the image view.
Similar to iterators and ranges, constness of views does not extend to constness of pixels. A const image_view
does not allow changing its location in memory (resizing, moving) but does not prevent one from changing the pixels. The latter requires an image view whose value_type is const.
Images have interfaces consistent with STL 1D random access containers, so they can be used directly in STL algorithms like:
std::fill(img.begin(), img.end(), red_pixel);
In addition, horizontal, vertical and 2D random access iterators are provided.
Note also that image_view
does not require that its element type be a pixel. It could be instantiated with a locator whose value_type
models only Regular
. In this case the image view models the weaker RandomAccess2DImageViewConcept, and does not model PixelBasedConcept. Many generic algorithms don't require the elements to be pixels.