Main Page   Class Overview   Pixels   Images   Geometry   Quick Index  

HxImgFtorSet Class Template Reference

Instantiation of generic algorithm for set operations on images. More...

#include <HxImgFtorSet.h>

Inheritance diagram for HxImgFtorSet::

HxImgFtorI2Cast HxImgFtorI2 HxImgFunctor List of all members.

Public Types

typedef HxImgFtorSetKey KeyType
 The key type of this class. More...


Public Methods

 HxImgFtorSet ()
 Constructor. More...

virtual ~HxImgFtorSet ()
 Destructor. More...


Protected Methods

virtual void doIt (DstDataPtrType dstPtr, SrcDataPtrType srcPtr, HxSizes srcSize, HxSizes dstSize, HxTagList &tags, HxImgFtorDescription *=0)
 The actual operation. More...


Detailed Description

template<class DstImgSigT, class SrcImgSigT>
class HxImgFtorSet< DstImgSigT, SrcImgSigT >

Instantiation of generic algorithm for set operations on images.


Member Typedef Documentation

template<class DstImgSigT, class SrcImgSigT>
typedef HxImgFtorSetKey HxImgFtorSet::KeyType
 

The key type of this class.

Reimplemented from HxImgFtorI2Cast.


Constructor & Destructor Documentation

template<class DstImgSigT, class SrcImgSigT>
HxImgFtorSet< DstImgSigT, SrcImgSigT >::HxImgFtorSet   [inline]
 

Constructor.

00021     : HxImgFtorI2Cast<DstImgSigT, SrcImgSigT>(
00022         HxImgFtorSetKey(HxClassName<DstImgSigT>(), HxClassName<SrcImgSigT>()))
00023 {
00024 }

template<class DstImgSigT, class SrcImgSigT>
HxImgFtorSet< DstImgSigT, SrcImgSigT >::~HxImgFtorSet   [virtual]
 

Destructor.

00028 {
00029 }


Member Function Documentation

template<class DstImgSigT, class SrcImgSigT>
void HxImgFtorSet< DstImgSigT, SrcImgSigT >::doIt DstDataPtrType    dstPtr,
SrcDataPtrType    srcPtr,
HxSizes    dstSize,
HxSizes    srcSize,
HxTagList   tags,
HxImgFtorDescription   description = 0
[protected, virtual]
 

The actual operation.

Reimplemented from HxImgFtorI2Cast.

00068 {
00069     HxPointInt srcBegin, dstBegin, srcEnd, dstEnd;
00070 
00071 
00072     srcBegin = HxGetTag(tags, "srcBegin", HxPointInt(0, 0, 0));
00073     srcEnd = HxGetTag(tags, "srcEnd", HxPointInt(srcSize - HxSizes(1, 1, 1)));
00074     dstBegin = HxGetTag(tags, "dstBegin", HxPointInt(0, 0, 0));
00075     dstEnd = dstSize - HxSizes(1, 1, 1);
00076 
00077 
00078     if ((srcBegin.inf(HxPointInt(0, 0, 0)) != HxPointInt(0, 0, 0))
00079             || (srcBegin.sup(srcEnd) != srcEnd))
00080     {
00081         HxEnvironment::instance()->errorStream()
00082             << "Extended set: source begin out of range" << STD_ENDL;
00083         return;
00084     }
00085 
00086     if ((dstBegin.inf(HxPointInt(0, 0, 0)) != HxPointInt(0, 0, 0))
00087             || (dstBegin.sup(dstEnd) != dstEnd))
00088     {
00089         HxEnvironment::instance()->errorStream()
00090             << "Extended set: destination begin out of range" << STD_ENDL;
00091         return;
00092     }
00093 
00094     if ((srcEnd.inf(srcBegin) != srcBegin)
00095             || (srcEnd.sup(srcSize - HxSizes(1, 1, 1))
00096                 != (srcSize - HxSizes(1, 1, 1))))
00097     {
00098         HxEnvironment::instance()->errorStream()
00099             << "Extended set: source end out of range" << STD_ENDL;
00100         return;
00101     }
00102 
00103     HxSizes regionSize = HxSizes(srcEnd - srcBegin) + HxSizes(1, 1, 1);
00104     regionSize = regionSize.inf(dstSize - HxSizes(dstBegin));
00105 
00106     srcPtr.incXYZ(srcBegin.x(), srcBegin.y(), srcBegin.z());
00107     dstPtr.incXYZ(dstBegin.x(), dstBegin.y(), dstBegin.z());
00108 
00109     int y, z;
00110 
00111     int lineSize = regionSize.x();
00112 
00113     for (z = 0; z < regionSize.z(); z++)
00114         for (y = 0; y < regionSize.y(); y++)
00115         {
00116             SrcDataPtrType sPtr(srcPtr);
00117             DstDataPtrType dPtr(dstPtr);
00118             sPtr.incXYZ(0, y, z);
00119             dPtr.incXYZ(0, y, z);
00120             HxFuncSet(dPtr, sPtr, lineSize);
00121         }
00122 
00123 }


The documentation for this class was generated from the following files:
Generated on Tue Jan 8 13:59:30 2002 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001