Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

qgar::GenMask1d< T > Class Template Reference
[Masks]

#include <qgarlib/GenMask1d.H>

Inheritance diagram for qgar::GenMask1d< T >:

qgar::Mask1dGaussD1 List of all members.

Detailed Description

template<class T>
class qgar::GenMask1d< T >

Generic 1D mask with coefficients of type T.

Author:
Gérald Masini
Date:
Apr 18, 2003 17:47
Since:
Qgar 2.1

Definition at line 59 of file GenMask1d.H.

Public Types

Types
typedef T value_type
 Type of the mask coefficients.
typedef value_typereference
 Reference to qgar::GenMask1d::value_type.
typedef const value_typeconst_reference
 Constant reference to qgar::GenMask1d::value_type.
typedef value_typepointer
 Pointer to qgar::GenMask1d::value_type.
typedef const value_typeconst_pointer
 Constant pointer to qgar::GenMask1d::value_type.

Public Member Functions

template<class T>
 GenMask1d (unsigned int aWidth, const T *const pVals)
Constructors
 GenMask1d ()
 Default constructor: Set 0 to mask width, to pointer to the coefficient map, and to reference counter.
 GenMask1d (const GenMask1d< value_type > &aMask)
 Copy constructor.
template<class U>
 GenMask1d (const GenMask1d< U > &aMask)
 Conversion from another mask.
 GenMask1d (unsigned int aWidth, value_type aValue=static_cast< value_type >(0))
 Initialize with given width and value.
 GenMask1d (unsigned int aWidth, const_pointer const pVals)
 Create a mask from an array of values.
Destructor
virtual ~GenMask1d ()
 virtual destructor.
Access to mask characteristics
int width () const
 Get mask width.
Access to coefficient values
value_type coeff (int anIdx) const
 Get a coefficient value.
Access to direct transformations of the coefficient map
pointer pCoeffMap () const
 Get the pointer to the coefficient map.
Transformation
void setCoeff (int anIdx, value_type aCoeff)
 Set coefficient at given index.
Copy
GenMask1d< T > * shallowCopy ()
 Shallow copy: The coefficient map of the source mask is not duplicated.
Operators
GenMask1d< T > & operator= (const GenMask1d< T > &aMask)
 Assignment.

Protected Member Functions

Shallow copy constructor
 GenMask1d (const GenMask1d &rhs, int)
 Disguised copy constructor sharing value array between the passed and the created instance.

Protected Attributes

Representation of a mask
int * _pRefCnt
 Reference counter.
int _width
 Mask width.
pointer _pCoeffMap
 Pointer to the memory space of the mask.

Private Member Functions

Auxiliaries
void deepCopyAux (const GenMask1d< value_type > &aMask)
 Store a deep copy of a given mask into the current mask.


Member Typedef Documentation

template<class T>
typedef const value_type* qgar::GenMask1d< T >::const_pointer
 

Constant pointer to qgar::GenMask1d::value_type.

Definition at line 93 of file GenMask1d.H.

template<class T>
typedef const value_type& qgar::GenMask1d< T >::const_reference
 

Constant reference to qgar::GenMask1d::value_type.

Definition at line 83 of file GenMask1d.H.

template<class T>
typedef value_type* qgar::GenMask1d< T >::pointer
 

Pointer to qgar::GenMask1d::value_type.

Definition at line 88 of file GenMask1d.H.

template<class T>
typedef value_type& qgar::GenMask1d< T >::reference
 

Reference to qgar::GenMask1d::value_type.

Definition at line 78 of file GenMask1d.H.

template<class T>
typedef T qgar::GenMask1d< T >::value_type
 

Type of the mask coefficients.

Definition at line 73 of file GenMask1d.H.


Constructor & Destructor Documentation

template<class T>
qgar::GenMask1d< T >::GenMask1d  ) 
 

Default constructor: Set 0 to mask width, to pointer to the coefficient map, and to reference counter.

Definition at line 56 of file GenMask1d.TCC.

Referenced by qgar::GenMask1d< T >::shallowCopy().

template<class T>
qgar::GenMask1d< T >::GenMask1d const GenMask1d< value_type > &  aMask  ) 
 

Copy constructor.

See also qgar::GenMask1d::operator=, qgar::GenMask1d::deepCopy, and qgar::GenMask1d::shallowCopy.

Warning:
Perform a deep copy: The coefficent map of the source mask is duplicated.

Definition at line 70 of file GenMask1d.TCC.

References qgar::GenMask1d< T >::_pCoeffMap, qgar::GenMask1d< T >::_width, and qgar::GenMask1d< T >::pCoeffMap().

template<class T>
template<class U>
qgar::GenMask1d< T >::GenMask1d const GenMask1d< U > &  aMask  )  [explicit]
 

Conversion from another mask.

See also qgar::GenMask1d::operator=, qgar::GenMask1d::shallowCopy.

Warning:
Perform a deep copy: The coefficent map of the source mask is duplicated.

template<class T>
qgar::GenMask1d< T >::GenMask1d unsigned int  aWidth,
value_type  aValue = static_cast< value_type >(0)
 

Initialize with given width and value.

Parameters:
aWidth mask width
aValue value to fill the mask with (default 0)
All the coefficients are set to the given value.

Definition at line 103 of file GenMask1d.TCC.

References qgar::GenMask1d< T >::_pCoeffMap, qgar::GenMask1d< T >::_width, and qgar::qgFill().

template<class T>
qgar::GenMask1d< T >::GenMask1d unsigned int  aWidth,
const_pointer const   pVals
 

Create a mask from an array of values.

The passed array is duplicated using a raw memcopy.

Parameters:
aWidth The width of the array
pVals A pointer to the values.

