MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
mds::img::CRect< I > Class Template Reference

Class template representing a rectangle within an existing image. More...

#include <mdsImageView.h>

Inheritance diagram for mds::img::CRect< I >:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { CLASS_IMAGE_VIEW }
 Simple tag of "image view" classes. More...
enum  { TEMPLATE_PARAMETER_IS_NOT_IMAGE = I::CLASS_IMAGE }
 Check that I is a image. More...
typedef CImageBase< CRect< I > > tBase
 Base class.
typedef I tImage
 Image type.
typedef I::tPixel tPixel
 Pixel type.

Public Member Functions

tPixel & at (tSize x, tSize y)
 Returns the pixel [x][y].
const tPixel & at (tSize x, tSize y) const
tPixel & at (tSize i)
 Returns the subscripted pixel.
const tPixel & at (tSize i) const
void copyFrom (const tPixel *pSrc)
 Fills the rectangle using a given input buffer.
void copyTo (tPixel *pDst) const
 Copies the data to the output buffer.
 CRect (const tImage &Image, tSize x, tSize y, tSize XSize, tSize YSize)
 Constructor...
 CRect (const tImage &Image, const CPoint2i &Pos, const CSize2i &Size)
 Yet another constructor...
 CRect (const tImage &Image, const CRange &XRange, const CRange &YRange)
 Yet another constructor...
 CRect (const CRect &)
 Copy constructor.
CRect & fill (const tPixel &c)
 Fills the rectangle using a given pixel value.
template<class Function >
Function forEach (Function Func)
 Calls a function object for every image pixel.
template<class Function >
Function forEach (Function Func)
 Calls a function object for every pixel in the rectangle.
template<class Function >
Function forEach (Function Func) const
 Calls a function object for every image pixel.
template<class Function >
Function forEach (Function Func) const
 Calls a function object for every pixel in the rectangle.
tSize getIdx (tSize x, tSize y) const
 Calculates index of the pixel [x][y].
tImage & getImageRef () const
 Returns reference to the original image.
tImage & getImpl ()
 Returns reference to the image implementation.
const tImage & getImpl () const
tSize getMargin () const
 Returns the image margin size in pixels.
CPoint2i & getPos ()
 Returns position of the left upper corner.
const CPoint2i & getPos () const
CSize2i & getSize ()
 Returns size of the rectangle.
const CSize2i & getSize () const
tSize getXOffset () const
 Returns offset between two neigbouring pixels in x-axis.
tSize getXSize () const
 Returns the image size (dimensions).
tSize getYOffset () const
 Returns offset between two neigbouring pixels in y-axis.
tSize getYSize () const
tSize height () const
tPixel & operator() (tSize x, tSize y)
 Returns the subscripted pixel [x][y].
const tPixel & operator() (tSize x, tSize y) const
tPixel & operator() (tSize i)
 Returns the subscripted pixel.
const tPixel & operator() (tSize i) const
template<class Derived >
CRect< I > & operator*= (const CImageBase< Derived > &Image)
template<typename U >
CRect< I > & operator*= (const U &c)
template<class Derived >
CRect & operator*= (const CImageBase< Derived > &Image)
 Pixel wise product.
template<typename U >
CRect & operator*= (const U &c)
 Multiplies all pixels by scalar.
template<class Derived >
CRect< I > & operator+= (const CImageBase< Derived > &Image)
template<typename U >
CRect< I > & operator+= (const U &c)
template<class Derived >
CRect & operator+= (const CImageBase< Derived > &Image)
 Pixel wise addition.
template<typename U >
CRect & operator+= (const U &c)
 Adds scalar to all pixels.
template<class Derived >
CRect< I > & operator-= (const CImageBase< Derived > &Image)
template<typename U >
CRect< I > & operator-= (const U &c)
template<class Derived >
CRect & operator-= (const CImageBase< Derived > &Image)
 Pixel wise subtraction.
template<typename U >
CRect & operator-= (const U &c)
 Subtracts scalar from all pixels.
template<class Derived >
CRect< I > & operator/= (const CImageBase< Derived > &Image)
template<typename U >
CRect< I > & operator/= (const U &c)
template<class Derived >
CRect & operator/= (const CImageBase< Derived > &Image)
 Pixel wise division.
template<typename U >
CRect & operator/= (const U &c)
 Divides all pixels by scalar.
template<class Function >
Function pforEach (Function Func)
 Calls a function object for every pixel in the rectangle.
template<class Function >
Function pforEach (Function Func) const
 Calls a function object for every pixel in the rectangle.
template<class Function >
Function pforEach (Function Func)
 Calls a function object for every image pixel.
template<class Function >
Function pforEach (Function Func) const
 Calls a function object for every image pixel.
tImage & set (tSize x, tSize y, const tPixel &Value)
 Sets the pixel at the position [x][y][z].
CRect & set (tSize x, tSize y, const tPixel &Value)
 Sets the pixel at the position [x][y].
