Isis 3 Developer Reference
Reduce.h
Go to the documentation of this file.
1 #ifndef _REDUCE_H_
2 #define _REDUCE_H_
3 
4 #include "Buffer.h"
5 #include "Cube.h"
6 #include "IString.h"
7 #include "Portal.h"
8 
9 #include <cmath>
10 
11 namespace Isis {
42  class Reduce {
43  public:
45  Reduce(Isis::Cube *pInCube,const double sampleScale, const double lineScale);
46 
48  ~Reduce();
49 
52 
54  void setInputBoundary(int startSample, int endSample,
55  int startLine, int endLine);
56 
57  protected:
59  double mdSampleScale;
60  double mdLineScale;
64  int miEndLine;
65  mutable double mdLine;
71  mutable int miBandIndex;
73  };
74 
75 
83  class Nearest : public Isis::Reduce {
84  public:
86  Nearest(Isis::Cube *pInCube, double pdSampleScale, double pdLineScale)
87  :Reduce(pInCube, pdSampleScale, pdLineScale){
88  }
89 
91  void operator() (Isis::Buffer & out) const;
92  };
93 
94 
102  class Average : public Isis::Reduce {
103  public:
105  Average(Isis::Cube *pInCube, double pdSampleScale, double pdLineScale,
106  double pdValidPer, QString psReplaceMode)
107  : Reduce(pInCube, pdSampleScale, pdLineScale){
108  mdValidPer = pdValidPer;
109  msReplaceMode = psReplaceMode;
110  }
111 
113  void operator() (Isis::Buffer & out) const;
114 
115  private:
116  mutable double mdValidPer;
117  QString msReplaceMode;
118  mutable double *mdIncTab;
119  mutable double *mdSum;
120  mutable double *mdNpts;
121  mutable double *mdSum2;
122  mutable double *mdNpts2;
123  };
124 
125 }
126 
127 #endif
Buffer for reading and writing cube data.
Definition: Buffer.h:69
Average(Isis::Cube *pInCube, double pdSampleScale, double pdLineScale, double pdValidPer, QString psReplaceMode)
Constructor.
Definition: Reduce.h:105
Buffer for containing a two dimensional section of an image.
Definition: Portal.h:52
double mdLine
Line index.
Definition: Reduce.h:65
int miStartLine
Input start line.
Definition: Reduce.h:63
int miInputLines
Input Lines.
Definition: Reduce.h:69
int miInputBands
Input Bands.
Definition: Reduce.h:70
void operator()(Isis::Buffer &out) const
Operator () overload.
Definition: Reduce.cpp:139
~Reduce()
Destructor.
Definition: Reduce.cpp:60
int miStartSample
Input start sample.
Definition: Reduce.h:61
void operator()(Isis::Buffer &out) const
Operator () overload.
Definition: Reduce.cpp:166
int miEndSample
Input end sample.
Definition: Reduce.h:62
int miEndLine
Input end line.
Definition: Reduce.h:64
Isis::Portal * m_iPortal
Input portal.
Definition: Reduce.h:72
Nearest(Isis::Cube *pInCube, double pdSampleScale, double pdLineScale)
Constructor.
Definition: Reduce.h:86
Contains multiple PvlContainers.
Definition: PvlGroup.h:57
Isis::Cube * mInCube
Input image.
Definition: Reduce.h:58
void setInputBoundary(int startSample, int endSample, int startLine, int endLine)
Parameters to input image sub area.
Definition: Reduce.cpp:81
Functor for reduce using near functionality.
Definition: Reduce.h:83
double mdLineScale
Line scale.
Definition: Reduce.h:60
int miInputSamples
Input Samples.
Definition: Reduce.h:68
Isis::PvlGroup UpdateOutputLabel(Isis::Cube *pOutCube)
Create label for the reduced output image.
Definition: Reduce.cpp:106
int miOutputLines
Output Lines.
Definition: Reduce.h:67
int miBandIndex
Band Index.
Definition: Reduce.h:71
int miOutputSamples
Output Samples.
Definition: Reduce.h:66
double mdSampleScale
Sample scale.
Definition: Reduce.h:59
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Reduce the pixel dimensions of an image.
Definition: Reduce.h:42
Reduce(Isis::Cube *pInCube, const double sampleScale, const double lineScale)
Constructor.
Definition: Reduce.cpp:26
Functor for reduce using average functionality.
Definition: Reduce.h:102
IO Handler for Isis Cubes.
Definition: Cube.h:170