OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimFilterTable.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: MIT
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: Garrett Potts
8 //
9 //----------------------------------------------------------------------------
10 // $Id: ossimFilterTable.h 23353 2015-06-01 19:19:10Z dburken $
11 #ifndef ossimFilterTable_HEADER
12 #define ossimFilterTable_HEADER 1
13 
15 #include <cmath>
16 
17 class ossimFilter;
18 
20 {
21 public:
24 
27 
29  void buildTable(ossim_uint32 filterSteps,
30  const ossimFilter& filter);
31 
33  void buildTable(ossim_uint32 filterSteps,
34  const ossimFilter& xFilter,
35  const ossimFilter& yFilter);
36 
38  ossim_uint32 getWidthByHeight() const;
39 
41  ossim_uint32 getXSupport() const;
42 
44  ossim_uint32 getYSupport() const;
45 
47  ossim_uint32 getWidth() const;
48 
50  ossim_uint32 getHeight() const;
51 
57  const double* getClosestWeights(const double& x, const double& y)const;
58 
59 protected:
60 
65  void allocateWeights();
66 
67  double* theWeights;
74 };
75 
80 inline const double* ossimFilterTable::getClosestWeights(const double& x,
81  const double& y)const
82 {
83  // Extract the decimal part of x and y.
84  double intPartDummy;
85  double decimalPrecisionX = fabs(modf(x, &intPartDummy));
86  double decimalPrecisionY = fabs(modf(y, &intPartDummy));
87 
88  ossim_int32 kernelLine =
89  (ossim_int32)(theFilterSteps*decimalPrecisionY);
90  ossim_int32 kernelSamp =
91  (ossim_int32)(theFilterSteps*decimalPrecisionX);
92 
93  return &theWeights[(kernelLine*theFilterSteps +
94  kernelSamp)*theWidthHeight];
95 }
96 
97 #endif /* End of "#ifndef ossimFilterTable_HEADER" */
ossim_uint32 theYSupport
ossim_uint32 x
ossim_uint32 theWidthHeight
ossim_uint32 theHeight
ossim_uint32 y
ossim_uint32 theWidth
ossim_uint32 theXSupport
const double * getClosestWeights(const double &x, const double &y) const
Inlined below.
unsigned int ossim_uint32
ossim_uint32 theFilterSteps
#define OSSIM_DLL
int ossim_int32