| [String] [Up] [MaxTree] | Data Types |
| User Feedback |
class Coord
{
public:
Coord();
Coord(Coord& img);
Coord(int x, int y=1, int z=1);
~Coord();
Coord& operator=(Coord& img);
int x() const;
int y() const;
int z() const;
};
The pixel coordinates data type is an int32 vector of up to three values depending on the image dimensionality: 1D: [column]; 2D: [row,column]; 3D: [depth,row,column]. The top-left pixel of a 2D image is at the coordinates [0,0]. The center pixel of a structuring element is at coordinates [0,0] increasing from left to right and top to down.
The following public methods are intended for use by application programs:
Coord()
: default constructor
Coord(Coord&)
: copy constructor
Coord(int x, int y, int z)
: constructor that creates a Coord
with row index x
, column index y
and depth index z
.
~Coord()
: destructor
Coord& operator=
: assignment operator
int x()
: returns the row coordinate
int y()
: returns the column coordinate
int z()
: returns the depth coordinate
The class Coord
is a proxy for the internal toolbox coordinate type. It takes care of
chores like memory release and exception catching. When a toolbox function returns a coordinate, an
object of this class is created to be returned to the caller. The object constructor catches
any error ocurred in the function implementation and, in case of error, throws a
morphException
.
To free your code of the memory allocation statements, keep your Coords created in local space,
so the underlying C++ system will take care of the memory releasing. Only in the case of returning
an image to another procedure, create the image in the heap with the new
operator.
See the code of the demonstrations for examples of use of the Coord
class.
| [String] [Up] [MaxTree] | |
| User Feedback | |
| Copyright (c) 1998-2008 by SDC Information Systems |