Isis 3 Programmer Reference
RawCubeChunk.h
1#ifndef RawCubeChunk_h
2#define RawCubeChunk_h
8/* SPDX-License-Identifier: CC0-1.0 */
9
10class QByteArray;
11namespace Isis {
12 class Area3D;
13
28 public:
29 RawCubeChunk(const Area3D &placement, int numBytes);
30 RawCubeChunk(int startSample, int startLine, int startBand,
31 int endSample, int endLine, int endBand, int numBytes);
32 virtual ~RawCubeChunk();
33 bool isDirty() const;
34
38 QByteArray &getRawData() const {
39 return *m_rawBuffer;
40 }
41
42 void setRawData(QByteArray rawData);
43
44 unsigned char getChar(int offset) const;
45 short getShort(int offset) const;
46 float getFloat(int offset) const;
47
48 // The following methods are inlined for proven performance gain.
49
53 int getStartSample() const {
54 return m_startSample;
55 }
56
60 int getStartLine() const {
61 return m_startLine;
62 }
63
67 int getStartBand() const {
68 return m_startBand;
69 }
70
74 int sampleCount() const {
75 return m_sampleCount;
76 }
77
81 int lineCount() const {
82 return m_lineCount;
83 }
84
88 int bandCount() const {
89 return m_bandCount;
90 }
91
92 int getByteCount() const;
93
94 void setData(unsigned char value, int offset);
95 void setData(short value, int offset);
96 void setData(const float &value, const int &offset);
97 void setDirty(bool dirty);
98
99 private:
106
114
115 private:
118
120 QByteArray *m_rawBuffer;
123
130
137 };
138}
139
140#endif
141
Represents a 3D area (a 3D "cube")
Definition Area3D.h:29
A section of raw data on the disk.
int sampleCount() const
QByteArray & getRawData() const
RawCubeChunk(const RawCubeChunk &other)
The copy constructor is disabled.
int m_lineCount
The number of lines in the cube chunk.
short getShort(int offset) const
int getByteCount() const
QByteArray * m_rawBuffer
This is the raw data to be put on disk.
int m_startBand
The one-based (inclusive) start band of the cube chunk.
bool m_dirty
True if the data does not match what is on disk.
void setData(unsigned char value, int offset)
Sets the char at the given offset in the raw data buffer of this chunk.
int getStartSample() const
void setDirty(bool dirty)
Sets the chunk's dirty flag, indicating whether or not the chunk's data matches the data that is on d...
int bandCount() const
int m_startLine
The one-based (inclusive) start line of the cube chunk.
char * m_rawBufferInternalPtr
This is the internal pointer to the raw buffer for performance.
int m_bandCount
The number of bands in the cube chunk.
void setRawData(QByteArray rawData)
Sets the chunk's raw data.
int getStartBand() const
RawCubeChunk(const Area3D &placement, int numBytes)
This constructor creates a new cube chunk based on the provided placement and data size.
RawCubeChunk & operator=(const RawCubeChunk &other)
The assignment operator is disabled.
int getStartLine() const
int m_startSample
The one-based (inclusive) start sample of the cube chunk.
int m_sampleCount
The number of samples in the cube chunk.
float getFloat(int offset) const
bool isDirty() const
unsigned char getChar(int offset) const
This method is currently not in use due to a faster way of getting data from the buffer (through the ...
int lineCount() const
virtual ~RawCubeChunk()
The destructor.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16