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

| Ranges and Points |

## Classes
class | Box< VALUETYPE, DIMENSION >
| 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< T, SIZE >
| 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...
## Typedefs
typedef TinyVector < Diff2D::MoveX, 2 > | value_type
## Functions
triple< Diff2D, Diff2D, MeshGridAccessor > | meshGrid (Diff2D upperLeft, Diff2D lowerRight)
template<class ITERATOR >
value_type | operator() (ITERATOR const &i) const
template<class ITERATOR , class DIFFERENCE >
value_type | operator() (ITERATOR const &i, DIFFERENCE const &diff) const
Diff2D | operator+ (Diff2D const &a, Diff2D const &b)
Size2D | operator+ (Size2D const &a, Diff2D const &b)
Point2D | operator+ (Point2D const &a, Diff2D const &b)
Point2D | operator+ (Size2D const &s, Point2D const &p)
Diff2D | operator- (Diff2D const &a, Diff2D const &b)
Size2D | operator- (Size2D const &s, Diff2D const &offset)
Point2D | operator- (Point2D const &s, Diff2D const &offset)
Size2D | operator- (Point2D const &s, Point2D const &p)

## Detailed Description

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

## Typedef Documentation

typedef TinyVector<Diff2D::MoveX, 2> value_type

the value_type of a mesh grid is a 2D vector

## 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

value_type operator() | ( | ITERATOR const & | i | ) | const

read the current data item

value_type operator() | ( | ITERATOR const & | i,
|  | DIFFERENCE const & | diff
| ) |  | const

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.9.0 (Tue Nov 6 2012)