Isis 3 Programmer Reference
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
int MaxBands() const
Returns the number of bands in the cube.
Namespace for the standard library.
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:162
Manages a Buffer over a cube.
Definition: BufferManager.h:68
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:40
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
bool setpos(BigInt map)
Sets the position of the shape in the cube.
Isis exception class.
Definition: IException.h:107
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
IO Handler for Isis Cubes.
Definition: Cube.h:170