#include <qgarlib/GenConvolImage.H>
Inheritance diagram for qgar::GenConvolImage< T, CheckingPolicy >:

The code implementing this class is an adaptation of code written by Carsten Steger at TU Muenchen, Germany. Here is the corresponding copyright notice:
+----------------------------------------------------------------------+ | Copyright (C) 1996 Carsten Steger | | | | This program is free software; you can redistribute it and/or modify | | it under the terms of the GNU General Public License as published by | | the Free Software Foundation; either version 2, or (at your option) | | any later version. | | | | This program is distributed in the hope that it will be useful, but | | WITHOUT ANY WARRANTY; without even the implied warranty of | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | General Public License for more details. | | | | You should have received a copy of the GNU General Public License | | along with this program; if not, write to the Free Software | | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | +----------------------------------------------------------------------+
All computation are made using the double format.
Definition at line 99 of file GenConvolImage.H.
Public Types | |
Types | |
| typedef T | value_type |
| Type of the elements stored in the pixmap. | |
| typedef value_type & | reference |
| Reference to qgar::GenConvolImage::value_type. | |
| typedef const value_type & | const_reference |
| Constant reference to qgar::GenConvolImage::value_type. | |
| typedef value_type * | pointer |
| Pointer to qgar::GenConvolImage::value_type. | |
| typedef const value_type * | const_pointer |
| Constant pointer to qgar::GenConvolImage::value_type. | |
Public Member Functions | |
| GenImage () | |
| Default constructor. | |
| GenImage (unsigned int aWidth, unsigned int aHeight) | |
| Initialize with given width and height. | |
| GenImage (unsigned int aWidth, unsigned int aHeight, pointer aPtPixMap) throw (QgarErrorInvalidArg) | |
| Initialize from a pixmap. | |
| GenImage (const GenImage &anImg) | |
| Copy constructor. | |
| GenImage (const GenImage< value_type, OtherCheckPolicy > &anImg) | |
| Conversion of an image of the same type, using policies. | |
| GenImage (const GenImage< U, UCheckPolicy > &anImg) | |
| Initialize from an image with pixels of a type different from T. | |
| GenImage (const GenImage< value_type, OtherCheckPolicy > &anImg, const BoundingBox &aBox, value_type aPixVal=static_cast< value_type >(0)) | |
| Initialize by copying a rectangular area, defined by a bounding box, of a given image. | |
| GenImage (const GenImage< value_type, OtherCheckPolicy > &anImg, unsigned int aXTopLeft, unsigned int aYTopLeft, unsigned int aXBottomRight, unsigned int aYBottomRight, value_type aPixVal=static_cast< value_type >(0)) | |
| Initialize by copying a rectangular area, defined by the coordinates of its top left and bottom right corners, of a given image. | |
| GenImage (AbstractPbmPlusFile &aPbmPlusFile) | |
| Initialize with an image in a PBM+ file. | |
| int | width () const |
| Get the image width. | |
| int | height () const |
| Get the image height. | |
| int | bytesPerPixel () const |
| Get the number of bytes per pixel. | |
| value_type | pixel (unsigned int aX, unsigned int aY) const |
| Get a pixel value. | |
| void | row (unsigned int aRowIdx, pointer aRow) const |
| Get a row of pixels. | |
| void | column (unsigned int aColIdx, pointer aCol) const |
| Get a column of pixels. | |
| pointer | pPixel (unsigned int aRowIdx, unsigned int aColIdx) const |
| Get a pointer on a given pixel of the image. | |
| pointer | pRow (unsigned int aRowIdx) const |
| Get a pointer on a row of pixels. | |
| pointer | pColumn (unsigned int aColIdx) const |
| Get a pointer on a column of pixels. | |
| pointer | pPixMap () const |
| Get the pointer to the pixel map. | |
| void | setPixel (unsigned int aX, unsigned int aY, value_type aPixVal) |
| Set a pixel value. | |
| void | setRow (unsigned int aRowIdx, const_pointer const aRow) |
| Set a given row of pixels. | |
| void | setColumn (unsigned int aColIdx, const_pointer const aCol) |
| Set a given column of pixels. | |
| void | draw (const Segment &aSeg, value_type aPixVal=(value_type) 1) |
| Draw a segment in the pixel map. | |
| GenImage | shallowCopy () |
| Shallow copy: The pixel map of the current image is not duplicated. | |
| GenImage< value_type, GenImage_NoCheck > | operator+ (const GenImage< value_type, OtherCheckPolicy > &anImg) const |
| Same as function qgar::GenImage::plus. | |
| GenImage & | operator+= (const GenImage< value_type, OtherCheckPolicy > &anImg) |
| Same as function qgar::GenImage::plusEqual. | |
| GenImage< value_type, GenImage_NoCheck > | operator- (const GenImage< value_type, OtherCheckPolicy > &anImg) const |
| Same as function qgar::GenImage::minus. | |
| GenImage & | operator-= (const GenImage< value_type, OtherCheckPolicy > &anImg) |
| Same as function qgar::GenImage::minusEqual. | |
| GenImage< value_type, GenImage_NoCheck > | operator * (const GenImage< value_type, OtherCheckPolicy > &anImg) const |
| Same as function qgar::GenImage::times. | |
| GenImage & | operator *= (const GenImage< value_type, OtherCheckPolicy > &anImg) |
| Same as function qgar::GenImage::timesEqual. | |
| GenImage< value_type, GenImage_NoCheck > | plus (const GenImage< value_type, OtherCheckPolicy > &anImg) const |
| Add each pixel of the given image to the corresponding pixel of the current image and store each result in a new pixel map. | |
| GenImage & | plusEqual (const GenImage< value_type, OtherCheckPolicy > &anImg) throw (QgarErrorDomain) |
| Add a given image to the current image. | |
| GenImage< value_type, GenImage_NoCheck > | minus (const GenImage< value_type, OtherCheckPolicy > &anImg) const |
| Subtract each pixel of the given image to the corresponding pixel of the current image and store each result in a new pixel map. | |
| GenImage & | minusEqual (const GenImage< value_type, OtherCheckPolicy > &anImg) throw (QgarErrorDomain) |
| Subtract a given image to the current image. | |
| GenImage< value_type, GenImage_NoCheck > | times (const GenImage< value_type, OtherCheckPolicy > &anImg) const |
| Multiply each pixel of the given image to the corresponding pixel of the current image and store each result in a new pixel map. | |
| GenImage & | timesEqual (const GenImage< value_type, OtherCheckPolicy > &anImg) throw (QgarErrorDomain) |
| Multiply a given image by the current image. | |
| void | save (AbstractPbmPlusFile &aPbmPlusFile) const |
| Store current image into a PBM+ file. | |
| int | borderRows (int aRowIdx) const |
| Mirror border rows for convolutions. | |
| int | borderCols (int aColIdx) const |
| Mirror border columns for convolutions. | |
Constructors | |
| template<class ImageType, template< class > class ImageCheckPolicy, class MaskType> | |
| GenConvolImage (const GenImage< ImageType, ImageCheckPolicy > &anImg, const GenMask1d< MaskType > &aMask, QGEaxis anAxis) | |
| Convolution of an image and a 1D mask. | |
| template<class ImageType, template< class > class ImageCheckPolicy> | |
| GenConvolImage (const GenImage< ImageType, ImageCheckPolicy > &anImg, const GenMask1d< double > &aMask, QGEaxis anAxis) | |
| Convolution of an image and a 1D mask. | |
| template<class ImageType, template< class > class ImageCheckPolicy, class MaskType> | |
| GenConvolImage (const GenImage< ImageType, ImageCheckPolicy > &anImg, const GenMask2d< MaskType > &aMask) | |
| Convolution of an image and a 2D mask. | |
| template<class ImageType, template< class > class ImageCheckPolicy> | |
| GenConvolImage (const GenImage< ImageType, ImageCheckPolicy > &anImg, const GenMask2d< double > &aMask) | |
| Convolution of an image and a 2D mask. | |
| GenConvolImage (const GenConvolImage &other) | |
| Copy constructor. | |
Destructor | |
| virtual | ~GenConvolImage () |
| Virtual destructor. | |
Protected Member Functions | |
| GenImage (unsigned int aBytesCnt, int *aPtRefCnt, unsigned int aWidth, unsigned int aHeight, pointer aPtPixMap) | |
| Initialize from all data. | |
| void | copyBox (const GenImage< value_type, CheckingPolicy > &anImg, unsigned int aXTopLeft, unsigned int aYTopLeft, unsigned int aXBottomRight, unsigned int aYBottomRight, value_type aPixVal=static_cast< value_type >(0)) |
| Copy a rectangular area of the given image into the current image. | |
1D convolutions | |
| template<class ImageType, template< class > class ImageCheckPolicy> | |
| void | xconvol (const GenImage< ImageType, ImageCheckPolicy > &anImg, const DMask1d &aMask) |
| Convolve and image along X axis with a 1D mask. | |
| template<class ImageType, template< class > class ImageCheckPolicy> | |
| void | yconvol (const GenImage< ImageType, ImageCheckPolicy > &anImg, const DMask1d &aMask) |
| Convolve along Y axis with a 1D mask. | |
2D convolutions | |
| template<class ImageType, template< class > class ImageCheckPolicy> | |
| void | convol (const GenImage< ImageType, ImageCheckPolicy > &anImg, const DMask2d &aMask) |
| Convolve with a 2D mask. | |
| template<class ImageType, template< class > class OtherCheckPolicy> | |
| double | applyMaskWithRowAndColMirroring (const GenImage< ImageType, OtherCheckPolicy > &img, const DMask2d &mask, int imgRow, int imgCol) |
| Compute the convolution of an image and a mask for a given pixel using row and column mirroring. | |
| template<class ImageType, template< class > class OtherCheckPolicy> | |
| double | applyMaskWithRowMirroring (const GenImage< ImageType, OtherCheckPolicy > &img, const DMask2d mask, int imgRow, int imgCol) |
| Compute the convolution of an image and a mask for a given pixel using row mirroring. | |
| template<class ImageType, template< class > class OtherCheckPolicy> | |
| double | applyMaskWithColMirroring (const GenImage< ImageType, OtherCheckPolicy > &img, const DMask2d mask, int imgRow, int imgCol) |
| Compute the convolution of an image and a mask for a given pixel using column mirroring. | |
| template<class ImageType, template< class > class OtherCheckPolicy> | |
| double | applyMask (const GenImage< ImageType, OtherCheckPolicy > &img, const DMask2d mask, int imgRow, int imgCol) |
| Compute the convolution of an image and a mask for a given pixel. | |
Protected Attributes | |
| unsigned int | _bytesPerPixel |
| Number of bytes per pixel. | |
| int * | _pRefCnt |
| Reference counter. | |
| int | _width |
| Image width. | |
| int | _height |
| Image height. | |
| pointer | _pPixMap |
| Pointer to the pixel map, organized as consecutive rows. | |
Private Member Functions | |
Disabled | |
| GenConvolImage & | operator= (const GenConvolImage &rhs) |
| Assignment operator. | |
|
|||||
|
Constant pointer to qgar::GenConvolImage::value_type.
Reimplemented from qgar::GenImage< T, CheckingPolicy >. Definition at line 137 of file GenConvolImage.H. |
|
|||||
|
Constant reference to qgar::GenConvolImage::value_type.
Reimplemented from qgar::GenImage< T, CheckingPolicy >. Definition at line 127 of file GenConvolImage.H. |
|
|||||
|
Pointer to qgar::GenConvolImage::value_type.
Reimplemented from qgar::GenImage< T, CheckingPolicy >. Definition at line 132 of file GenConvolImage.H. |
|
|||||
|
Reference to qgar::GenConvolImage::value_type.
Reimplemented from qgar::GenImage< T, CheckingPolicy >. Definition at line 122 of file GenConvolImage.H. |
|
|||||
|
Type of the elements stored in the pixmap.
Reimplemented from qgar::GenImage< T, CheckingPolicy >. Definition at line 117 of file GenConvolImage.H. |
|
||||||||||||||||||||||||
|
Convolution of an image and a 1D mask.
Definition at line 64 of file GenConvolImage.TCC. References qgar::QGE_AXIS_X, qgar::GenConvolImage< T, CheckingPolicy >::xconvol(), and qgar::GenConvolImage< T, CheckingPolicy >::yconvol(). |
|
||||||||||||||||||||||||
|
Convolution of an image and a 1D mask. Specialization of the general template constructor.
Definition at line 97 of file GenConvolImage.TCC. References qgar::QGE_AXIS_X, qgar::GenConvolImage< T, CheckingPolicy >::xconvol(), and qgar::GenConvolImage< T, CheckingPolicy >::yconvol(). |
|
||||||||||||||||||||
|
Convolution of an image and a 2D mask. Specialization of the general template constructor.
Definition at line 126 of file GenConvolImage.TCC. References qgar::GenConvolImage< T, CheckingPolicy >::convol(). |
|
||||||||||||||||||||
|
Convolution of an image and a 2D mask. Specialization of the general template constructor.
|
|
||||||||||
|
Copy constructor.
Definition at line 165 of file GenConvolImage.TCC. |
|
|||||||||
|
Virtual destructor.
Definition at line 180 of file GenConvolImage.TCC. |
|
||||||||||||||||||||||||||||
|
Compute the convolution of an image and a mask for a given pixel.
Definition at line 455 of file GenConvolImage.TCC. Referenced by qgar::GenConvolImage< T, CheckingPolicy >::convol(). |
|
||||||||||||||||||||||||||||
|
Compute the convolution of an image and a mask for a given pixel using column mirroring.
Definition at line 391 of file GenConvolImage.TCC. Referenced by qgar::GenConvolImage< T, CheckingPolicy >::convol(). |
|
||||||||||||||||||||||||||||
|
Compute the convolution of an image and a mask for a given pixel using row and column mirroring.
Definition at line 359 of file GenConvolImage.TCC. Referenced by qgar::GenConvolImage< T, CheckingPolicy >::convol(). |
|
||||||||||||||||||||||||||||
|
Compute the convolution of an image and a mask for a given pixel using row mirroring.
Definition at line 422 of file GenConvolImage.TCC. Referenced by qgar::GenConvolImage< T, CheckingPolicy >::convol(). |
|
|
Mirror border columns for convolutions.
Referenced by qgar::GenConvolImage< T, CheckingPolicy >::xconvol(). |
|
|
Mirror border rows for convolutions.
Referenced by qgar::GenConvolImage< T, CheckingPolicy >::yconvol(). |
|
|
Get the number of bytes per pixel.
|
|
||||||||||||
|
Get a column of pixels.
|
|
||||||||||||||||||||
|
Convolve with a 2D mask.
Definition at line 486 of file GenConvolImage.TCC. References qgar::GenImage< T, CheckingPolicy >::_height, qgar::GenImage< T, CheckingPolicy >::_pPixMap, qgar::GenImage< T, CheckingPolicy >::_width, qgar::GenConvolImage< T, CheckingPolicy >::applyMask(), qgar::GenConvolImage< T, CheckingPolicy >::applyMaskWithColMirroring(), qgar::GenConvolImage< T, CheckingPolicy >::applyMaskWithRowAndColMirroring(), qgar::GenConvolImage< T, CheckingPolicy >::applyMaskWithRowMirroring(), qgar::GenMask2d< T >::height(), qgar::GenImage< T, CheckingPolicy >::row(), and qgar::GenMask2d< T >::width(). Referenced by qgar::GenConvolImage< T, CheckingPolicy >::GenConvolImage(). |
|
||||||||||||||||||||||||||||
|
Copy a rectangular area of the given image into the current image. The sides of the rectangle are parallel to the coordinate axis.
|
|
||||||||||||
|
Draw a segment in the pixel map. The segment pixels are set using Bresenham's algorithm. See W.M. Newman and R.F. Sproull, Principles of Interactive Computer Graphics, pp. 25-26.
|
|
||||||||||||||||||||||||
|
Initialize from all data.
|
|
|
Initialize with an image in a PBM+ file. The given PBM+ file is opened (in READ ONLY mode) at the call, and closed before returning.
|
|
||||||||||||||||||||||||||||
|
Initialize by copying a rectangular area, defined by the coordinates of its top left and bottom right corners, of a given image. The rectangle sides are parallel to the coordinate axis.
|
|
||||||||||||||||
|
Initialize by copying a rectangular area, defined by a bounding box, of a given image. The rectangle sides are parallel to the coordinate axis.
|
|
|
Initialize from an image with pixels of a type different from T.
|
|
|
Conversion of an image of the same type, using policies.
|
|
|
Copy constructor. Perform a deep copy: The pixel map of the source image is duplicated.
|
|
||||||||||||||||
|
Initialize from a pixmap.
|
|
||||||||||||
|
Initialize with given width and height.
|
|
|
Default constructor. Set 0 to width, to height, to pointer to pixel map, and to reference counter. |
|
|
Get the image height.
|
|
|
Subtract each pixel of the given image to the corresponding pixel of the current image and store each result in a new pixel map.
|
|
|
Subtract a given image to the current image.
|
|
|
Same as function qgar::GenImage::times.
|
|
|
Same as function qgar::GenImage::timesEqual.
|
|
|
Same as function qgar::GenImage::plus.
|
|
|
Same as function qgar::GenImage::plusEqual.
|
|
|
Same as function qgar::GenImage::minus.
|
|
|
Same as function qgar::GenImage::minusEqual.
|
|
||||||||||
|
Assignment operator.
|
|
|
Get a pointer on a column of pixels.
|
|
||||||||||||
|
Get a pixel value.
|
|
|
Add each pixel of the given image to the corresponding pixel of the current image and store each result in a new pixel map.
|
|
|
Add a given image to the current image. Add each pixel of the given image to the corresponding pixel of the current image and store each result in the pixel map of the current image.
|
|
||||||||||||
|
Get a pointer on a given pixel of the image.
|
|
|
Get the pointer to the pixel map.
|
|
|
Get a pointer on a row of pixels.
|
|
||||||||||||
|
Get a row of pixels.
Referenced by qgar::GenConvolImage< T, CheckingPolicy >::convol(). |
|
|
Store current image into a PBM+ file. The given PBM+ file is opened (in WRITE ONLY mode) at the call, and closed before returning.
|
|
||||||||||||
|
Set a given column of pixels.
|
|
||||||||||||||||
|
Set a pixel value.
|
|
||||||||||||
|
Set a given row of pixels.
|
|
|
Shallow copy: The pixel map of the current image is not duplicated.
|
|
|
Multiply each pixel of the given image to the corresponding pixel of the current image and store each result in a new pixel map.
|
|
|
Multiply a given image by the current image. Multiply each pixel of the given image by the corresponding pixel of the current image and store each result in the pixel map of the current image.
|
|
|
Get the image width.
|
|
||||||||||||||||||||
|
Convolve and image along X axis with a 1D mask.
Definition at line 200 of file GenConvolImage.TCC. References qgar::GenImage< T, CheckingPolicy >::_height, qgar::GenImage< T, CheckingPolicy >::_pPixMap, qgar::GenImage< T, CheckingPolicy >::_width, qgar::GenImage< T, CheckingPolicy >::borderCols(), qgar::GenMask1d< T >::pCoeffMap(), qgar::GenImage< T, CheckPolicy >::pPixMap(), and qgar::GenMask1d< T >::width(). Referenced by qgar::GenConvolImage< T, CheckingPolicy >::GenConvolImage(). |
|
||||||||||||||||||||
|
Convolve along Y axis with a 1D mask.
Definition at line 277 of file GenConvolImage.TCC. References qgar::GenImage< T, CheckingPolicy >::_height, qgar::GenImage< T, CheckingPolicy >::_pPixMap, qgar::GenImage< T, CheckingPolicy >::_width, qgar::GenImage< T, CheckingPolicy >::borderRows(), qgar::GenMask1d< T >::pCoeffMap(), qgar::GenImage< T, CheckPolicy >::pPixMap(), and qgar::GenMask1d< T >::width(). Referenced by qgar::GenConvolImage< T, CheckingPolicy >::GenConvolImage(). |
|
|
Number of bytes per pixel.
Definition at line 1096 of file GenImage.H. |
|
|
Image height.
Definition at line 1114 of file GenImage.H. Referenced by qgar::GenConvolImage< T, CheckingPolicy >::convol(), qgar::GenConvolImage< T, CheckingPolicy >::xconvol(), and qgar::GenConvolImage< T, CheckingPolicy >::yconvol(). |
|
|
Pointer to the pixel map, organized as consecutive rows.
Definition at line 1120 of file GenImage.H. Referenced by qgar::GenConvolImage< T, CheckingPolicy >::convol(), qgar::GenConvolImage< T, CheckingPolicy >::xconvol(), and qgar::GenConvolImage< T, CheckingPolicy >::yconvol(). |
|
|
Reference counter. Its value represent the number of other images with which the current image shares its pixel map. Definition at line 1104 of file GenImage.H. |
|
|
Image width.
Definition at line 1109 of file GenImage.H. Referenced by qgar::GenConvolImage< T, CheckingPolicy >::convol(), qgar::GenConvolImage< T, CheckingPolicy >::xconvol(), and qgar::GenConvolImage< T, CheckingPolicy >::yconvol(). |