Isis 3 Programmer Reference
RawCubeChunk.h
Go to the documentation of this file.
1 
21 #ifndef RawCubeChunk_h
22 #define RawCubeChunk_h
23 
24 class QByteArray;
25 
26 namespace Isis {
27  class Area3D;
28 
42  class RawCubeChunk {
43  public:
44  RawCubeChunk(const Area3D &placement, int numBytes);
45  RawCubeChunk(int startSample, int startLine, int startBand,
46  int endSample, int endLine, int endBand, int numBytes);
47  virtual ~RawCubeChunk();
48  bool isDirty() const;
49 
53  QByteArray &getRawData() const {
54  return *m_rawBuffer;
55  }
56 
57  void setRawData(QByteArray rawData);
58 
59  unsigned char getChar(int offset) const;
60  short getShort(int offset) const;
61  float getFloat(int offset) const;
62 
63  // The following methods are inlined for proven performance gain.
64 
68  int getStartSample() const {
69  return m_startSample;
70  }
71 
75  int getStartLine() const {
76  return m_startLine;
77  }
78 
82  int getStartBand() const {
83  return m_startBand;
84  }
85 
89  int sampleCount() const {
90  return m_sampleCount;
91  }
92 
96  int lineCount() const {
97  return m_lineCount;
98  }
99 
103  int bandCount() const {
104  return m_bandCount;
105  }
106 
107  int getByteCount() const;
108 
109  void setData(unsigned char value, int offset);
110  void setData(short value, int offset);
111  void setData(const float &value, const int &offset);
112  void setDirty(bool dirty);
113 
114  private:
120  RawCubeChunk(const RawCubeChunk &other);
121 
128  RawCubeChunk& operator=(const RawCubeChunk &other);
129 
130  private:
132  bool m_dirty;
133 
135  QByteArray *m_rawBuffer;
138 
145 
152  };
153 }
154 
155 #endif
156 
int getStartLine() const
Definition: RawCubeChunk.h:75
void setRawData(QByteArray rawData)
Sets the chunk's raw data.
float getFloat(int offset) const
char * m_rawBufferInternalPtr
This is the internal pointer to the raw buffer for performance.
Definition: RawCubeChunk.h:137
int bandCount() const
Definition: RawCubeChunk.h:103
Represents a 3D area (a 3D "cube")
Definition: Area3D.h:41
int m_bandCount
The number of bands in the cube chunk.
Definition: RawCubeChunk.h:144
QByteArray * m_rawBuffer
This is the raw data to be put on disk.
Definition: RawCubeChunk.h:135
int lineCount() const
Definition: RawCubeChunk.h:96
int m_sampleCount
The number of samples in the cube chunk.
Definition: RawCubeChunk.h:140
RawCubeChunk(const Area3D &placement, int numBytes)
This constructor creates a new cube chunk based on the provided placement and data size...
int getStartSample() const
Definition: RawCubeChunk.h:68
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...
void setData(unsigned char value, int offset)
Sets the char at the given offset in the raw data buffer of this chunk.
RawCubeChunk & operator=(const RawCubeChunk &other)
The assignment operator is disabled.
virtual ~RawCubeChunk()
The destructor.
int getStartBand() const
Definition: RawCubeChunk.h:82
int m_lineCount
The number of lines in the cube chunk.
Definition: RawCubeChunk.h:142
int m_startSample
The one-based (inclusive) start sample of the cube chunk.
Definition: RawCubeChunk.h:147
A section of raw data on the disk.
Definition: RawCubeChunk.h:42
int sampleCount() const
Definition: RawCubeChunk.h:89
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 ...
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
bool isDirty() const
int getByteCount() const
int m_startBand
The one-based (inclusive) start band of the cube chunk.
Definition: RawCubeChunk.h:151
QByteArray & getRawData() const
Definition: RawCubeChunk.h:53
short getShort(int offset) const
int m_startLine
The one-based (inclusive) start line of the cube chunk.
Definition: RawCubeChunk.h:149
bool m_dirty
True if the data does not match what is on disk.
Definition: RawCubeChunk.h:132