40 Enlarge::Enlarge(
Cube *pInCube,
const double sampleScale,
41 const double lineScale) {
49 mdEndLine = mInCube->lineCount();
52 mdSampleScale = sampleScale;
53 mdLineScale = lineScale;
55 miOutputSamples = (int)ceil(mInCube->sampleCount() * mdSampleScale);
56 miOutputLines = (int)ceil(mInCube->lineCount() * mdLineScale);
70 bool Enlarge::Xform(
double &inSample,
double &inLine,
71 const double outSample,
const double outLine) {
72 inSample = (outSample - 0.5) / mdSampleScale + 0.5 + (mdStartSample - 1);
73 inLine = (outLine - 0.5) / mdLineScale + 0.5 + (mdStartLine - 1);
89 void Enlarge::SetInputArea(
double pdStartSample,
double pdEndSample,
90 double pdStartLine,
double pdEndLine) {
92 if (pdStartSample > pdEndSample || pdStartLine > pdEndLine) {
93 string sErrMsg =
"Error in Input Area Dimesions";
97 if (pdStartSample >= 1) {
98 mdStartSample = pdStartSample;
100 if (pdEndSample <= mInCube->sampleCount()) {
101 mdEndSample = pdEndSample;
103 if (pdStartLine >= 1) {
104 mdStartLine = pdStartLine;
106 if (pdEndLine <= mInCube->lineCount()) {
107 mdEndLine = pdEndLine;
110 miOutputSamples = (int)ceil((mdEndSample - mdStartSample + 1) * mdSampleScale);
111 miOutputLines = (int)ceil((mdEndLine - mdStartLine + 1) * mdLineScale);
128 int iNumSamples= mInCube->sampleCount();
129 int iNumLines = mInCube->lineCount();
148 subArea.
SetSubArea(mInCube->lineCount(), mInCube->sampleCount(), (int)mdStartLine, (
int)mdStartSample,
149 (int)mdEndLine, (
int)mdEndSample, 1.0 / mdLineScale, 1.0 / mdSampleScale);
150 subArea.
UpdateLabel(mInCube, pOutCube, resultsGrp);
Namespace for the standard library.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
void SetSubArea(const int orignl, const int origns, const int sl, const int ss, const int el, const int es, const double linc, const double sinc)
Defines the subarea.
Contains multiple PvlContainers.
#define _FILEINFO_
Macro for the filename and line number.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
A single keyword-value pair.
Apply corrections to a cube label for subarea extraction.
void UpdateLabel(Cube *icube, Cube *ocube, PvlGroup &results)
Modifies a label for a file containing a subarea.
Namespace for ISIS/Bullet specific routines.
IO Handler for Isis Cubes.