Isis 3.0 Programmer Reference
Back | Home
BandManager.cpp
Go to the documentation of this file.
1 
2 
25 #include "BandManager.h"
26 #include "IException.h"
27 
28 using namespace std;
29 namespace Isis {
30 
42  BandManager::BandManager(const Isis::Cube &cube, const bool reverse) :
43  Isis::BufferManager(cube.sampleCount(), cube.lineCount(),
44  cube.bandCount(), 1, 1, cube.bandCount(),
45  cube.pixelType(), reverse) {
46  }
47 
58  bool BandManager::SetBand(const int sample, const int line) {
59  if(sample < 1) {
60  string message = "Invalid value for argument [sample]";
62  }
63 
64  if(line < 1) {
65  string message = "Invalid value for argument [line]";
67  }
68 
69  int map = (line - 1) * MaxBands() + sample - 1;
70  return setpos(map);
71  }
72 
73 } // end namespace isis
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:154
Manages a Buffer over a cube.
Definition: BufferManager.h:67
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:38
bool SetBand(const int sample, const int line=1)
Positions the buffer at the requested line and returns a status indicator if the set was succesful or...
Definition: BandManager.cpp:58
int MaxBands() const
Returns the number of bands in the cube.
bool setpos(BigInt map)
Sets the position of the shape in the cube.
Isis exception class.
Definition: IException.h:99
IO Handler for Isis Cubes.
Definition: Cube.h:158

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:14:36