|
User Documentation |
|
Centre for Vision, Speech & Signal Processing |
Comments:
The class Index2dC is a pair of IndexT values. It is usually used
as a two-dimensional index of two dimensional objects like arrays and
images.
Derived Classes:
Enumerated types:
Typedefs:
- typedef long int AreaT;
-
Area of a polyline.
- typedef DoubleT RealT;
-
General real parameter.
Variables:
Methods:
- Index2dC()
-
Creates index <0, 0>.
- explicit Index2dC(SizeT dim)
-
Creates an index
This is for compatibilty with N-D indexes, which
need to be told there dimentionality.
- Index2dC(IndexT row,IndexT column)
-
Creates index
.
- Index2dC(const Index2dC & index)
-
Copy constructor.
- Index2dC(BinStreamC & bs)
-
Creates/writes the index from/to the IO binary stream.
- const Index2dC & operator=(const Index2dC & i)
-
Sets this index to be equal to 'i'.
Object modification
-------------------
- void Set(const Index2dC & index)
-
Sets this index to be equal to 'index'.
- void Set(IndexT r,IndexT c)
-
Sets this index to be .
- Index2dC & Step(const DirectionRLUDC & dir)
-
Translates the index into direction 'dir'.
- Index2dC & Step(DirectionRLUDT dir)
-
Translates the index into direction 'dir'.
Visual C++ 5.0 won't do an automatic cast from DirectionRLUDT
to DirectionRLUDC.
- Index2dC & Step(CrackCodeT dir)
-
- Index2dC Swapped() const
-
Returns the 2-dimensional index with swapped value I() and J().
- Index2dC & Abs()
-
Changes both indexes to their absolute values.
Access to the member items
----------------------------
- const IndexT & Row() const
-
Constant access to the row index
- const IndexT & Col() const
-
Constant access to the column index
- IndexT & Row()
-
Access to the row index
- IndexT & Col()
-
Access to the column index
- IndexT & operator[](IndexT i)
-
Access to a particular index. If i == 0, it returns the row index,
if i == 1, it returns the column index.
- IndexT operator[](IndexT i) const
-
Returns a particular index. If i == 0, it returns the row index,
if i == 1, it returns the column index.
Logical conditions
------------------
- BooleanT operator==(const Index2dC & index) const
-
Returns TRUE if indexes have the same values.
- BooleanT operator!=(const Index2dC & index) const
-
Returns TRUE if indexes have different values.
- BooleanT IsInside(const IndexRange2dC & range) const
-
Returns TRUE, if this index is in the 'range'.
- BooleanT IsInside(const IndexRectangleC & range) const
-
Returns TRUE, if this index is in the 'range'.
- BooleanT IsMoreUpperLeft(const Index2dC & i) const
-
Returns TRUE, if Row() < i.Row() or
(Row() == i.Row() and Col() < i.Col()).
- BooleanT operator<(const Index2dC & i) const
-
A nick name for the member function IsMoreUpperLeft(i).
Operations on the neighbourhood
-------------------------------
- Index2dC & Right()
-
Shifts the index to the right.
- Index2dC & Left()
-
Shifts the index to the left.
- Index2dC & Up()
-
Shifts the index to the up.
- Index2dC & Down()
-
Shifts the index to the down.
- Index2dC RightN() const
-
Returns the index of the right neighbour.
- Index2dC LeftN() const
-
Returns the index of the left neighbour.
- Index2dC UpN() const
-
Returns the index of the upper neighbour.
- Index2dC DownN() const
-
Returns the index of the down neighbour.
- Index2dC LowerLeftN() const
-
Returns the coordinates of the downleft neighbouring pixel
- Index2dC LowerRightN() const
-
Returns the coordinates of the downright neighbouring pixel
- Index2dC UpperLeftN() const
-
Returns the coordinates of the upperleft neighbouring pixel
- Index2dC UpperRightN() const
-
Returns the coordinates of the upperright neighbouring pixel
- Index2dC Neighbour(const DirectionRLUDC & dir) const
-
Returns the index of the neighbour in the direction 'dir'.
- BooleanT IsRelNeighbour8() const
-
Is '*this' a relative index from 8-neighbourhood?
- BooleanT IsNeighbour8(const Index2dC & pxl) const
-
Is the 'pxl' a neighbouring index of '*this'?
- Index2dC Neighbour(const NeighbourOrderT neighOrder) const
-
Returns the coordinates of the neighbouring index.
- IndexT NeighbourOrder() const
-
Returns the order of the relative index.
- IndexT NeighbourOrder(const Index2dC & ind) const
-
Returns the order of the neighbouring index 'ind'.
Arithmetic operations
---------------------
- Index2dC operator-() const
-
Returns opposite elements (unary minus operator).
- const Index2dC & operator+=(const Index2dC & ind)
-
Adds the index 'ind' to this index.
- const Index2dC & operator-=(const Index2dC & ind)
-
Subtracts the index 'ind' from this index.
- const Index2dC & operator*=(const Index2dC & ind)
-
Multiplies this index by index 'ind' item by item.
- const Index2dC & operator/=(const Index2dC & ind)
-
Divides this index by index 'ind' item by item.
- const Index2dC & operator*=(const IntT alpha)
-
Multiplies this index by number 'alpha'.
- const Index2dC & operator*=(const RealT alpha)
-
Multiplies this index by real number 'alpha'.
- const Index2dC & operator/=(const IntT alpha)
-
Divides this index by number 'alpha'.
- const Index2dC & operator/=(const RealT alpha)
-
Divides this index by real number 'alpha'.
- Index2dC operator+(const Index2dC & ind) const
-
Adds this index and 'ind'.
- Index2dC operator-(const Index2dC & ind) const
-
Subtracts index 'ind' from this index.
- Index2dC operator*(const Index2dC & ind) const
-
Returns this index multiplied by index 'ind' item by item.
- Index2dC operator/(const Index2dC & ind) const
-
Returns this index divided by index 'ind' item by item.
- Index2dC operator*(const IntT alpha) const
-
Multiplies this index by number 'alpha'.
- Index2dC operator*(const RealT alpha) const
-
Multiplies this index by real number 'alpha'.
- Index2dC operator/(const IntT alpha) const
-
Divides this index by number 'alpha'.
- Index2dC operator/(const RealT alpha) const
-
Divides this index by real number 'alpha'.
Distance calculations
---------------------
- GridDistanceT MaxValueDistance(const Index2dC & i) const
-
Returns the distance of two indexes in maximum value metric.
- GridDistanceT CityBlockDistance(const Index2dC & i) const
-
Returns the distance of two indexes in absolute value metric.
- GridDistanceT SqrEuclidDistance(const Index2dC & i) const
-
Returns the distance of two indexes in square Euclid metric.
- RealT EuclidDistance(const Index2dC & i) const
-
Returns the distance of two indexes in Euclid metric.
- GridDistanceT SumSqr() const
-
Returns the sum of coordinate squares.
- GridDistanceT Distance(const Index2dC & i,GridMetricT m) const
-
Returns the distance of two indexes in the specified metric 'm'.
Special member functions
------------------------
- UIntT Hash(void) const
-
Generates a randomised hash value for this index.
- SizeT Dim(void) const
-
Returns a number of dimensions indexed.
- SizeT N() const
-
Returns the number of coordinates of this point.
- AreaT Area2(const Index2dC & second,const Index2dC & third) const
-
Returns twice the signed area of the triangle determined
by this, the second, and the third points. Positive if 'this',
'second', 'third' are oriented counter-clockwise, and negative if
clockwise.
Ref.: - O'Rourke,J.: Computatinal geometry in C;
Cambridge University Press, 1994, pp. 19-20
|
Programmer:Radek Marik, Documentation by CxxDoc: Tue Mar 20 10:48:08 2001
|