Isis 3.0 Programmer Reference
Back | Home
BufferManager.h
Go to the documentation of this file.
1 #ifndef BufferManager_h
2 #define BufferManager_h
3 
26 #include "Constants.h"
27 #include "PixelType.h"
28 #include "Buffer.h"
29 
30 namespace Isis {
67  class BufferManager : public Isis::Buffer {
68 
69  public:
70  // Constructors and Destructors
71  BufferManager();
72  BufferManager(int maxsamps, int maxlines, int maxbands,
73  int bufsamps, int buflines, int bufbands,
74  Isis::PixelType type, bool reverse = false);
75  BufferManager(const BufferManager &other);
76 
79 
80  // Traversal Methods
81 
88  bool operator++(int) {
89  return (next());
90  }
91 
92 
93  BufferManager &operator+=(int i) {
94  setpos(p_currentMap + i);
95  return *this;
96  }
97 
103  bool begin() {
104  return (setpos(0));
105  }
106 
113  bool next() {
114  return (setpos(p_currentMap + 1));
115  }
116 
122  bool end() const {
123  return (p_currentMap >= p_nmaps);
124  }
125 
126  bool setpos(BigInt map);
127 
128  void swap(BufferManager &other);
129 
130  BufferManager &operator=(const BufferManager &rhs);
131 
132  protected:
133 
134  // Methods visable to deriving classes
135 
141  int MaxSamples() const {
142  return (p_maxSamps);
143  }
144 
150  int MaxLines() const {
151  return (p_maxLines);
152  }
153 
159  int MaxBands() const {
160  return (p_maxBands);
161  }
162 
169  BigInt MaxMaps() const {
170  return (p_nmaps);
171  }
172 
173  void SetIncrements(const int sinc, const int linc, const int binc);
174  void SetOffsets(const int soff, const int loff, const int boff);
175 
176  private:
180 
181  int p_sinc;
182  int p_linc;
183  int p_binc;
184 
185  int p_soff;
186  int p_loff;
187  int p_boff;
188 
192 
193  BigInt p_nmaps;
194  BigInt p_currentMap;
195 
201  bool p_reverse;
202  };
203 };
204 
205 #endif
206 
Buffer for reading and writing cube data.
Definition: Buffer.h:68
void SetOffsets(const int soff, const int loff, const int boff)
Sets the offset of the buffer.
bool p_reverse
If true the axies are processed in Band, Line, Sample order (e.g., BIL).
int p_loff
Line offset.
int p_sinc
Sample increment.
bool end() const
Returns true if the shape buffer has accessed the end of the cube.
int p_maxLines
Maximum lines to map.
int p_boff
Band offset.
int MaxSamples() const
Returns the number of samples in the cube.
~BufferManager()
Destroys the BufferManager object.
Definition: BufferManager.h:78
int p_binc
Band increment.
int p_maxSamps
Maximum samples to map.
int p_soff
Sample offset.
PixelType
Enumerations for Isis Pixel Types.
Definition: PixelType.h:43
bool begin()
Moves the shape buffer to the first position.
int MaxLines() const
Returns the number of lines in the cube.
BigInt MaxMaps() const
Returns the maximum number of positions the shape buffer needs to cover the entire image (see setpos ...
int p_currentSample
Current sample.
Manages a Buffer over a cube.
Definition: BufferManager.h:67
bool next()
Moves the shape buffer to the next position.
int MaxBands() const
Returns the number of bands in the cube.
bool setpos(BigInt map)
Sets the position of the shape in the cube.
int p_linc
Line increment.
BigInt p_currentMap
Current buffer map position.
bool operator++(int)
Moves the shape buffer to the next position.
Definition: BufferManager.h:88
int p_currentBand
Current band.
void SetIncrements(const int sinc, const int linc, const int binc)
Sets how the shape is incremented through the cube.
int p_maxBands
Maximum bands to map.
int p_currentLine
Current line.
BigInt p_nmaps
Total number of objects to map.

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:58