boost::gil::image_view

A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept

Synopsis

Declared in <boost/gil/image_view.hpp>

template<typename L>
class image_view;

Description

/////////////////////////////////////////////////////////////////////////////////////

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.

/////////////////////////////////////////////////////////////////////////////////////

Types

Member Functions

Name

Description

image_view [constructor]

Constructors

operator=

Assignment operators

at

axis_iterator

back

Returns a reference to the last element in raster order.

begin

col_begin

col_end

dimensions

empty

Returns true if the view has no elements, false otherwise.

end

front

Returns a reference to the first element in raster order.

height

is_1d_traversable

num_channels

operator()

Function call operators

operator[]

pixels

rbegin

rend

row_begin

row_end

size

swap

Exchanges the elements of the current view with those of other in constant time.

width

x_at

xy_at

y_at

operator==

Equality operator

operator!=

Inequality operator

Static Data Members

Friends

Name

Description

boost::gil::image_view

A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept

boost::gil::swap

Derived Classes

Name

Description

indexed_image_view

Created with MrDocs