USGS

Isis 3.0 Developer's Reference (API)

Home

RawCubeChunk.h

Go to the documentation of this file.
00001 
00021 #ifndef RawCubeChunk_h
00022 #define RawCubeChunk_h
00023 
00024 class QByteArray;
00025 
00026 namespace Isis {
00027   class Area3D;
00028 
00042   class RawCubeChunk {
00043     public:
00044       RawCubeChunk(const Area3D &placement, int numBytes);
00045       RawCubeChunk(int startSample, int startLine, int startBand,
00046                    int endSample, int endLine, int endBand, int numBytes);
00047       virtual ~RawCubeChunk();
00048       bool isDirty() const;
00049 
00053       QByteArray &getRawData() const {
00054         return *m_rawBuffer;
00055       }
00056 
00057       void setRawData(QByteArray rawData);
00058 
00059       unsigned char getChar(int offset) const;
00060       short getShort(int offset) const;
00061       float getFloat(int offset) const;
00062 
00063       // The following methods are inlined for proven performance gain.
00064 
00068       int getStartSample() const {
00069         return m_startSample;
00070       }
00071 
00075       int getStartLine() const {
00076         return m_startLine;
00077       }
00078 
00082       int getStartBand() const {
00083         return m_startBand;
00084       }
00085 
00089       int getSampleCount() const {
00090         return m_sampleCount;
00091       }
00092 
00096       int getLineCount() const {
00097         return m_lineCount;
00098       }
00099 
00103       int getBandCount() const {
00104         return m_bandCount;
00105       }
00106 
00107       int getByteCount() const;
00108 
00109       void setData(unsigned char value, int offset);
00110       void setData(short value, int offset);
00111       void setData(const float &value, const int &offset);
00112       void setDirty(bool dirty);
00113 
00114     private:
00120       RawCubeChunk(const RawCubeChunk &other);
00121 
00128       RawCubeChunk& operator=(const RawCubeChunk &other);
00129 
00130     private:
00132       bool m_dirty;
00133 
00135       QByteArray *m_rawBuffer;
00137       char *m_rawBufferInternalPtr;
00138 
00140       int m_sampleCount;
00142       int m_lineCount;
00144       int m_bandCount;
00145 
00147       int m_startSample;
00149       int m_startLine;
00151       int m_startBand;
00152   };
00153 }
00154 
00155 #endif
00156