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

MDomainOfAction.hpp

00001 #ifndef __MDomainOfAction__
00002 #define __MDomainOfAction__
00003 
00004 
00023 #include <stdio.h>
00024 
00025 #include "MPsi2DValue.hpp"
00026 #include "AnImage.hpp"
00027 
00028 #include "DomainOfAction.hpp"                   // defines StatePsi
00029 
00030 class MDomainOfAction
00031 {
00032 private:
00033 
00034 int                     maskFlag;
00035 
00036 int                     nTotalActive;                   // all active points
00037 
00038 int                     width, height;
00039 
00040 MPsi2DValue**   psi;                                    
00041 
00042 StatePsi*               plabel;
00043 StatePsi**              label;                                  
00044 
00045 
00046 public:
00047         
00048 // General case
00049 MDomainOfAction(AnImage* im, int maskFlag=1);
00050 
00051 // bipartite
00052 MDomainOfAction(int w, int h, double v0, int x0, int y0, double v1, int x1, int y1);            // 2 fronts
00053 MDomainOfAction(int w, int h, int n0, double v0, int* xMask0, int* yMask0, 
00054                                         int n1, double v1, int* xMask1, int* yMask1);
00055 
00056 // multi fronts Alive front only
00057 MDomainOfAction(int w, int h, int n, int* frontNumber, double* v, int* xMask, int* yMask);
00058 
00059 virtual ~MDomainOfAction();
00060 
00061 int             getAllUsedPoints(){ return nTotalActive; }
00062 int             getWidth(){ return width; }
00063 int             getHeight(){ return height; }
00064 
00066 StatePsi        getLabel(int x, int y){ return label[x][y]; }  
00068 void            setLabel(int x, int y, StatePsi alabel){ label[x][y]= alabel; } 
00069 
00070 MPsi2DValue*    getPsi(int x, int y){ return psi[x+y*width]; }
00071 void            setPsi(int x, int y, MPsi2DValue* apsi){ psi[x+y*width]= apsi; }
00072 
00074 double  getValue(int x, int y)                  
00075                 { 
00076                 if( psi[x+y*width]== 0) return 1e30; 
00077                 return psi[x+y*width]->getRate(); 
00078                 }
00079 
00081 void            setValue(int x, int y, double d){ psi[x+y*width]->setRate(d); } 
00082 
00084 int             getFront(int x, int y)                  
00085                 { 
00086                 if( psi[x+y*width]== 0) return -1; 
00087                 return psi[x+y*width]->getFront(); 
00088                 }
00089 
00091 void            setFront(int x, int y, int front){ psi[x+y*width]->setFront(front); } 
00092 
00093 virtual void report(FILE* file){}
00094 };
00095 
00096 
00097 
00098 #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