00001 #ifndef __AbsCImageFilter__ 00002 #define __AbsCImageFilter__ 00003 00004 00005 00027 #include <stdio.h> 00028 00029 #include "AnImage.hpp" 00030 #include "CImage.hpp" 00031 00032 #include "AbsLimiter.hpp" 00033 00034 class AbsCImageFilter 00035 { 00036 protected: 00037 00038 int maskValue; // default 255 [1..255] 00039 00040 int nMask; 00041 int* xm; 00042 int* ym; 00043 00044 AbsLimiter* limiter; 00045 00046 protected: 00047 00049 00051 virtual void loadMask(AnImage& mask); 00053 virtual void unloadMask(){ delete[] xm; delete[] ym; nMask=0; } 00054 00055 public: 00056 00057 AbsCImageFilter(){nMask=0; xm=0; ym=0; maskValue=1; limiter=0;} 00058 virtual ~AbsCImageFilter(){} 00059 00060 virtual AbsLimiter* getLimiter(){return limiter;} 00061 virtual void setLimiter(AbsLimiter* alimiter){ limiter= alimiter; } 00062 00063 virtual int getMaskValue(){return maskValue;} 00064 virtual void setMaskValue(int value){maskValue= value;} 00065 00066 virtual void setMask(int n, int* xp, int* yp){ xm=xp; ym=yp; nMask=n; } 00067 00068 virtual void setI0(CImage* Istart){} 00069 00071 virtual void prepare(CImage* src){} 00073 virtual void clear(){} 00074 00076 00080 virtual CImage* filter(CImage* src, CImage* dest=0)=0; 00081 00083 00088 virtual CImage* selectedFilter(AnImage* mask, CImage* src, CImage* dest=0) 00089 { 00090 return filter(src, dest); 00091 } 00092 00094 virtual CImage* mfilter(int n, CImage* src, CImage* dest=0); 00096 virtual CImage* mSelectedFilter(int n, AnImage* mask, CImage* src, CImage* dest=0); 00097 00098 virtual void report(FILE* file){} 00099 }; 00100 00101 00102 #endif