00001 #ifndef __CImage__
00002 #define __CImage__
00003
00004
00005
00024 #include <stdio.h>
00025 #include <math.h>
00026 #include <memory.h>
00027
00028
00029 #include "RComplex.hpp"
00030 #include "AnImage.hpp"
00031
00032 #include "AbsLimiter.hpp"
00033
00034 class CImage
00035 {
00036 private:
00037
00038 bool normalisation;
00039 int width;
00040 int height;
00041
00042 int channel;
00043
00044 RComplex* p1;
00045 RComplex** data;
00046
00047 double PI;
00048
00049
00050 public:
00051
00052 CImage( int w, int h );
00053 CImage( int w, int h , const RComplex& value);
00054 CImage( AnImage* source );
00055 CImage( AnImage* source , int achannel );
00056 CImage( AnImage* source, bool normalized );
00057 CImage( CImage& im);
00058
00059 ~CImage(){ delete[] data; delete[] p1; }
00060
00061 CImage* copy();
00062 CImage* scaleDown(int multiplier=2);
00063
00064
00065 RComplex* getData(){return p1;}
00066
00067 void set(CImage& im);
00068 void set(CImage& im, int n, int* xp, int* yp);
00069
00070 bool isNormalized(){ return normalisation; }
00071 inline int getWidth(){ return width; }
00072 inline int getHeight(){ return height; }
00073
00074
00075 inline RComplex get(int x, int y){ return data[x][y]; }
00076 inline void set(int x,int y, double value){ data[x][y]= RComplex(value); }
00077 inline void set(int x,int y, const RComplex& value){ data[x][y]= value; }
00078
00079 RComplex getSafe(int x, int y);
00080 void setSafe(int x,int y, const RComplex& value);
00081
00082
00083
00084
00085 void operator*=( double value );
00086 void operator/=( double value );
00087 void operator+=( double value );
00088 void operator-=( double value );
00089
00090 void operator*=( const RComplex& value );
00091 void operator/=( const RComplex& value );
00092 void operator+=( const RComplex& value );
00093 void operator-=( const RComplex& value );
00094
00095 void operator+=( CImage& image );
00096 void operator-=( CImage& image );
00097
00098 void mult( double rsat );
00099
00100 void convolveHV(int m1, int m2, int m3);
00101
00102 void inverse(double biais=0.0000001);
00103 void root();
00104 void sqr();
00105
00106 RComplex laplacian(int x, int y);
00107 RComplex isometricLaplacian(int x, int y);
00108
00109
00110
00111 RComplex dfX_0(int x, int y);
00112 RComplex dfY_0(int x, int y);
00113
00114 RComplex dfX_0_div2(int x, int y, int idx, int idy);
00115 RComplex dfY_0_div2(int x, int y, int idx, int idy);
00116
00117 RComplex dfX_0_2(int x, int y);
00118 RComplex dfY_0_2(int x, int y);
00119
00120
00121 RComplex dfX_p1(int x, int y);
00122 RComplex dfY_p1(int x, int y);
00123 RComplex dfX_m1(int x, int y);
00124 RComplex dfY_m1(int x, int y);
00125
00126
00127 RComplex dfX2(int x, int y);
00128 RComplex dfY2(int x, int y);
00129 RComplex dfXY(int x, int y);
00130 RComplex dfXYc(int x, int y);
00131
00132 RComplex dfX2_2(int x, int y);
00133 RComplex dfY2_2(int x, int y);
00134 RComplex dfXY_2(int x, int y);
00135
00136
00137
00138 RComplex In(int x, int y);
00139 RComplex In(AbsLimiter* limiter, int x, int y);
00140 RComplex InMinmod(int x, int y);
00141
00142
00143 RComplex Inn(int x, int y);
00144
00145
00146 RComplex Iee(int x, int y);
00147
00148
00149
00150 };
00151
00152 #endif