[ VIGRA Homepage |
Class Index |
Function Index |
File Index |
Main Page ]
|
Diff2D Class Reference
|
 |
Two dimensional difference vector.
More...
#include "vigra/diff2d.hxx"
Inheritance diagram for Diff2D:
Two dimensional difference vector.
This class acts primarily as a difference vector for specifying pixel coordinates and region sizes. In addition, Diff2D fulfills the requirements of an ImageIterator, so that it can be used to simulate an image whose pixels' values equal their coordinates. This secondary usage is explained on page CoordinateIterator.
Standard usage as a difference vector is mainly needed in the context of images. For example, Diff2D may be used as an index for operator[]
:
This is especially important in connection with accessors, where the offset variant of operator()
takes only one offset object:
Diff2D is also returned by image.size()
, so that we can create new images by calculating their size using Diff2D's arithmetic functions:
Image new_image(old_image.size() - Diff2D(10,10));
#include "vigra/utilities.hxx"
Namespace: vigra
- Examples:
-
profile.cxx, and subimage.cxx.
Member Typedef Documentation
typedef IteratorAdaptor<Diff2DConstColumnIteratorPolicy<Diff2D> > column_iterator
|
|
|
The associated column iterator. |
typedef Diff2D difference_type
|
|
|
the iterator's difference type (argument type of iter[diff] ) |
typedef Diff2D index_reference
|
|
|
the iterator's index reference type (return type of iter[diff] )
Reimplemented in Point2D. |
typedef image_traverser_tag iterator_category
|
|
|
the iterator tag (image traverser) |
|
type of the iterator's x-navigator |
|
type of the iterator's y-navigator |
|
The iterator's value type: a coordinate.
Reimplemented in Point2D. |
typedef Diff2D const* pointer
|
|
|
the iterator's pointer type (return type of iter.operator->() )
Reimplemented in Point2D. |
typedef Diff2D const& reference
|
|
|
the iterator's reference type (return type of *iter )
Reimplemented in Point2D. |
typedef IteratorAdaptor<Diff2DConstRowIteratorPolicy<Diff2D> > row_iterator
|
|
|
The associated row iterator. |
typedef Diff2D value_type
|
|
|
The iterator's value type: a coordinate.
Reimplemented in Point2D. |
Constructor & Destructor Documentation
|
Default Constructor. Init iterator at position (0,0) |
Diff2D |
( |
int |
ax, |
|
|
int |
ay |
|
) |
[inline] |
|
|
Construct at given position. |
Diff2D |
( |
Diff2D const & |
v |
) |
[inline] |
|
Member Function Documentation
|
Get a column iterator at the current position. |
double magnitude |
( |
|
) |
const [inline] |
|
|
Calculate length of difference vector. |
|
Access current coordinate.
Reimplemented in Point2D. |
Diff2D operator * |
( |
double |
factor |
) |
const [inline] |
|
|
Create vector by scaling by factor. |
Diff2D operator * |
( |
int |
factor |
) |
const [inline] |
|
|
Create vector by scaling by factor. |
Diff2D& operator *= |
( |
double |
factor |
) |
[inline] |
|
|
Create vector by scaling by factor. |
Diff2D& operator *= |
( |
int |
factor |
) |
[inline] |
|
|
Create vector by scaling by factor. |
bool operator!= |
( |
Diff2D const & |
r |
) |
const [inline] |
|
index_reference operator() |
( |
int const & |
dx, |
|
|
int const & |
dy |
|
) |
const [inline] |
|
|
Read coordinate at an offset.
Reimplemented in Point2D. |
Diff2D& operator+= |
( |
Diff2D const & |
offset |
) |
[inline] |
|
|
Increase coordinate by specified offset.
Reimplemented in Size2D, and Point2D. |
Diff2D operator- |
( |
|
) |
const [inline] |
|
Diff2D& operator-= |
( |
Diff2D const & |
offset |
) |
[inline] |
|
|
Decrease coordinate by specified vector.
Reimplemented in Size2D, and Point2D. |
pointer operator-> |
( |
|
) |
const [inline] |
|
|
Access current coordinate.
Reimplemented in Point2D. |
Diff2D operator/ |
( |
double |
factor |
) |
const [inline] |
|
|
Create vector by scaling by 1/factor. |
Diff2D operator/ |
( |
int |
factor |
) |
const [inline] |
|
|
Create vector by scaling by 1/factor. |
Diff2D& operator/= |
( |
double |
factor |
) |
[inline] |
|
|
Create vector by scaling by 1/factor. |
Diff2D& operator/= |
( |
int |
factor |
) |
[inline] |
|
|
Create vector by scaling by 1/factor. |
Diff2D& operator= |
( |
Diff2D const & |
v |
) |
[inline] |
|
bool operator== |
( |
Diff2D const & |
r |
) |
const [inline] |
|
int operator[] |
( |
int |
index |
) |
const [inline] |
|
|
Read coordinate at an offset.
Reimplemented in Point2D. |
|
Get a row iterator at the current position. |
Member Data Documentation
|
Used for both access to the current x-coordinate and to specify that an iterator navigation command is to be applied in x-direction.
usage: x = diff2d.x (use Diff2D::x as component of difference vector)
or ++diff.x (use Diff2D as iterator, move right) |
|
Used for both access to the current y-coordinate and to specify that an iterator navigation command is to be applied in y-direction.
usage: y = diff2d.y (use Diff2D::y as component of difference vector)
or ++diff.y (use Diff2D as iterator, move right) |
The documentation for this class was generated from the following file: