OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimDiscreteConvolutionKernel.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts
6 //
7 // Description:
8 //
9 //*******************************************************************
10 // $Id: ossimDiscreteConvolutionKernel.h 17195 2010-04-23 17:32:18Z dburken $
11 #ifndef ossimDiscreteConvolutionKernel_HEADER
12 #define ossimDiscreteConvolutionKernel_HEADER
13 #include <vector>
14 
16 #include <ossim/matrix/newmat.h>
17 #include <ossim/matrix/newmatio.h>
18 
20 {
21 public:
23  long height,
24  bool doWeightedAverage=true);
25  ossimDiscreteConvolutionKernel(const NEWMAT::Matrix& kernel,
26  bool doWeightedAverage=true);
28  static void buildSymmetric(const std::vector<float>& coefficients,
29  NEWMAT::Matrix& result);
30  static void buildSymmetric(float* coefficients, long size,
31  NEWMAT::Matrix& result);
32 
33  virtual void setKernel(const NEWMAT::Matrix& kernel);
34 
39  virtual void convolve(const float* data,
40  double& result,
41  float nullPixel=OSSIM_DEFAULT_NULL_PIX_FLOAT)const;
42 
43  virtual void convolveSubImage(const float* data,
44  long dataWidth,
45  double& result,
46  float nullPixel=OSSIM_DEFAULT_NULL_PIX_FLOAT)const;
47 
52  virtual void convolve(const double* data,
53  double& result,
54  double nullPixel=OSSIM_DEFAULT_NULL_PIX_DOUBLE)const;
55 
56  virtual void convolveSubImage(const double* data,
57  long dataWidth,
58  double& result,
59  double nullPixel=OSSIM_DEFAULT_NULL_PIX_DOUBLE)const;
64  virtual void convolve(const short* data,
65  double& result,
67 
68  virtual void convolveSubImage(const short* data,
69  long dataWidth,
70  double& result,
72 
77  virtual void convolve(const unsigned short* data,
78  double& result,
80 
81  virtual void convolveSubImage(const unsigned short* data,
82  long dataWidth,
83  double& result,
85 
86 
87  virtual void convolve(const unsigned char* data,
88  double& result,
96  virtual void convolveSubImage(const unsigned char* data,
97  long dataWidth,
98  double& result,
113  virtual void buildConvolution(double /* xLocation */,
114  double /* yLocation */)
115  {}
116  virtual long getWidth()const
117  {
118  return theWidth;
119  }
120  virtual long getHeight()const
121  {
122  return theHeight;
123  }
124  const NEWMAT::Matrix& getKernel()const
125  {
126  return *theKernel;
127  }
128 protected:
129  NEWMAT::Matrix *theKernel;
130  long theWidth;
131  long theHeight;
133 };
134 
135 #endif
const NEWMAT::Matrix & getKernel() const
#define OSSIM_DEFAULT_NULL_PIX_UINT16
virtual void setKernel(const NEWMAT::Matrix &kernel)
#define OSSIM_DEFAULT_NULL_PIX_SINT16
unsigned short ossim_uint16
#define OSSIM_DEFAULT_NULL_PIX_DOUBLE
yy_size_t size
signed short ossim_sint16
virtual void convolve(const float *data, double &result, float nullPixel=OSSIM_DEFAULT_NULL_PIX_FLOAT) const
static void buildSymmetric(const std::vector< float > &coefficients, NEWMAT::Matrix &result)
virtual void buildConvolution(double, double)
ossimDiscreteConvolutionKernel(long width, long height, bool doWeightedAverage=true)
#define OSSIM_DEFAULT_NULL_PIX_FLOAT
virtual void convolveSubImage(const float *data, long dataWidth, double &result, float nullPixel=OSSIM_DEFAULT_NULL_PIX_FLOAT) const
unsigned char ossim_uint8
#define OSSIM_DEFAULT_NULL_PIX_UINT8