Adobe Systems, Inc.

image_view< LOC > Class Template Reference
[Image View]

A lightweight object that interprets memory as a 2D array of pixels. More...

#include <image_view.hpp>

List of all members.


Public Types

typedef LOC::channel_t channel_t
typedef LOC::color_space_t color_space_t
typedef image_view< typename
LOC::const_t > 
const_t
typedef LOC::coord_t coord_t
typedef coord_t difference_type
typedef pixel_t domain_t
typedef image_view< typename
LOC::dynamic_step_t > 
dynamic_step_t
typedef pixel_image_iterator<
LOC > 
iterator
typedef LOC locator
typedef LOC::pixel_t pixel_t
typedef LOC::point_t point_t
typedef LOC::reference reference
typedef std::reverse_iterator<
iterator
reverse_iterator
typedef std::size_t size_type
typedef LOC::value_type value_type
typedef xy_locator::x_coord_t x_coord_t
typedef xy_locator::x_iterator x_iterator
typedef locator xy_locator
typedef xy_locator::y_coord_t y_coord_t
typedef xy_locator::y_iterator y_iterator

Public Member Functions

 BOOST_STATIC_CONSTANT (int, num_channels=locator::num_channels)
const point_tdimensions () const
y_coord_t height () const
 image_view (coord_t width, coord_t height, const x_iterator &x_it, coord_t row_bytes)
 image_view (const point_t &sz, const x_iterator &x_it, coord_t row_bytes)
template<typename L2>
 image_view (coord_t width, coord_t height, const L2 &loc)
template<typename L2>
 image_view (const point_t &sz, const L2 &loc)
template<typename VIEW>
 image_view (const VIEW &iv)
 image_view ()
template<typename VIEW>
bool operator!= (const VIEW &v) const
image_viewoperator= (const image_view &iv)
template<typename VIEW>
image_viewoperator= (const VIEW &iv)
template<typename VIEW>
bool operator== (const VIEW &v) const
difference_type pix_bytestep () const
const locatorpixels () const
difference_type row_bytes () const
x_coord_t width () const
1D navigation
iterator at (x_coord_t x, y_coord_t y) const
iterator at (const point_t &p) const
iterator at (difference_type i) const
iterator begin () const
iterator end () const
reference operator[] (difference_type i) const
reverse_iterator rbegin () const
reverse_iterator rend () const
size_type size () const
2-D navigation
template<std::size_t D>
axis< D >::iterator axis_iterator (const point_t &p) const
reference operator() (x_coord_t x, y_coord_t y) const
reference operator() (const point_t &p) const
locator xy_at (const point_t &p) const
xy_locator xy_at (x_coord_t x, y_coord_t y) const
Y navigation
y_iterator col_begin (x_coord_t x) const
y_iterator col_end (x_coord_t x) const
y_iterator y_at (const point_t &p) const
y_iterator y_at (x_coord_t x, y_coord_t y) const
X navigation
x_iterator row_begin (y_coord_t y) const
x_iterator row_end (y_coord_t y) const
x_iterator x_at (const point_t &p) const
x_iterator x_at (x_coord_t x, y_coord_t y) const

Static Public Attributes

static const std::size_t num_dimensions

Friends

class image_view
template<typename L2>
void swap (image_view< L2 > &x, image_view< L2 > &y)

Classes

struct  axis

Detailed Description

template<typename LOC>
class image_view< LOC >

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); or std::transform(img.begin(), img.end(), dst.begin(), color_converter<rgb8_pixel_t>()); // convert src to RGB

In addition, horizontal, vertical and 2D random access iterators are provided.

Definition at line 62 of file image_view.hpp.

Copyright © 2006 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google