50 CubeBsqHandler::CubeBsqHandler(QFile * dataFile,
51 const QList<int> *virtualBandList,
const Pvl &labels,
bool alreadyOnDisk)
52 :
CubeIoHandler(dataFile, virtualBandList, labels, alreadyOnDisk) {
54 int numLinesInChunk = 1;
58 int sizeLimit = 1024 * 1024 * 1024;
59 int maxNumLines = (sizeLimit) / (
SizeOf(
pixelType()) * numSamplesInChunk);
87 PvlContainer::Replace);
97 if(dataFile->seek(startByte)) {
98 QByteArray binaryData = dataFile->read(chunkToFill.
getByteCount());
107 IString msg =
"Reading from the file [" + dataFile->fileName() +
"] " 108 "failed with reading [" +
110 "] bytes at position [" + QString::number(startByte) +
"]";
119 bool success =
false;
122 if(dataFile->seek(startByte)) {
131 IString msg =
"Writing to the file [" + dataFile->fileName() +
"] " 132 "failed with writing [" +
134 "] bytes at position [" + QString::number(startByte) +
"]";
150 int chunkDimensionSize;
152 if (dimensionSize <= maxSize) {
153 chunkDimensionSize = dimensionSize;
157 int greatestDivisor = maxSize;
158 while (dimensionSize % greatestDivisor > 0) {
161 chunkDimensionSize = greatestDivisor;
163 return chunkDimensionSize;
long long int BigInt
Big int.
virtual void readRaw(RawCubeChunk &chunkToFill)
This needs to populate the chunkToFill with unswapped raw bytes from the disk.
void clearCache(bool blockForWriteCache=true) const
Free all cube chunks (cached cube data) from memory and write them to disk.
int getChunkIndex(const RawCubeChunk &) const
Given a chunk, what's its index in the file.
void setRawData(QByteArray rawData)
Sets the chunk's raw data.
void setChunkSizes(int numSamples, int numLines, int numBands)
This should be called once from the child constructor.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
int SizeOf(Isis::PixelType pixelType)
Returns the number of bytes of the specified PixelType.
~CubeBsqHandler()
The destructor writes all cached data to disk.
Namespace for the standard library.
BigInt getDataStartByte() const
void addKeyword(const PvlKeyword &keyword, const InsertMode mode=Append)
Add a keyword to the container.
A type of error that occurred when performing an actual I/O operation.
Handles converting buffers to and from disk.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
void updateLabels(Pvl &labels)
Function to update the labels with a Pvl object.
#define _FILEINFO_
Macro for the filename and line number.
A single keyword-value pair.
A section of raw data on the disk.
virtual void writeRaw(const RawCubeChunk &chunkToWrite)
This needs to write the chunkToWrite directly to disk with no modifications to the data itself...
BigInt getBytesPerChunk() const
Container for cube-like labels.
BigInt getChunkStartByte(const RawCubeChunk &chunk) const
This is a helper method that goes from chunk to file position.
Adds specific functionality to C++ strings.
Namespace for ISIS/Bullet specific routines.
Contains Pvl Groups and Pvl Objects.
QByteArray & getRawData() const
int findGoodSize(int maxSize, int dimensionSize) const
This method attempts to compute a good chunk line size.
PixelType pixelType() const