tImage & set (tSize i, const tPixel &Value)
 Sets the subscripted pixel.
CRect & set (tSize i, const tPixel &Value)
 Sets the subsripted pixel.
tSize width () const
 Returns the image size (dimensions).

Protected Member Functions

CRect & operator= (const CRect &)
 Proctected assignment operator.

Protected Attributes

tImage & m_Image
 Reference to the original image.
CPoint2i m_Pos
 Coordinates of the origin.
CSize2i m_Size
 Size of the rectangle.

Detailed Description

template<class I>
class mds::img::CRect< I >

Class template representing a rectangle within an existing image.


Member Typedef Documentation

template<class I >
typedef CImageBase<CRect<I> > mds::img::CRect< I >::tBase

Base class.

template<class I >
typedef I mds::img::CRect< I >::tImage

Image type.

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
typedef I::tPixel mds::img::CRect< I >::tPixel

Pixel type.

Reimplemented from mds::img::CImageBase< CRect< I > >.


Member Enumeration Documentation

anonymous enum [inherited]

Simple tag of "image view" classes.

Enumerator:
CLASS_IMAGE_VIEW 
template<class I >
anonymous enum

Check that I is a image.

You will see name of this enum somewhere in compiler error message if the type I is not image.

Enumerator:
TEMPLATE_PARAMETER_IS_NOT_IMAGE 

Constructor & Destructor Documentation

template<class I >
CRect::CRect ( const tImage &  Image,
tSize  x,
tSize  y,
tSize  XSize,
tSize  YSize 
)

Constructor...

template<class I >
CRect::CRect ( const tImage &  Image,
const CPoint2i &  Pos,
const CSize2i &  Size 
)

Yet another constructor...

template<class I >
CRect::CRect ( const tImage &  Image,
const CRange &  XRange,
const CRange &  YRange 
)

Yet another constructor...

template<class I >
mds::img::CRect< I >::CRect ( const CRect< I > &  Rect)

Copy constructor.


Member Function Documentation

template<class I >
tPixel& mds::img::CRect< I >::at ( tSize  x,
tSize  y 
)

Returns the pixel [x][y].

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
const tPixel& mds::img::CRect< I >::at ( tSize  x,
tSize  y 
) const
template<class I >
tPixel& mds::img::CRect< I >::at ( tSize  i)

Returns the subscripted pixel.

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
const tPixel& mds::img::CRect< I >::at ( tSize  i) const
template<class I >
void CRect::copyFrom ( const tPixel *  pSrc)

Fills the rectangle using a given input buffer.

template<class I >
void CRect::copyTo ( tPixel *  pDst) const

Copies the data to the output buffer.

template<class I >
CRect< I > & CRect::fill ( const tPixel &  c)

Fills the rectangle using a given pixel value.

template<class I >
template<class Function >
Function mds::img::CRect< I >::forEach ( Function  Func)

Calls a function object for every image pixel.

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
template<class Function >
Function mds::img::CRect< I >::forEach ( Function  Func)

Calls a function object for every pixel in the rectangle.

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
template<class Function >
Function mds::img::CRect< I >::forEach ( Function  Func) const

Calls a function object for every image pixel.

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
template<class Function >
Function mds::img::CRect< I >::forEach ( Function  Func) const

Calls a function object for every pixel in the rectangle.

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
tSize mds::img::CRect< I >::getIdx ( tSize  x,
tSize  y 
) const

Calculates index of the pixel [x][y].

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
tImage& mds::img::CRect< I >::getImageRef ( ) const

Returns reference to the original image.

tImage& mds::img::CImageBase< CRect< I > >::getImpl ( ) [inherited]

Returns reference to the image implementation.

const tImage& mds::img::CImageBase< CRect< I > >::getImpl ( ) const [inherited]
template<class I >
tSize mds::img::CRect< I >::getMargin ( ) const

Returns the image margin size in pixels.

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
CPoint2i& mds::img::CRect< I >::getPos ( )

Returns position of the left upper corner.

template<class I >
const CPoint2i& mds::img::CRect< I >::getPos ( ) const
template<class I >
CSize2i& mds::img::CRect< I >::getSize ( )

Returns size of the rectangle.

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
const CSize2i& mds::img::CRect< I >::getSize ( ) const
template<class I >
tSize mds::img::CRect< I >::getXOffset ( ) const

Returns offset between two neigbouring pixels in x-axis.

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
tSize mds::img::CRect< I >::getXSize ( ) const

Returns the image size (dimensions).

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
tSize mds::img::CRect< I >::getYOffset ( ) const

Returns offset between two neigbouring pixels in y-axis.

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
tSize mds::img::CRect< I >::getYSize ( ) const
template<class I >
tSize mds::img::CRect< I >::height ( ) const
template<class I >
tPixel& mds::img::CRect< I >::operator() ( tSize  x,
tSize  y 
)

