Isis Developer Reference
RawCubeChunk.h
Go to the documentation of this file.
1 #ifndef RawCubeChunk_h
2 #define RawCubeChunk_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 
10 class QByteArray;
11 namespace Isis {
12  class Area3D;
13 
27  class RawCubeChunk {
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:
105  RawCubeChunk(const RawCubeChunk &other);
106 
113  RawCubeChunk& operator=(const RawCubeChunk &other);
114 
115  private:
117  bool m_dirty;
118 
120  QByteArray *m_rawBuffer;
122  char *m_rawBufferInternalPtr;
123 
125  int m_sampleCount;
127  int m_lineCount;
129  int m_bandCount;
130 
132  int m_startSample;
134  int m_startLine;
136  int m_startBand;
137  };
138 }
139 
140 #endif
141 
Isis::RawCubeChunk::setDirty
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...
Definition: RawCubeChunk.cpp:213
Isis::RawCubeChunk
A section of raw data on the disk.
Definition: RawCubeChunk.h:27
Isis::RawCubeChunk::getStartBand
int getStartBand() const
Definition: RawCubeChunk.h:67
Displacement.h
Isis::RawCubeChunk::getStartLine
int getStartLine() const
Definition: RawCubeChunk.h:60
Isis::RawCubeChunk::getFloat
float getFloat(int offset) const
Definition: RawCubeChunk.cpp:145
Isis::RawCubeChunk::sampleCount
int sampleCount() const
Definition: RawCubeChunk.h:74
Isis::RawCubeChunk::isDirty
bool isDirty() const
Definition: RawCubeChunk.cpp:90
Isis::RawCubeChunk::bandCount
int bandCount() const
Definition: RawCubeChunk.h:88
Isis::RawCubeChunk::RawCubeChunk
RawCubeChunk(const Area3D &placement, int numBytes)
This constructor creates a new cube chunk based on the provided placement and data size.
Definition: RawCubeChunk.cpp:29
Isis::Area3D::getDepth
Distance getDepth() const
Returns the depth (in the Z dimension) of the 3D area.
Definition: Area3D.cpp:184
Isis::RawCubeChunk::getRawData
QByteArray & getRawData() const
Definition: RawCubeChunk.h:38
RawCubeChunk.h
Isis::RawCubeChunk::getShort
short getShort(int offset) const
Definition: RawCubeChunk.cpp:133
IString.h
Isis::Area3D::getStartX
Displacement getStartX() const
Returns the leftmost X position of the 3D area.
Definition: Area3D.cpp:115
Isis::RawCubeChunk::lineCount
int lineCount() const
Definition: RawCubeChunk.h:81
Isis::RawCubeChunk::getByteCount
int getByteCount() const
Definition: RawCubeChunk.cpp:154
Isis::RawCubeChunk::~RawCubeChunk
virtual ~RawCubeChunk()
The destructor.
Definition: RawCubeChunk.cpp:78
Isis::Area3D::getStartZ
Displacement getStartZ() const
Returns the frontmost Z position of the 3D area.
Definition: Area3D.cpp:145
Isis::Area3D::getWidth
Distance getWidth() const
Returns the width (in the X dimension) of the 3D area.
Definition: Area3D.cpp:160
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::RawCubeChunk::setData
void setData(unsigned char value, int offset)
Sets the char at the given offset in the raw data buffer of this chunk.
Definition: RawCubeChunk.cpp:169
Area3D.h
Isis::Displacement::pixels
double pixels(double pixelsPerMeter=1.0) const
Get the displacement in pixels using the given conversion ratio.
Definition: Displacement.cpp:117
Isis::IException
Isis exception class.
Definition: IException.h:91
ASSERT
#define ASSERT(x)
Definition: IsisDebug.h:134
Isis::RawCubeChunk::setRawData
void setRawData(QByteArray rawData)
Sets the chunk's raw data.
Definition: RawCubeChunk.cpp:101
Isis::RawCubeChunk::getStartSample
int getStartSample() const
Definition: RawCubeChunk.h:53
Isis::Area3D::getHeight
Distance getHeight() const
Returns the height (in the Y dimension) of the 3D area.
Definition: Area3D.cpp:172
round
#define round(x)
This is free and unencumbered software released into the public domain.
Definition: ViewportBuffer.cpp:29
Isis::RawCubeChunk::getChar
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 ...
Definition: RawCubeChunk.cpp:121
IException.h
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::Area3D
Represents a 3D area (a 3D "cube")
Definition: Area3D.h:29
Isis::IString
Adds specific functionality to C++ strings.
Definition: IString.h:165
Distance.h
IsisDebug.h
Isis::Distance::pixels
double pixels(double pixelsPerMeter=1.0) const
Get the distance in pixels using the given conversion ratio.
Definition: Distance.cpp:131
Isis::Area3D::getStartY
Displacement getStartY() const
Returns the topmost Y position of the 3D area.
Definition: Area3D.cpp:130
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16