Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

DomainOfAction.hpp

00001 #ifndef __DomainOfAction__
00002 #define __DomainOfAction__
00003 
00004 
00023 #include <stdio.h>
00024 
00025 #include "Psi2DValue.hpp"
00026 #include "AnImage.hpp"
00027 
00029 
00037 enum  StatePsi { Alive=0, Candidate=1, Far=2, Selected=3, Near=4 , Unknown=9 };
00038 
00039 class DomainOfAction
00040 {
00041 private:
00042 
00043 int                     maskFlag;
00044 
00045 int                     nTotalActive;                   // all active points
00046 
00047 int                     width, height;
00048 
00049 Psi2DValue**    psi;                                    
00050 
00051 StatePsi*               plabel;
00052 StatePsi**              label;                                  
00053 
00054 public:
00055         
00056 DomainOfAction(AnImage* im, int amaskFlag=1);
00057 DomainOfAction(int w, int h, int x0, int y0);
00058 DomainOfAction(int w, int h, int x0, int y0, int x1, int y1);
00059 DomainOfAction(int w, int h, int n, int* xMask, int* yMask);
00060 
00061 virtual ~DomainOfAction();
00062 
00063 int                     getAllUsedPoints(){ return nTotalActive; }
00064 int                     getWidth(){ return width; }
00065 int                     getHeight(){ return height; }
00066 
00068 StatePsi        getLabel(int x, int y){ return label[x][y]; }  
00070 void            setLabel(int x, int y, StatePsi alabel){ label[x][y]= alabel; } 
00071 
00072 Psi2DValue*     getPsi(int x, int y){ return psi[x+y*width]; }
00073 void            setPsi(int x, int y, Psi2DValue* apsi){ psi[x+y*width]= apsi; }
00074 
00076 double          getValue(int x, int y)                  
00077                 { 
00078                 if( psi[x+y*width]== 0) return 1e30; 
00079                 return psi[x+y*width]->getRate(); 
00080                 }
00081 
00083 void            setValue(int x, int y, double d){ psi[x+y*width]->setRate(d); } 
00084 
00085 virtual void report(FILE* file){}
00086 };
00087 
00088 #endif
SourceForge.net Logo
Restoreinpaint sourceforge project `C++/Java Image Processing, Restoration, Inpainting Project'.

Bernard De Cuyper: Open Project Leader: Concept, design and development.
Bernard De Cuyper & Eddy Fraiha 2002, 2003. Bernard De Cuyper 2004. Open and free, for friendly usage only.
Modifications on Belgium ground of this piece of artistic work, by governement institutions or companies, must be notified to Bernard De Cuyper.
bern_bdc@hotmail.com