A lightweight object that interprets memory as a 2D array of pixels. More...
#include <image_view.hpp>
Classes | |
struct | add_deref |
struct | axis |
Public Types | |
typedef Loc::value_type | value_type |
typedef Loc::reference | reference |
typedef Loc::coord_t | coord_t |
typedef coord_t | difference_type |
typedef Loc::point_t | point_t |
typedef Loc | locator |
typedef image_view< typename Loc::const_t > | const_t |
typedef iterator_from_2d< Loc > | iterator |
typedef std::reverse_iterator < iterator > | reverse_iterator |
typedef std::size_t | size_type |
typedef locator | xy_locator |
typedef xy_locator::x_iterator | x_iterator |
typedef xy_locator::y_iterator | y_iterator |
typedef xy_locator::x_coord_t | x_coord_t |
typedef xy_locator::y_coord_t | y_coord_t |
Public Member Functions | |
image_view () | |
template<typename View > | |
image_view (const View &iv) | |
template<typename L2 > | |
image_view (const point_t &sz, const L2 &loc) | |
template<typename L2 > | |
image_view (coord_t width, coord_t height, const L2 &loc) | |
template<typename View > | |
image_view & | operator= (const View &iv) |
image_view & | operator= (const image_view &iv) |
template<typename View > | |
bool | operator== (const View &v) const |
template<typename View > | |
bool | operator!= (const View &v) const |
const point_t & | dimensions () const |
const locator & | pixels () const |
x_coord_t | width () const |
y_coord_t | height () const |
std::size_t | num_channels () const |
bool | is_1d_traversable () const |
1D navigation | |
size_type | size () const |
iterator | begin () const |
iterator | end () const |
reverse_iterator | rbegin () const |
reverse_iterator | rend () const |
reference | operator[] (difference_type i) const |
iterator | at (difference_type i) const |
iterator | at (const point_t &p) const |
iterator | at (x_coord_t x, y_coord_t y) const |
2-D navigation | |
reference | operator() (const point_t &p) const |
reference | operator() (x_coord_t x, y_coord_t y) const |
template<std::size_t D> | |
axis< D >::iterator | axis_iterator (const point_t &p) const |
xy_locator | xy_at (x_coord_t x, y_coord_t y) const |
locator | xy_at (const point_t &p) const |
X navigation | |
x_iterator | x_at (x_coord_t x, y_coord_t y) const |
x_iterator | x_at (const point_t &p) const |
x_iterator | row_begin (y_coord_t y) const |
x_iterator | row_end (y_coord_t y) const |
Y navigation | |
y_iterator | y_at (x_coord_t x, y_coord_t y) const |
y_iterator | y_at (const point_t &p) const |
y_iterator | col_begin (x_coord_t x) const |
y_iterator | col_end (x_coord_t x) const |
Static Public Attributes | |
static const std::size_t | num_dimensions =2 |
Friends | |
template<typename L2 > | |
class | image_view |
template<typename L2 > | |
void | swap (image_view< L2 > &x, image_view< L2 > &y) |
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:
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.
typedef image_view<typename Loc::const_t> boost::gil::image_view< Loc >::const_t |
typedef Loc::coord_t boost::gil::image_view< Loc >::coord_t |
typedef coord_t boost::gil::image_view< Loc >::difference_type |
typedef iterator_from_2d<Loc> boost::gil::image_view< Loc >::iterator |
typedef Loc boost::gil::image_view< Loc >::locator |
typedef Loc::point_t boost::gil::image_view< Loc >::point_t |
typedef Loc::reference boost::gil::image_view< Loc >::reference |
typedef std::reverse_iterator<iterator> boost::gil::image_view< Loc >::reverse_iterator |
typedef std::size_t boost::gil::image_view< Loc >::size_type |
typedef Loc::value_type boost::gil::image_view< Loc >::value_type |
typedef xy_locator::x_coord_t boost::gil::image_view< Loc >::x_coord_t |
typedef xy_locator::x_iterator boost::gil::image_view< Loc >::x_iterator |
typedef locator boost::gil::image_view< Loc >::xy_locator |
typedef xy_locator::y_coord_t boost::gil::image_view< Loc >::y_coord_t |
typedef xy_locator::y_iterator boost::gil::image_view< Loc >::y_iterator |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References boost::gil::image_view< Loc >::begin(), and boost::multiprecision::backends::i.
|
inline |
|
inline |
|
inline |
References boost::multiprecision::backends::p.
|
inline |
|
inline |
References boost::gil::image_view< Loc >::y_at().
|
inline |
|
inline |
|
inline |
References boost::gil::image_view< Loc >::begin(), and boost::gil::image_view< Loc >::size().
Referenced by boost::gil::image_view< Loc >::rbegin().
|
inline |
References boost::gil::image_view< Loc >::dimensions().
Referenced by boost::gil::image_view< Loc >::col_end(), and boost::gil::image_view< Loc >::size().
|
inline |
References boost::gil::image_view< Loc >::width().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References boost::gil::image_view< Loc >::begin(), and boost::multiprecision::backends::i.
|
inline |
|
inline |
References boost::gil::image_view< Loc >::end().
|
inline |
References boost::gil::image_view< Loc >::begin().
|
inline |
References boost::gil::image_view< Loc >::x_at().
|
inline |
|
inline |
References boost::gil::image_view< Loc >::height(), and boost::gil::image_view< Loc >::width().
Referenced by boost::gil::image_view< Loc >::end().
|
inline |
|
inline |
Referenced by boost::gil::image_view< Loc >::row_begin(), and boost::gil::image_view< Loc >::row_end().
|
inline |
|
inline |
Referenced by boost::gil::image_view< Loc >::y_at().
|
inline |
References boost::multiprecision::backends::p.
|
inline |
References boost::gil::image_view< Loc >::xy_at().
Referenced by boost::gil::image_view< Loc >::col_begin(), and boost::gil::image_view< Loc >::col_end().
|
inline |
References boost::gil::image_view< Loc >::xy_at().
|
friend |
|
static |