00001 #ifndef __ARColorImageFilter__ 00002 #define __ARColorImageFilter__ 00003 00004 00005 00024 #include <stdio.h> 00025 00026 #include "AnImage.hpp" 00027 #include "Real3CImage.hpp" 00028 00029 class ARColorImageFilter 00030 { 00031 protected: 00032 00033 double minPixelValue; 00034 double maxPixelValue; 00035 00036 int maskValue; // default 255 [1..255] 00037 00038 int nMask; 00039 int* xm; 00040 int* ym; 00041 00042 protected: 00043 00044 virtual void loadMask(AnImage& mask); 00045 virtual void unloadMask(){ delete[] xm; delete[] ym; nMask=0; minPixelValue=0.0; maxPixelValue=255.0;} 00046 00047 public: 00048 00049 ARColorImageFilter(){maskValue=1;} 00050 virtual ~ARColorImageFilter(){} 00051 00052 virtual void setBoundaries(double minval, double maxval) 00053 {minPixelValue= minval; maxPixelValue= maxval;} 00054 00055 virtual int getMaskValue(){return maskValue;} 00056 virtual void setMaskValue(int value){maskValue= value;} 00057 00058 // single shot filtering 00059 virtual Real3CImage* filter(Real3CImage* src, Real3CImage* dest=0)=0; 00060 00061 virtual Real3CImage* selectedFilter(AnImage* mask, Real3CImage* src, Real3CImage* dest=0) 00062 { 00063 return filter(src, dest); 00064 } 00065 00066 // iterative filter form 00067 virtual Real3CImage* mfilter(int n, Real3CImage* src, Real3CImage* dest=0); 00068 virtual Real3CImage* mSelectedFilter(int n, AnImage* mask, Real3CImage* src, Real3CImage* dest=0); 00069 00070 virtual void report(FILE* file){} 00071 }; 00072 00073 00074 #endif