template<class T>
qgar::GenMask1d< T >::~GenMask1d  )  [virtual]
 

virtual destructor.

Free space allocated to the coefficient map if and only if the reference counter is null.

Definition at line 150 of file GenMask1d.TCC.

References qgar::GenMask1d< T >::_pCoeffMap, and qgar::GenMask1d< T >::_pRefCnt.

template<class T>
qgar::GenMask1d< T >::GenMask1d const GenMask1d< T > &  rhs,
int 
[protected]
 

Disguised copy constructor sharing value array between the passed and the created instance.

This constructor declares an unused int parameter to avoid ambiguous call between it and the copy constructor. It builds a shallow copy of a mask instance.

Parameters:
rhs A mask instance to create a copy from

Definition at line 131 of file GenMask1d.TCC.

template<class T>
template<class T>
qgar::GenMask1d< T >::GenMask1d unsigned int  aWidth,
const T *const   pVals
 

Definition at line 117 of file GenMask1d.TCC.

References qgar::GenMask1d< T >::_pCoeffMap.


Member Function Documentation

template<class T>
T qgar::GenMask1d< T >::coeff int  anIdx  )  const
 

Get a coefficient value.

Parameters:
anIdx index of the coefficient in the coefficient map

Definition at line 193 of file GenMask1d.TCC.

References qgar::GenMask1d< T >::_pCoeffMap.

template<class T>
void qgar::GenMask1d< T >::deepCopyAux const GenMask1d< value_type > &  aMask  )  [private]
 

Store a deep copy of a given mask into the current mask.

Parameters:
aMask mask to be copied

Definition at line 247 of file GenMask1d.TCC.

References qgar::GenMask1d< T >::_pCoeffMap, qgar::GenMask1d< T >::_pRefCnt, qgar::GenMask1d< T >::_width, and qgar::GenMask1d< T >::pCoeffMap().

Referenced by qgar::GenMask1d< T >::operator=().

template<class T>
GenMask1d< T > & qgar::GenMask1d< T >::operator= const GenMask1d< T > &  aMask  ) 
 

Assignment.

Parameters:
aMask mask to assign
See also qgar::GenMask1d(Genmask1d<t>&), and qgar::GenMask1d::shallowCopy.

Warning:
Perform a deep copy: The coefficient map of the source mask is duplicated. Before the copy is performed, the destination mask is not supposed to have the same size as the destination mask.

Definition at line 274 of file GenMask1d.TCC.

References qgar::GenMask1d< T >::deepCopyAux().

template<class T>
T * qgar::GenMask1d< T >::pCoeffMap  )  const [inline]
 

Get the pointer to the coefficient map.

Definition at line 208 of file GenMask1d.TCC.

References qgar::GenMask1d< T >::_pCoeffMap.

Referenced by qgar::GenMask1d< T >::deepCopyAux(), qgar::GenMask1d< T >::GenMask1d(), qgar::GenConvolImage< T, CheckingPolicy >::xconvol(), and qgar::GenConvolImage< T, CheckingPolicy >::yconvol().

template<class T>
void qgar::GenMask1d< T >::setCoeff int  anIdx,
value_type  aCoeff
 

Set coefficient at given index.

Parameters:
anIdx index in the coefficient map
aCoeff coefficient value

Definition at line 223 of file GenMask1d.TCC.

References qgar::GenMask1d< T >::_pCoeffMap.

template<class T>
GenMask1d< T > * qgar::GenMask1d< T >::shallowCopy  ) 
 

Shallow copy: The coefficient map of the source mask is not duplicated.

See also qgar::GenMask1d(Genmask1d<t>&), qgar::GenMask1d::operator=,

Warning:
Before the copy is performed, the destination mask is not supposed to have the same dimensions as the source mask. When the copy is completed, the pixel map of the destination mask is the same memory space as the pixel map of the source mask.

Definition at line 240 of file GenMask1d.TCC.

References qgar::GenMask1d< T >::GenMask1d().

template<class T>
int qgar::GenMask1d< T >::width  )  const [inline]
 

Get mask width.

Definition at line 178 of file GenMask1d.TCC.

References qgar::GenMask1d< T >::_width.

Referenced by qgar::GenConvolImage< T, CheckingPolicy >::xconvol(), and qgar::GenConvolImage< T, CheckingPolicy >::yconvol().


Member Data Documentation

template<class T>
pointer qgar::GenMask1d< T >::_pCoeffMap [protected]
 

Pointer to the memory space of the mask.

Definition at line 313 of file GenMask1d.H.

Referenced by qgar::GenMask1d< T >::coeff(), qgar::GenMask1d< T >::deepCopyAux(), qgar::GenMask1d< T >::GenMask1d(), qgar::Mask1dGaussD1::Mask1dGaussD1(), qgar::GenMask1d< T >::pCoeffMap(), qgar::GenMask1d< T >::setCoeff(), and qgar::GenMask1d< T >::~GenMask1d().

template<class T>
int* qgar::GenMask1d< T >::_pRefCnt [protected]
 

Reference counter.

Its value represent the number of other masks with which the current mask shares its coefficient map.

Definition at line 303 of file GenMask1d.H.

Referenced by qgar::GenMask1d< T >::deepCopyAux(), and qgar::GenMask1d< T >::~GenMask1d().

template<class T>
int qgar::GenMask1d< T >::_width [protected]
 

Mask width.

Definition at line 308 of file GenMask1d.H.

Referenced by qgar::GenMask1d< T >::deepCopyAux(), qgar::GenMask1d< T >::GenMask1d(), qgar::Mask1dGaussD1::Mask1dGaussD1(), and qgar::GenMask1d< T >::width().


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