PARP Research Group | Universidad de Murcia |
QVGenericImage Class Reference
|
Public Member Functions | |
QVGenericImage () | |
Default constructor. | |
QVGenericImage (QVGenericImage const &img) | |
Copy constructor. | |
virtual | ~QVGenericImage () |
Virtual destructor for QVGenericImage. | |
virtual uInt | getCols () const =0 |
Virtual method for getting the number of columns of the image. | |
virtual uInt | getRows () const =0 |
Virtual method for getting the number of rows of the image. | |
virtual uInt | getStep () const =0 |
Virtual method for getting the row step of the image. | |
QSize | getSize () const |
Virtual method for getting the size of the image. | |
virtual uInt | getChannels () const =0 |
Virtual method for getting the number of channels of the image. | |
virtual uInt | getTypeSize () const =0 |
Virtual method for getting bit depth of the image, in bytes. | |
virtual uInt | getDataSize () const =0 |
Virtual method for getting data size for the image. | |
const QRect & | getROI () const |
Method for obtaining actual region of interest for image. | |
void | resetROI () |
Resets the region of interest of the image. | |
void | erodeROI (uInt cols, uInt rows) |
Reduces the region of interest of the image, in a given amount of pixels. | |
void | dilateROI (uInt cols, uInt rows) |
Increments the region of interest of the image, in a given amount of pixels. | |
void | setROI (int x, int y, uInt w, uInt h) |
Set the region of interest of the image. | |
void | setROI (const QRect &rect) |
Set the region of interest (ROI) for the image, from a rectangle. | |
const QPoint & | getAnchor () const |
Obtains actual anchor point for the image. | |
void | resetAnchor () |
Set anchor point of the image to pixel (0,0). | |
void | setAnchor (int col, int row) |
Set anchor point of the image. | |
void | setAnchor (const QPoint &point) |
Set anchor point of the image. | |
virtual const char * | getTypeQString () const =0 |
Obtain a char string identifying the type of the image. real image contained in the QVGenericImage. | |
bool | isCompatibleWith (const char *qvImageClassName) const |
Check whether an image is compatible in type with another image, provided its type id string. | |
bool | isCompatibleWith (const QVGenericImage *image) const |
Check whether an image is compatible with this image. |
Base class for QVImage objects.
For instance, this class is useful to create code like this:
int imageAreaSize(QVGenericImage *image) { return image->getCols() * image->getRows(); }
Where it doesn't matter the bit depth or number of channels of the image, but the number of cols and rows of it, as well as generic containers, that can hold a variety of image types, for example:
class GenericImageContainer { public: int count; QVGenericImage *images; [...] void addImage(QVGenericImage *image) { images[count++] = ℑ } QVGenericImage getImage(int index) { return images[index]; } }
Thus, this class offers access methods for all kind of information about the image, like dimensions (see getCols() and getRows() methods), bit depth and number of planes (see getTypeSize() and getChannels() methods), ROI and anchor of the image (see getROI() and getAnchor() methods mainly), but pixel accessor methods, that are defined in the subclass QVImage, and depends on the bit depth and number of planes of the image.
Definition at line 67 of file qvgenericimage.h.
QVGenericImage::QVGenericImage | ( | ) | [inline] |
Default constructor.
Initializes image ROI and anchor to zero offset and width, both.
Definition at line 73 of file qvgenericimage.h.
QVGenericImage::QVGenericImage | ( | QVGenericImage const & | img | ) | [inline] |
Copy constructor.
Initializes image ROI and anchor to ROI and anchor from image 'img'.
Definition at line 78 of file qvgenericimage.h.
virtual QVGenericImage::~QVGenericImage | ( | ) | [inline, virtual] |
Virtual destructor for QVGenericImage.
Definition at line 81 of file qvgenericimage.h.
virtual uInt QVGenericImage::getCols | ( | ) | const [pure virtual] |
Virtual method for getting the number of columns of the image.
Implemented in QVImage< Type, Channels >, QVImage< uChar >, QVImage< uChar, 1 >, and QVImage< uChar, 3 >.
Referenced by getSize(), resetROI(), setAnchor(), and setROI().
virtual uInt QVGenericImage::getRows | ( | ) | const [pure virtual] |
Virtual method for getting the number of rows of the image.
Implemented in QVImage< Type, Channels >, QVImage< uChar >, QVImage< uChar, 1 >, and QVImage< uChar, 3 >.
Referenced by getSize(), resetROI(), setAnchor(), and setROI().
virtual uInt QVGenericImage::getStep | ( | ) | const [pure virtual] |
Virtual method for getting the row step of the image.
This functions returns the distance in bytes between starts of consecutive lines in the image.
This may be not equal to a multiple of the number of columns, so this value is necessary to normal access to the image.
Implemented in QVImage< Type, Channels >, QVImage< uChar >, QVImage< uChar, 1 >, and QVImage< uChar, 3 >.
QSize QVGenericImage::getSize | ( | ) | const [inline] |
Virtual method for getting the size of the image.
This functions returns the distance in bytes between starts of consecutive lines in the image.
This may be not equal to a multiple of the number of columns, so this value is necessary to access the pixels in the image, using methods for raw image access.
Definition at line 111 of file qvgenericimage.h.
virtual uInt QVGenericImage::getChannels | ( | ) | const [pure virtual] |
Virtual method for getting the number of channels of the image.
Returned value should be equal to template parameter 'Channels', for any QVImage. This is the number of channels that can be accessed in the image.
Implemented in QVImage< Type, Channels >, QVImage< uChar >, QVImage< uChar, 1 >, and QVImage< uChar, 3 >.
virtual uInt QVGenericImage::getTypeSize | ( | ) | const [pure virtual] |
Virtual method for getting bit depth of the image, in bytes.
Returned value should be equal to size of template parameter 'Type', for any QVImage. This is the size of any element of the data array that stores the image in memory.
Implemented in QVImage< Type, Channels >, QVImage< uChar >, QVImage< uChar, 1 >, and QVImage< uChar, 3 >.
virtual uInt QVGenericImage::getDataSize | ( | ) | const [pure virtual] |
Virtual method for getting data size for the image.
This functions, for any image, returns the following value:
dataSize = rows * step * planes
Implemented in QVImage< Type, Channels >, QVImage< uChar >, QVImage< uChar, 1 >, and QVImage< uChar, 3 >.
const QRect& QVGenericImage::getROI | ( | ) | const [inline] |
Method for obtaining actual region of interest for image.
The region of interest of an image is used in many image processing and filtering operations. Check the section TheIPPWrapperFunctions for further documentation about the ROI of an image.
Definition at line 143 of file qvgenericimage.h.
Referenced by dilateROI(), erodeROI(), fastMaximalPoints(), Filter(), FilterColumn(), FilterDoG(), FilterHessianCornerResponseImage(), FilterRow(), getConnectedSetBorderContoursThreshold(), maximalPoints(), QVImage< uChar, 3 >::operator QImage(), QVImage< Type, Channels >::operator==(), QVImage< uChar, 3 >::QVImage(), RGBToYUV420(), and YUV420ToRGB().
void QVGenericImage::resetROI | ( | ) | [inline] |
Resets the region of interest of the image.
Sets the region of interest to the whole image. The ROI will be the rectangle from pixel (0,0), to pixel (image cols-1, image rows-1).
Check the section TheIPPWrapperFunctions for further documentation about the ROI of an image.
Definition at line 153 of file qvgenericimage.h.
void QVGenericImage::erodeROI | ( | uInt | cols, | |
uInt | rows | |||
) | [inline] |
Reduces the region of interest of the image, in a given amount of pixels.
Reduces a given amount of columns and rows to the ROI of the image, equally on each side of the ROI.
Check the section TheIPPWrapperFunctions for further documentation about the ROI of an image.
cols | columns to reduce the ROI. | |
rows | rows to reduce the ROI. |
Definition at line 163 of file qvgenericimage.h.
void QVGenericImage::dilateROI | ( | uInt | cols, | |
uInt | rows | |||
) | [inline] |
Increments the region of interest of the image, in a given amount of pixels.
Increments a given amount of columns and rows to the ROI of the image, equally on each side of the ROI.
Check the section TheIPPWrapperFunctions for further documentation about the ROI of an image.
cols | columns to increment the ROI. | |
rows | rows to increment the ROI. |
Definition at line 174 of file qvgenericimage.h.
void QVGenericImage::setROI | ( | int | x, | |
int | y, | |||
uInt | w, | |||
uInt | h | |||
) | [inline] |
Set the region of interest of the image.
The region of interest for an image is a rectangle, significant to many operations. Pixels outside this rectangle may be ignored by many filtering and image processing functions.
Check the section TheIPPWrapperFunctions for further documentation about the ROI of an image.
x | column of the pixel at the top left corner of the region of interest. | |
y | row of the pixel at the top left corner of the region of interest. | |
w | width of the region of interest. | |
h | height of the region of interest. |
Definition at line 188 of file qvgenericimage.h.
Referenced by dilateROI(), erodeROI(), Filter(), FilterColumn(), FilterDoG(), FilterHessianCornerResponseImage(), FilterRow(), QVImage< uChar, 3 >::QVImage(), resetROI(), RGBToYUV420(), setROI(), and YUV420ToRGB().
void QVGenericImage::setROI | ( | const QRect & | rect | ) | [inline] |
Set the region of interest (ROI) for the image, from a rectangle.
This is an overloaded version of the method setROI(int,int,uInt,uInt), provided for convenience.
Check the section TheIPPWrapperFunctions for further documentation about the ROI of an image.
rect | rectangle that represents region of interest. |
Definition at line 205 of file qvgenericimage.h.
const QPoint& QVGenericImage::getAnchor | ( | ) | const [inline] |
Obtains actual anchor point for the image.
The anchor of an image is used for some visualization operations.
Definition at line 230 of file qvgenericimage.h.
void QVGenericImage::resetAnchor | ( | ) | [inline] |
Set anchor point of the image to pixel (0,0).
Definition at line 235 of file qvgenericimage.h.
void QVGenericImage::setAnchor | ( | int | col, | |
int | row | |||
) | [inline] |
Set anchor point of the image.
col | column of the pixel where the anchor is located. | |
row | row of the pixel where the anchor is located. |
Definition at line 241 of file qvgenericimage.h.
Referenced by QVImage< uChar, 3 >::QVImage(), resetAnchor(), and setAnchor().
void QVGenericImage::setAnchor | ( | const QPoint & | point | ) | [inline] |
Set anchor point of the image.
point | QPoint where the anchor is located. |
Definition at line 246 of file qvgenericimage.h.
virtual const char* QVGenericImage::getTypeQString | ( | ) | const [pure virtual] |
Obtain a char string identifying the type of the image. real image contained in the QVGenericImage.
Implemented in QVImage< Type, Channels >, QVImage< uChar >, QVImage< uChar, 1 >, QVImage< uChar, 3 >, QVImage< Type, Channels >, QVImage< Type, Channels >, QVImage< Type, Channels >, QVImage< Type, Channels >, QVImage< Type, Channels >, QVImage< Type, Channels >, QVImage< Type, Channels >, QVImage< Type, Channels >, QVImage< Type, Channels >, QVImage< Type, Channels >, QVImage< Type, Channels >, and QVImage< Type, Channels >.
Referenced by isCompatibleWith().
bool QVGenericImage::isCompatibleWith | ( | const char * | qvImageClassName | ) | const [inline] |
Check whether an image is compatible in type with another image, provided its type id string.
This functions checks if this image has the same bit depth and channel number, as another image, given its type identification string. This string can be obtained using the method getTypeQString.
This function is used to determine the subclass of a QVGenericImage at execution time. An example code for this use is below:
[...] QVImage image; [...] if(image->isCompatibleWith("QVImage<uChar,1>")) // do stuff with the uChar bit depth, one channel image ... else if(image->isCompatibleWith("QVImage<uChar,3>")) // do stuff with the uChar bit depth, three channel image ... [...] else // alternate code for that type of image ... [...]
qvimageClassName | type id string identifying the type of another image. |
Definition at line 287 of file qvgenericimage.h.
Referenced by isCompatibleWith().
bool QVGenericImage::isCompatibleWith | ( | const QVGenericImage * | image | ) | const [inline] |
Check whether an image is compatible with this image.
This functions checks if this image is compatible with a given image. That is, it has same bit depth and same number of channels.
image | image to check type compatibility with the actual image. |
Definition at line 300 of file qvgenericimage.h.