22template <
typename A>
class QList;
23template <
typename A,
typename B>
class QMap;
24template <
typename A,
typename B>
struct QPair;
28 class CubeCachingAlgorithm;
113 const Pvl &label,
bool alreadyOnDisk);
116 virtual void read(
Buffer &bufferToFill)
const;
120 virtual void clearCache(
bool blockForWriteCache =
true)
const;
146 void setChunkSizes(
int numSamples,
int numLines,
int numBands);
184 class BufferToChunkWriter :
public QRunnable {
188 ~BufferToChunkWriter();
197 BufferToChunkWriter(
const BufferToChunkWriter & other);
203 BufferToChunkWriter & operator=(
const BufferToChunkWriter & rhs);
211 QElapsedTimer *m_timer;
231 void blockUntilThreadPoolEmpty()
const;
233 static bool bufferLessThan(
Buffer *
const &lhs,
Buffer *
const &rhs);
236 int startLine,
int numLines,
237 int startBand,
int numBands)
const;
240 const Buffer &cube2,
int &startX,
int &startY,
int &startZ,
241 int &endX,
int &endY,
int &endZ)
const;
243 void flushWriteCache(
bool force =
false)
const;
247 RawCubeChunk *getChunk(
int chunkIndex,
bool allocateIfNecessary)
const;
249 int getChunkCount()
const;
251 void getChunkPlacement(
int chunkIndex,
252 int &startSample,
int &startLine,
int &startBand,
253 int &endSample,
int &endLine,
int &endBand)
const;
258 const Buffer &justRequested)
const;
260 void synchronousWrite(
const Buffer &bufferToWrite);
262 void writeIntoDouble(
const RawCubeChunk &chunk,
Buffer &output,
int startIndex)
const;
266 void writeNullDataToDisk()
const;
314 int m_samplesInChunk;
329 mutable QByteArray *m_nullChunkData;
339 mutable QThreadPool *m_ioThreadPool;
345 mutable bool m_lastOperationWasWrite;
350 bool m_useOptimizedCubeWrite;
353 mutable volatile int m_idealFlushSize;
356 mutable int m_consecutiveOverflowCount;
Buffer for reading and writing cube data.
Definition Buffer.h:53
This is the parent of the caching algorithms.
Definition CubeCachingAlgorithm.h:31
Handles converting buffers to and from disk.
Definition CubeIoHandler.h:110
virtual void clearCache(bool blockForWriteCache=true) const
Free all cube chunks (cached cube data) from memory and write them to disk.
Definition CubeIoHandler.cpp:370
int bandCount() const
Definition CubeIoHandler.cpp:422
virtual ~CubeIoHandler()
Cleans up all allocated memory.
Definition CubeIoHandler.cpp:152
virtual void addCachingAlgorithm(CubeCachingAlgorithm *algorithm)
This will add the given caching algorithm to the list of attempted caching algorithms.
Definition CubeIoHandler.cpp:355
PixelType pixelType() const
Definition CubeIoHandler.cpp:540
QFile * getDataFile()
Definition CubeIoHandler.cpp:515
int getChunkCountInLineDimension() const
Definition CubeIoHandler.cpp:461
void setChunkSizes(int numSamples, int numLines, int numBands)
This should be called once from the child constructor.
Definition CubeIoHandler.cpp:574
int getLineCountInChunk() const
Definition CubeIoHandler.cpp:532
int getChunkCountInSampleDimension() const
Definition CubeIoHandler.cpp:470
virtual void readRaw(RawCubeChunk &chunkToFill)=0
This needs to populate the chunkToFill with unswapped raw bytes from the disk.
int getChunkCountInBandDimension() const
Definition CubeIoHandler.cpp:452
CubeIoHandler(QFile *dataFile, const QList< int > *virtualBandList, const Pvl &label, bool alreadyOnDisk)
Creates a new CubeIoHandler using a RegionalCachingAlgorithm.
Definition CubeIoHandler.cpp:61
BigInt getBytesPerChunk() const
Definition CubeIoHandler.cpp:442
BigInt getDataStartByte() const
Definition CubeIoHandler.cpp:504
virtual void writeRaw(const RawCubeChunk &chunkToWrite)=0
This needs to write the chunkToWrite directly to disk with no modifications to the data itself.
int sampleCount() const
Definition CubeIoHandler.cpp:549
int lineCount() const
Definition CubeIoHandler.cpp:524
virtual void read(Buffer &bufferToFill) const
Read cube data from disk into the buffer.
Definition CubeIoHandler.cpp:217
virtual void write(const Buffer &bufferToWrite)
Write buffer data into the cube data on disk.
Definition CubeIoHandler.cpp:325
virtual void updateLabels(Pvl &labels)=0
Function to update the labels with a Pvl object.
int getSampleCountInChunk() const
Definition CubeIoHandler.cpp:557
virtual BigInt getDataSize() const
Definition CubeIoHandler.cpp:412
int getBandCountInChunk() const
Definition CubeIoHandler.cpp:430
int getChunkIndex(const RawCubeChunk &) const
Given a chunk, what's its index in the file.
Definition CubeIoHandler.cpp:486
Byte swapper.
Definition EndianSwapper.h:38
ImageIoHandler(const QList< int > *virtualBandList)
Definition ImageIoHandler.cpp:12
Container for cube-like labels.
Definition Pvl.h:122
A section of raw data on the disk.
Definition RawCubeChunk.h:27
This is free and unencumbered software released into the public domain.
Definition BoxcarCachingAlgorithm.h:13
This is free and unencumbered software released into the public domain.
Definition CubeIoHandler.h:23
ByteOrder
Tests the current architecture for byte order.
Definition Endian.h:42
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
long long int BigInt
Big int.
Definition Constants.h:49
PixelType
Enumerations for Isis Pixel Types.
Definition PixelType.h:29
This is free and unencumbered software released into the public domain.
Definition CubeIoHandler.h:24