#include <Sample.h>
Inheritance diagram for prapi::ImageSampleIdentifier:

This identifier is useful when samples are created from an image or sub-images of a larger image. It stores the image name and sub-image coordinates.
To use this identifier, you must instantiate your samples as follows:
Sample<int,ImageSampleIdentifier> smpl;
If you omit "ImageSampleIdentifier", a string identifier will be used by default. A sample stored with a properly formatted string identifier can be typecasted to a sample with an ImageSampleIdentifier.
Public Methods | |
| ImageSampleIdentifier (void) | |
| The default constructor. | |
| ImageSampleIdentifier (const std::string &str) | |
| Initialize a new identifier using an identifier string. | |
| ImageSampleIdentifier (const std::string &name, int x, int y, int width, int height) | |
| Create a new identifier with the given image name and sub-image coordinates. | |
| ImageSampleIdentifier (const ImageSampleIdentifier &other) | |
| Create a copy of another identifier. | |
| ImageSampleIdentifier & | operator= (const ImageSampleIdentifier &other) |
| Copy the contents of another identifier. | |
| void | setIdentifier (const std::string &str) |
| Set the contents of this identifier according to the given identifier string. | |
| std::string | getIdentifier (void) |
| Get a formatted identifier string as described in setIdentifier. | |
| ImageSampleIdentifier & | operator= (const std::string &str) |
| operator std::string () | |
| std::string | getName (void) const |
| Get the name of the image, the sample this object identifies, was taken from. | |
| void | setName (const std::string &name) |
| Get the name of the image, the sample this object identifies, was taken from. | |
| std::string & | name (void) |
| Set the name of the image, the sample this object identifies, was taken from. | |
| int | getX (void) const |
| Get the X coordinate for this sample identifier. | |
| int & | x (void) |
| Get the X coordinate for this sample identifier. | |
| void | setX (int newX) |
| Set the X coordinate for this sample identifier. | |
| int | getY (void) const |
| Get the Y coordinate for this sample identifier. | |
| int & | y (void) |
| Get the Y coordinate for this sample identifier. | |
| void | setY (int newY) |
| Set the Y coordinate for this sample identifier. | |
| int | getWidth (void) const |
| Get the width of the image sample. | |
| int & | width (void) |
| Get the width of the image sample. | |
| void | setWidth (int newWidth) |
| Set the width of the image sample. | |
| int | getHeight (void) const |
| Get the height of the image sample. | |
| int & | height (void) |
| Get the height of the image sample. | |
| void | setHeight (int newHeight) |
| Set the height of the image sample. | |
Friends | |
| bool | operator== (const ImageSampleIdentifier &obj1, const ImageSampleIdentifier &obj2) |
| Compare two identifiers. | |
| bool | operator!= (const ImageSampleIdentifier &obj1, const ImageSampleIdentifier &obj2) |
| Compare two identifiers. | |
| std::ostream & | operator<< (std::ostream &sout, const ImageSampleIdentifier &obj) |
| std::istream & | operator>> (std::istream &sin, ImageSampleIdentifier &obj) |
| std::istream & | oldRead (std::istream &sin, ImageSampleIdentifier &obj) |
|
|
The default constructor. Creates an identifier with no name and all coordinates set to zero. |
|
|
Initialize a new identifier using an identifier string.
|
|
|
|
|
|
|
|
|
Set the contents of this identifier according to the given identifier string.
The format of the string must be as follows:
imagename x y width height The imagename field must not contain whitespace characters. Any number of whitespace characters can be used to separate the x, y, width and height fields.
|
|
||||||||||||
|
Compare two identifiers. The result is false if and only if both identifiers have the same name and the same sub-image coordinates. |
|
||||||||||||
|
Compare two identifiers. The result is true if and only if both identifiers have the same name and the same sub-image coordinates. |