00001 #ifndef __AbsFImageFilter__ 00002 #define __AbsFImageFilter__ 00003 00004 00005 00027 #include <stdio.h> 00028 00029 #include "AnImage.hpp" 00030 #include "FImage.hpp" 00031 00032 class AbsFImageFilter 00033 { 00034 protected: 00035 00036 float minPixelValue; 00037 float maxPixelValue; 00038 00039 int maskValue; // default 255 [1..255] 00040 00041 int nMask; 00042 int* xm; 00043 int* ym; 00044 00045 protected: 00046 00048 00050 virtual void loadMask(AnImage& mask); 00052 virtual void unloadMask(){ delete[] xm; delete[] ym; nMask=0; } 00053 00054 public: 00055 00056 AbsFImageFilter(){nMask=0; xm=0; ym=0; maskValue=1; minPixelValue=0.0; maxPixelValue=255.0; } 00057 virtual ~AbsFImageFilter(){} 00058 00059 virtual void setBoundaries(float minval, float maxval) 00060 {minPixelValue= minval; maxPixelValue= maxval;} 00061 00062 virtual int getMaskValue(){return maskValue;} 00063 virtual void setMaskValue(int value){maskValue= value;} 00064 00065 virtual void setMask(int n, int* xp, int* yp){ xm=xp; ym=yp; nMask=n; } 00066 00067 virtual void setI0(FImage* Istart){} 00068 00070 virtual void prepare(FImage* src){} 00072 virtual void clear(){} 00073 00075 00079 virtual FImage* filter(FImage* src, FImage* dest=0)=0; 00080 00082 00087 virtual FImage* selectedFilter(AnImage* mask, FImage* src, FImage* dest=0) 00088 { 00089 return filter(src, dest); 00090 } 00091 00093 virtual FImage* mfilter(int n, FImage* src, FImage* dest=0); 00095 virtual FImage* mSelectedFilter(int n, AnImage* mask, FImage* src, FImage* dest=0); 00096 00097 virtual void report(FILE* file){} 00098 }; 00099 00100 00101 #endif