00001 #ifndef __RRedBlackWvltOp__ 00002 #define __RRedBlackWvltOp__ 00003 00004 00005 00039 #include <stdio.h> 00040 00041 #include "AbsRImageFilter.hpp" 00042 00043 00044 class RRedBlackWvltOp : public AbsRImageFilter 00045 { 00046 protected: 00047 00048 bool denoisingFlag; 00049 bool hardThreshold; 00050 double threshold; 00051 00052 bool forwardOnly; 00053 int userStages; 00054 00055 int nstages; 00056 00057 int w, h; 00058 int wS, hS; // w, h with 2**n 00059 00060 int wCurrent, hCurrent; 00061 00062 int currentStage; 00063 00064 RImage* I; 00065 RImage* IOrder; 00066 00067 protected: 00068 00069 virtual double hvPrediction(int stage, int i, int j); 00070 virtual double hvUpdate(int stage, int i, int j); 00071 virtual double dPrediction(int stage, int i, int j); 00072 virtual double dUpdate(int stage, int i, int j); 00073 00074 virtual void hvPredictionStep(int stage, bool forwardFlag=true); 00075 virtual void hvUpdateStep(int stage, bool forwardFlag=true); 00076 virtual void dPredictionStep(int stage, bool forwardFlag=true); 00077 virtual void dUpdateStep(int stage, bool forwardFlag=true); 00078 00079 virtual void init(RImage* src); 00080 virtual void clear(); 00081 virtual void fwdStage(int stage); // two step lifting 00082 virtual void bwdStage(int stage); // inverse 00083 00084 virtual void reorder(int stage, bool forwardFlag=true); 00085 00086 public: 00087 00088 RRedBlackWvltOp(int steps, bool forwardTr=false) 00089 {userStages= steps; I=0; IOrder=0; forwardOnly= forwardTr; denoisingFlag=false; } 00090 RRedBlackWvltOp(int steps, bool forwardTr, bool ahardThreshold, double athreshold) 00091 {userStages= steps; I=0; IOrder=0; forwardOnly= forwardTr; denoisingFlag=true; 00092 hardThreshold= ahardThreshold; threshold= athreshold; } 00093 virtual ~RRedBlackWvltOp(){} 00094 00095 virtual void fwdTransform(int maxstage=0); 00096 virtual void bwdTransform(int maxstage=0); 00097 00098 virtual RImage* filter(RImage* src, RImage* dest=0); 00099 00100 virtual void report(FILE* file){} 00101 }; 00102 00103 00104 #endif