00001 #ifndef __FGradientNormOp__ 00002 #define __FGradientNormOp__ 00003 00004 00005 00026 #include <stdio.h> 00027 00028 #include "AbsFImageFilter.hpp" 00029 00030 00031 00032 class FGradientNormOp : public AbsFImageFilter 00033 { 00034 protected: 00035 00036 int w1,h1; 00037 FImage* reference; 00038 00039 public: 00040 00041 FGradientNormOp(){reference=0; w1=h1=0;} 00042 virtual ~FGradientNormOp(){reference=0;} 00043 00044 // point based computations 00045 // ------------------------ 00046 virtual void setReference(FImage* im) 00047 { reference= im; w1=reference->getWidth()-1; h1= reference->getHeight()-1;} 00048 00049 virtual float get(int x, int y); // if no side effects 00050 // borders 00051 virtual float getN(int x); 00052 virtual float getE(int y); 00053 virtual float getS(int x); 00054 virtual float getW(int y); 00055 // corners 00056 virtual float getNW(); 00057 virtual float getNE(); 00058 virtual float getSE(); 00059 virtual float getSW(); 00060 00061 // single shot filtering 00062 virtual FImage* filter(FImage* src, FImage* dest=0); 00063 virtual FImage* selectedFilter(AnImage* mask, FImage* src, FImage* dest=0) 00064 { return filter(src, dest); } 00065 00066 virtual void report(FILE* file){ fprintf(file,"Central Gradient Norm\n"); } 00067 }; 00068 00069 00070 #endif