Isis Developer Reference
Reduce.h
Go to the documentation of this file.
1#ifndef _REDUCE_H_
2#define _REDUCE_H_
8/* SPDX-License-Identifier: CC0-1.0 */
9#include "Buffer.h"
10#include "Cube.h"
11#include "IString.h"
12#include "Portal.h"
13
14#include <cmath>
15
16namespace Isis {
47 class Reduce {
48 public:
50 Reduce(Isis::Cube *pInCube,const double sampleScale, const double lineScale);
51
53 ~Reduce();
54
57
59 void setInputBoundary(int startSample, int endSample,
60 int startLine, int endLine);
61
62 protected:
65 double mdLineScale;
70 mutable double mdLine;
76 mutable int miBandIndex;
78 };
79
80
88 class Nearest : public Isis::Reduce {
89 public:
91 Nearest(Isis::Cube *pInCube, double pdSampleScale, double pdLineScale)
92 :Reduce(pInCube, pdSampleScale, pdLineScale){
93 }
94
96 void operator() (Isis::Buffer & out) const;
97 };
98
99
107 class Average : public Isis::Reduce {
108 public:
110 Average(Isis::Cube *pInCube, double pdSampleScale, double pdLineScale,
111 double pdValidPer, QString psReplaceMode)
112 : Reduce(pInCube, pdSampleScale, pdLineScale){
113 mdValidPer = pdValidPer;
114 msReplaceMode = psReplaceMode;
115 }
116
118 void operator() (Isis::Buffer & out) const;
119
120 private:
121 mutable double mdValidPer;
122 QString msReplaceMode;
123 mutable double *mdIncTab;
124 mutable double *mdSum;
125 mutable double *mdNpts;
126 mutable double *mdSum2;
127 mutable double *mdNpts2;
128 };
129
130}
131
132#endif
Functor for reduce using average functionality.
Definition Reduce.h:107
void operator()(Isis::Buffer &out) const
Operator () overload.
Definition Reduce.cpp:172
Average(Isis::Cube *pInCube, double pdSampleScale, double pdLineScale, double pdValidPer, QString psReplaceMode)
Constructor.
Definition Reduce.h:110
Buffer for reading and writing cube data.
Definition Buffer.h:53
IO Handler for Isis Cubes.
Definition Cube.h:168
Functor for reduce using near functionality.
Definition Reduce.h:88
void operator()(Isis::Buffer &out) const
Operator () overload.
Definition Reduce.cpp:145
Nearest(Isis::Cube *pInCube, double pdSampleScale, double pdLineScale)
Constructor.
Definition Reduce.h:91
Buffer for containing a two dimensional section of an image.
Definition Portal.h:36
Contains multiple PvlContainers.
Definition PvlGroup.h:41
Reduce the pixel dimensions of an image.
Definition Reduce.h:47
double mdSampleScale
Sample scale.
Definition Reduce.h:64
int miInputSamples
Input Samples.
Definition Reduce.h:73
~Reduce()
Destructor.
Definition Reduce.cpp:66
int miEndSample
Input end sample.
Definition Reduce.h:67
int miStartSample
Input start sample.
Definition Reduce.h:66
int miInputLines
Input Lines.
Definition Reduce.h:74
Reduce(Isis::Cube *pInCube, const double sampleScale, const double lineScale)
Constructor.
Definition Reduce.cpp:32
int miStartLine
Input start line.
Definition Reduce.h:68
int miEndLine
Input end line.
Definition Reduce.h:69
double mdLine
Line index.
Definition Reduce.h:70
double mdLineScale
Line scale.
Definition Reduce.h:65
Isis::PvlGroup UpdateOutputLabel(Isis::Cube *pOutCube)
Create label for the reduced output image.
Definition Reduce.cpp:112
int miBandIndex
Band Index.
Definition Reduce.h:76
int miOutputSamples
Output Samples.
Definition Reduce.h:71
int miOutputLines
Output Lines.
Definition Reduce.h:72
void setInputBoundary(int startSample, int endSample, int startLine, int endLine)
Parameters to input image sub area.
Definition Reduce.cpp:87
int miInputBands
Input Bands.
Definition Reduce.h:75
Isis::Cube * mInCube
Input image.
Definition Reduce.h:63
Isis::Portal * m_iPortal
Input portal.
Definition Reduce.h:77
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16