00001
00019 #ifndef INC_MI32_TREND_H
00020 #define INC_MI32_TREND_H
00021
00022 #ifndef INC_MI32_POLYNOMIAL_H
00023 #include <mi32/polynomial.h>
00024 #endif
00025
00026 #ifndef GENERATING_DOXYGEN_OUTPUT
00027 namespace RVC {
00028 class OBJITEM;
00029 class RASTER;
00030 class NULLMASK;
00031 }
00032 #endif
00033
00034
00036 class TREND2D {
00037 public:
00038
00039 #ifndef GENERATING_DOXYGEN_OUTPUT
00040 class GENERATOR;
00041 #endif
00042
00044 class PARM {
00045 public:
00046
00047 PARM (
00048 ) : m_Order(1), m_BorderCells(0), m_SampleCols(1), m_SampleRows(1), m_PreserveRange(false) { }
00049
00050 void Set (
00051 int Order,
00052 int BorderCells,
00053 int SampleCols,
00054 int SampleRows,
00055 bool PreserveRange
00056 ) { m_Order = Order; m_BorderCells = BorderCells; m_SampleCols = SampleCols; m_SampleRows = SampleRows; m_PreserveRange = PreserveRange; }
00057
00058 private:
00059 #ifndef GENERATING_DOXYGEN_OUTPUT
00060 int m_Order;
00061 int m_BorderCells;
00062 int m_SampleCols;
00063 int m_SampleRows;
00064 bool m_PreserveRange;
00065 friend class TREND2D;
00066 friend class TREND2D::GENERATOR;
00067 #endif
00068 };
00069
00071 TREND2D ();
00072
00074 ~TREND2D ();
00075
00077 double AddTrend (
00078 double x,
00079 double y,
00080 double value
00081 ) const;
00082
00085 ERRVALUE Compute (
00086 const PARM& parm,
00087 RVC::RASTER& ObjRaster,
00088 RVC::RASTER *pObjMask = 0
00089 );
00090
00092 ERRVALUE Compute (
00093 const PARM& parm,
00094 const RVC::OBJITEM& ObjItemRaster,
00095 const RVC::OBJITEM *pObjItemMask = 0
00096 );
00097
00099 double GetGlobalOffset (
00100 ) const { return (m_GlobalOffset); }
00101
00103 double GetGlobalScale (
00104 ) const { return (m_GlobalScale); }
00105
00107 const PARM& GetParm (
00108 ) const { return (m_Parm); }
00109
00111 double GetValue (
00112 double x,
00113 double y
00114 ) const { return (m_Polynomial.Evaluate(x,y)); }
00115
00117 double SubtractTrend (
00118 double x,
00119 double y,
00120 double value
00121 ) const;
00122
00123 private:
00124 #ifndef GENERATING_DOXYGEN_OUTPUT
00125 PARM m_Parm;
00126 POLYNOMIAL_2D m_Polynomial;
00127 double m_GlobalScale;
00128 double m_GlobalOffset;
00129 friend class TREND2D::GENERATOR;
00130 #endif
00131 };
00132
00133
00134 #endif // INC_MI32_TREND_H