Returns the subscripted pixel [x][y].

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
const tPixel& mds::img::CRect< I >::operator() ( tSize  x,
tSize  y 
) const
template<class I >
tPixel& mds::img::CRect< I >::operator() ( tSize  i)

Returns the subscripted pixel.

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
const tPixel& mds::img::CRect< I >::operator() ( tSize  i) const
template<class I >
template<class Derived >
CRect<I>& mds::img::CRect< I >::operator*= ( const CImageBase< Derived > &  Image)
template<class I >
template<typename U >
CRect<I>& mds::img::CRect< I >::operator*= ( const U &  c)
template<class I >
template<class Derived >
CRect< I > & mds::img::CRect< I >::operator*= ( const CImageBase< Derived > &  Image)

Pixel wise product.

template<class I >
template<typename U >
CRect< I > & mds::img::CRect< I >::operator*= ( const U &  c)

Multiplies all pixels by scalar.

  • An operator that allows conversion U -> T must be defined!
template<class I >
template<class Derived >
CRect<I>& mds::img::CRect< I >::operator+= ( const CImageBase< Derived > &  Image)
template<class I >
template<typename U >
CRect<I>& mds::img::CRect< I >::operator+= ( const U &  c)
template<class I >
template<class Derived >
CRect< I > & mds::img::CRect< I >::operator+= ( const CImageBase< Derived > &  Image)

Pixel wise addition.

template<class I >
template<typename U >
CRect< I > & mds::img::CRect< I >::operator+= ( const U &  c)

Adds scalar to all pixels.

  • An operator that allows conversion from U to T must be defined!
template<class I >
template<class Derived >
CRect<I>& mds::img::CRect< I >::operator-= ( const CImageBase< Derived > &  Image)
template<class I >
template<typename U >
CRect<I>& mds::img::CRect< I >::operator-= ( const U &  c)
template<class I >
template<class Derived >
CRect< I > & mds::img::CRect< I >::operator-= ( const CImageBase< Derived > &  Image)

Pixel wise subtraction.

template<class I >
template<typename U >
CRect< I > & mds::img::CRect< I >::operator-= ( const U &  c)

Subtracts scalar from all pixels.

  • An operator that allows conversion U -> T must be defined!
template<class I >
template<class Derived >
CRect<I>& mds::img::CRect< I >::operator/= ( const CImageBase< Derived > &  Image)
template<class I >
template<class Derived >
CRect< I > & mds::img::CRect< I >::operator/= ( const CImageBase< Derived > &  Image)

Pixel wise division.

template<class I >
template<typename U >
CRect<I>& mds::img::CRect< I >::operator/= ( const U &  c)
template<class I >
template<typename U >
CRect< I > & mds::img::CRect< I >::operator/= ( const U &  c)

Divides all pixels by scalar.

  • An operator that allows conversion U -> T must be defined!
template<class I >
CRect& mds::img::CRect< I >::operator= ( const CRect< I > &  ) [protected]

Proctected assignment operator.

template<class I >
template<class Function >
Function mds::img::CRect< I >::pforEach ( Function  Func)

Calls a function object for every pixel in the rectangle.

  • Parallel version.

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
template<class Function >
Function mds::img::CRect< I >::pforEach ( Function  Func) const

Calls a function object for every pixel in the rectangle.

  • Parallel version.

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
template<class Function >
Function mds::img::CRect< I >::pforEach ( Function  Func)

Calls a function object for every image pixel.

  • Parallel version.

Reimplemented from mds::img::CImageBase< CRect< I > >.

template<class I >
template<class Function >
Function mds::img::CRect< I >::pforEach ( Function  Func) const

Calls a function object for every image pixel.

  • Parallel version.

Reimplemented from mds::img::CImageBase< CRect< I > >.

tImage& mds::img::CImageBase< CRect< I > >::set ( tSize  x,
tSize  y,
const tPixel &  Value 
) [inherited]

Sets the pixel at the position [x][y][z].

template<class I >
CRect& mds::img::CRect< I >::set ( tSize  x,
tSize  y,
const tPixel &  Value 
)

Sets the pixel at the position [x][y].

tImage& mds::img::CImageBase< CRect< I > >::set ( tSize  i,
const tPixel &  Value 
) [inherited]

Sets the subscripted pixel.

template<class I >
CRect& mds::img::CRect< I >::set ( tSize  i,
const tPixel &  Value 
)

Sets the subsripted pixel.

template<class I >
tSize mds::img::CRect< I >::width ( ) const

Returns the image size (dimensions).

Reimplemented from mds::img::CImageBase< CRect< I > >.


Member Data Documentation

template<class I >
tImage& mds::img::CRect< I >::m_Image [protected]

Reference to the original image.

template<class I >
CPoint2i mds::img::CRect< I >::m_Pos [protected]

Coordinates of the origin.

template<class I >
CSize2i mds::img::CRect< I >::m_Size [protected]

Size of the rectangle.


The documentation for this class was generated from the following files: