File failed to load: https://isis.astrogeology.usgs.gov/dev/Object/assets/jax/output/NativeMML/config.js
Isis Developer Reference
BufferManager.h
Go to the documentation of this file.
1#ifndef BufferManager_h
2#define BufferManager_h
7
8/* SPDX-License-Identifier: CC0-1.0 */
9
10#include "Constants.h"
11#include "PixelType.h"
12#include "Buffer.h"
13
14namespace Isis {
52 class BufferManager : public Isis::Buffer {
53
54 public:
55 // Constructors and Destructors
57 BufferManager(int maxsamps, int maxlines, int maxbands,
58 int bufsamps, int buflines, int bufbands,
59 Isis::PixelType type, bool reverse = false,
60 double scale = 1.0);
61 BufferManager(const BufferManager &other);
62
65
66 // Traversal Methods
67
74 bool operator++(int) {
75 return (next());
76 }
77
78
88 setpos(p_currentMap + i);
89 return *this;
90 }
91
97 bool begin() {
98 return (setpos(0));
99 }
100
107 bool next() {
108 return (setpos(p_currentMap + 1));
109 }
110
116 bool end() const {
117 return (p_currentMap >= p_nmaps);
118 }
119
120 bool setpos(BigInt map);
121
122 void swap(BufferManager &other);
123
125
126 protected:
127
128 // Methods visable to deriving classes
129
135 int MaxSamples() const {
136 return (p_maxSamps);
137 }
138
144 int MaxLines() const {
145 return (p_maxLines);
146 }
147
153 int MaxBands() const {
154 return (p_maxBands);
155 }
156
163 BigInt MaxMaps() const {
164 return (p_nmaps);
165 }
166
167 void SetIncrements(const int sinc, const int linc, const int binc);
168 void SetOffsets(const int soff, const int loff, const int boff);
169
170 private:
171 int p_maxSamps;
172 int p_maxLines;
173 int p_maxBands;
174
175 int p_sinc;
176 int p_linc;
177 int p_binc;
178
179 int p_soff;
180 int p_loff;
181 int p_boff;
182
183 int p_currentSample;
184 int p_currentLine;
185 int p_currentBand;
186
187 BigInt p_nmaps;
188 BigInt p_currentMap;
189
195 bool p_reverse;
196 };
197};
198
199#endif
200
Buffer for reading and writing cube data.
Definition Buffer.h:53
double scale() const
Returns the scale of the shape buffer.
Definition Buffer.h:115
Manages a Buffer over a cube.
Definition BufferManager.h:52
BufferManager & operator=(const BufferManager &rhs)
Creates a new BufferManager with the same values as another.
Definition BufferManager.cpp:107
void swap(BufferManager &other)
Swaps the values of this BufferManager with that of another.
Definition BufferManager.cpp:81
bool begin()
Moves the shape buffer to the first position.
Definition BufferManager.h:97
void SetOffsets(const int soff, const int loff, const int boff)
Sets the offset of the buffer.
Definition BufferManager.cpp:179
int MaxSamples() const
Returns the number of samples in the cube.
Definition BufferManager.h:135
BufferManager()
Definition BufferManager.cpp:17
BufferManager & operator+=(int i)
Moves the shape buffer by a certain amount.
Definition BufferManager.h:87
int MaxLines() const
Returns the number of lines in the cube.
Definition BufferManager.h:144
bool setpos(BigInt map)
Sets the position of the shape in the cube.
Definition BufferManager.cpp:219
int MaxBands() const
Returns the number of bands in the cube.
Definition BufferManager.h:153
~BufferManager()
Destroys the BufferManager object.
Definition BufferManager.h:64
bool end() const
Returns true if the shape buffer has accessed the end of the cube.
Definition BufferManager.h:116
bool next()
Moves the shape buffer to the next position.
Definition BufferManager.h:107
BigInt MaxMaps() const
Returns the maximum number of positions the shape buffer needs to cover the entire image (see setpos ...
Definition BufferManager.h:163
void SetIncrements(const int sinc, const int linc, const int binc)
Sets how the shape is incremented through the cube.
Definition BufferManager.cpp:140
bool operator++(int)
Moves the shape buffer to the next position.
Definition BufferManager.h:74
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
long long int BigInt
Big int.
Definition Constants.h:49
PixelType
Enumerations for Isis Pixel Types.
Definition PixelType.h:29