USGS

Isis 3.0 Object Programmers' Reference

Home

SampleManager.cpp
Go to the documentation of this file.
1 
24 #include "SampleManager.h"
25 
26 #include "IException.h"
27 #include "IString.h"
28 
29 using namespace std;
30 namespace Isis {
31 
44  SampleManager::SampleManager(const Isis::Cube &cube, const bool reverse) :
45  Isis::BufferManager(cube.sampleCount(), cube.lineCount(),
46  cube.bandCount(), 1, cube.lineCount(), 1,
47  cube.pixelType(), reverse) {
48  }
49 
60  bool SampleManager::SetSample(const int sample, const int band) {
61  if(sample < 1) {
62  string message = "Invalid value for argument [sample]";
64  }
65 
66  if(band < 1) {
67  string message = "Invalid value for argument [band]";
69  }
70 
71  int map = (band - 1) * MaxSamples() + sample - 1;
72  return setpos(map);
73  }
74 
75 } // end namespace isis