[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

| Ranges and Points |

## Classes
class | Box
| Represent an n-dimensional box as a (begin, end) pair. Depending on the value type, end() is considered to be outside the box (as in the STL, for integer types), or inside (for floating point types). size() will always be end() - begin(). More...
class | Diff2D
| Two dimensional difference vector. More...
class | Dist2D
struct | MeshGridAccessor
class | Point2D
| Two dimensional point or position. More...
class | Rect2D
| Two dimensional rectangle. More...
class | Size2D
| Two dimensional size object. More...
class | TinyVector
| Class for fixed size vectors. This class contains an array of size SIZE of the specified VALUETYPE. The interface conforms to STL vector, except that there are no functions that change the size of a TinyVector. More...
## Functions
triple< Diff2D, Diff2D, MeshGridAccessor > | meshGrid (Diff2D upperLeft, Diff2D lowerRight)
template<class ITERATOR, class DIFFERENCE>
value_type | operator() (ITERATOR const &i, DIFFERENCE const &diff) const
template<class ITERATOR>
value_type | operator() (ITERATOR const &i) const
Point2D | operator+ (Size2D const &s, Point2D const &p)
Point2D | operator+ (Point2D const &a, Diff2D const &b)
Size2D | operator+ (Size2D const &a, Diff2D const &b)
Diff2D | operator+ (Diff2D const &a, Diff2D const &b)
Size2D | operator- (Point2D const &s, Point2D const &p)
Point2D | operator- (Point2D const &s, Diff2D const &offset)
Size2D | operator- (Size2D const &s, Diff2D const &offset)
Diff2D | operator- (Diff2D const &a, Diff2D const &b)

## Detailed Description

Specify 2-D and N-D positions, extents, and boxes.

## Function Documentation

Diff2D vigra::operator- | ( | Diff2D const & | a,
|  | Diff2D const & | b |
| ) |  |  |

Create vector by subtracting specified offset.

Size2D vigra::operator- | ( | Size2D const & | s,
|  | Diff2D const & | offset |
| ) |  |  |

Create size by subtracting specified offset.

Point2D vigra::operator- | ( | Point2D const & | s,
|  | Diff2D const & | offset |
| ) |  |  |

Calculate size of rect between two points.

Size2D vigra::operator- | ( | Point2D const & | s,
|  | Point2D const & | p |
| ) |  |  |

The difference of two points is a size

Diff2D vigra::operator+ | ( | Diff2D const & | a,
|  | Diff2D const & | b |
| ) |  |  |

Create vector by adding specified offset.

Size2D vigra::operator+ | ( | Size2D const & | a,
|  | Diff2D const & | b |
| ) |  |  |

Create size by adding specified offset.

Point2D vigra::operator+ | ( | Point2D const & | a,
|  | Diff2D const & | b |
| ) |  |  |

Create point by adding specified offset.

Point2D vigra::operator+ | ( | Size2D const & | s,
|  | Point2D const & | p |
| ) |  |  |

Add size and point

template<class ITERATOR>
value_type operator() | ( | ITERATOR const & | i | ) | const`[inherited]`

read the current data item

template<class ITERATOR, class DIFFERENCE>
value_type operator() | ( | ITERATOR const & | i,
|  | DIFFERENCE const & | diff |
| ) |  |  | const`[inherited]`

read the data item at an offset (can be 1D or 2D or higher order difference).

triple<Diff2D, Diff2D, MeshGridAccessor> vigra::meshGrid | ( | Diff2D | upperLeft,
|  | Diff2D | lowerRight |
| ) |  |  |

Create a mesh grid for the specified rectangle.

The mesh grid concept is adapted from MATLAB. It is a two banded image (i.e. with 2D vector pixel type) whose first band contains the x-coordinates of the current pixel, and whose second band contains the y-coordinates. If upperLeft is not the point (0,0), the mesh grid is translated relative to the pixel indices.

Declarations:

        triple<Diff2D, Diff2D, MeshGridAccessor>
        meshGrid(Diff2D upperLeft, Diff2D lowerRight);

        triple<Diff2D, Diff2D, MeshGridAccessor>
        meshGrid(Rect2D const & r);

Usage:

        #include <vigra/meshgrid.hxx>
        // create an image whose values are equal to each pixel's distance from the image center
        int width = 5, height = 7;
        int xc = width/2, yc = height/2; // the image center

        FImage dist(width, height);
        Point2D upperLeft(-xc, -yc);

        using namespace vigra::functor;
        transformImage(meshGrid(upperLeft, upperLeft+dist.size()),
                       destImage(dist),
                       norm(Arg1()));

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany | html generated using doxygen and Python vigra 1.7.1 (3 Dec 2010)