Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis 3 Programmer Reference
Isis::GdalIoHandler Class Reference

Handles converting buffers to and from disk. More...

#include <GdalIoHandler.h>

Inheritance diagram for Isis::GdalIoHandler:
Inheritance graph
Collaboration diagram for Isis::GdalIoHandler:
Collaboration graph

Public Member Functions

 GdalIoHandler (QString &dataFilePath, const QList< int > *virtualBandList, GDALDataType pixelType=GDT_Float64, GDALAccess eAccess=GA_ReadOnly)
 
 GdalIoHandler (GDALDataset *geodataSet, const QList< int > *virtualBandList, GDALDataType pixelType=GDT_Float64)
 
void init ()
 
virtual void read (Buffer &bufferToFill) const
 
virtual void write (const Buffer &bufferToWrite)
 
virtual BigInt getDataSize () const
 
virtual void updateLabels (Pvl &labels)
 Function to update the labels with a Pvl object.
 
virtual void clearCache (bool blockForWriteCache=false)
 
virtual void addCachingAlgorithm (CubeCachingAlgorithm *algorithm)
 
virtual void clearCache (bool blockForWriteCache=true) const
 
void setVirtualBands (const QList< int > *virtualBandList)
 This changes the virtual band list.
 
QMutex * dataFileMutex ()
 Get the mutex that this IO handler is using around I/Os on the given data file.
 

Protected Attributes

QMutex * m_writeThreadMutex
 This enables us to block while the write thread is working.
 
QList< int > * m_virtualBands
 Converts from virtual band to physical band.
 

Private Member Functions

void readPixelType (double *doubleBuff, void *rawBuff, int idx) const
 
bool writePixelType (double *doubleBuff, void *rawBuff, int idx) const
 

Private Attributes

GDALDataset * m_geodataSet = nullptr
 
std::string m_geodataSetPath = ""
 
GDALDataType m_pixelType
 
int m_lines
 
int m_samples
 
int m_bands
 
double m_offset
 
double m_scale
 
unsigned char * m_maskBuff = nullptr
 
bool m_datasetOwner = false
 
double m_gdalNoDataValue = NULL8
 
std::string m_driverName
 

Detailed Description

Handles converting buffers to and from disk.

This class handles converting buffers to and from disk. This class holds the cube chunks in memory and is capable of reading and writing them. It asks the caching algorithms to recommend cube chunks to not keep in memory. Children need to call setChunkSizes() in their constructor.

This class handles all of the virtual band conversions. This class also guarantees that unwritten cube data ends up read and written as NULLs. The default caching algorithm is a RegionalCachingAlgorithm.

Author
2024-04-30 Adam Paquette

Definition at line 44 of file GdalIoHandler.h.

Constructor & Destructor Documentation

◆ GdalIoHandler() [1/2]

Isis::GdalIoHandler::GdalIoHandler ( QString & dataFilePath,
const QList< int > * virtualBandList,
GDALDataType pixelType = GDT_Float64,
GDALAccess eAccess = GA_ReadOnly )

Definition at line 20 of file GdalIoHandler.cpp.

◆ GdalIoHandler() [2/2]

Isis::GdalIoHandler::GdalIoHandler ( GDALDataset * geodataSet,
const QList< int > * virtualBandList,
GDALDataType pixelType = GDT_Float64 )

Definition at line 29 of file GdalIoHandler.cpp.

◆ ~GdalIoHandler()

Isis::GdalIoHandler::~GdalIoHandler ( )
virtual

Definition at line 68 of file GdalIoHandler.cpp.

Member Function Documentation

◆ addCachingAlgorithm()

void Isis::ImageIoHandler::addCachingAlgorithm ( CubeCachingAlgorithm * algorithm)
virtualinherited

Reimplemented in Isis::CubeIoHandler.

Definition at line 28 of file ImageIoHandler.cpp.

◆ clearCache() [1/2]

virtual void Isis::GdalIoHandler::clearCache ( bool blockForWriteCache = false)
inlinevirtual

Definition at line 62 of file GdalIoHandler.h.

◆ clearCache() [2/2]

void Isis::ImageIoHandler::clearCache ( bool blockForWriteCache = true) const
virtualinherited

Reimplemented in Isis::CubeIoHandler.

Definition at line 30 of file ImageIoHandler.cpp.

◆ dataFileMutex()

QMutex * Isis::ImageIoHandler::dataFileMutex ( )
inherited

Get the mutex that this IO handler is using around I/Os on the given data file.

A lock should be acquired before doing any reads/writes on the data file externally.

Returns
A mutex that can guarantee exclusive access to the data file

Definition at line 58 of file ImageIoHandler.cpp.

References m_writeThreadMutex.

◆ getDataSize()

BigInt Isis::GdalIoHandler::getDataSize ( ) const
virtual

Implements Isis::ImageIoHandler.

Definition at line 250 of file GdalIoHandler.cpp.

◆ init()

void Isis::GdalIoHandler::init ( )

Definition at line 41 of file GdalIoHandler.cpp.

◆ read()

void Isis::GdalIoHandler::read ( Buffer & bufferToFill) const
virtual

Implements Isis::ImageIoHandler.

Definition at line 78 of file GdalIoHandler.cpp.

◆ readPixelType()

void Isis::GdalIoHandler::readPixelType ( double * doubleBuff,
void * rawBuff,
int idx ) const
private

Definition at line 263 of file GdalIoHandler.cpp.

◆ setVirtualBands()

void Isis::ImageIoHandler::setVirtualBands ( const QList< int > * virtualBandList)
inherited

This changes the virtual band list.

Parameters
virtualBandListA list where the indices are the vbands and the values are the physical bands. The values are 1-based. This can be specified as NULL, in which case the vbands are the physical bands. The virtual band list is copied (the pointer provided isn't remembered).

Definition at line 41 of file ImageIoHandler.cpp.

References m_virtualBands.

◆ updateLabels()

void Isis::GdalIoHandler::updateLabels ( Pvl & labels)
virtual

Function to update the labels with a Pvl object.

Parameters
labelsPvl object to update with

Implements Isis::ImageIoHandler.

Definition at line 258 of file GdalIoHandler.cpp.

References updateLabels().

Referenced by updateLabels().

◆ write()

void Isis::GdalIoHandler::write ( const Buffer & bufferToWrite)
virtual

Implements Isis::ImageIoHandler.

Definition at line 167 of file GdalIoHandler.cpp.

◆ writePixelType()

bool Isis::GdalIoHandler::writePixelType ( double * doubleBuff,
void * rawBuff,
int idx ) const
private

Definition at line 462 of file GdalIoHandler.cpp.

Member Data Documentation

◆ m_bands

int Isis::GdalIoHandler::m_bands
private

Definition at line 75 of file GdalIoHandler.h.

◆ m_datasetOwner

bool Isis::GdalIoHandler::m_datasetOwner = false
private

Definition at line 79 of file GdalIoHandler.h.

◆ m_driverName

std::string Isis::GdalIoHandler::m_driverName
private

Definition at line 81 of file GdalIoHandler.h.

◆ m_gdalNoDataValue

double Isis::GdalIoHandler::m_gdalNoDataValue = NULL8
private

Definition at line 80 of file GdalIoHandler.h.

◆ m_geodataSet

GDALDataset* Isis::GdalIoHandler::m_geodataSet = nullptr
private

Definition at line 70 of file GdalIoHandler.h.

◆ m_geodataSetPath

std::string Isis::GdalIoHandler::m_geodataSetPath = ""
private

Definition at line 71 of file GdalIoHandler.h.

◆ m_lines

int Isis::GdalIoHandler::m_lines
private

Definition at line 73 of file GdalIoHandler.h.

◆ m_maskBuff

unsigned char* Isis::GdalIoHandler::m_maskBuff = nullptr
private

Definition at line 78 of file GdalIoHandler.h.

◆ m_offset

double Isis::GdalIoHandler::m_offset
private

Definition at line 76 of file GdalIoHandler.h.

◆ m_pixelType

GDALDataType Isis::GdalIoHandler::m_pixelType
private

Definition at line 72 of file GdalIoHandler.h.

◆ m_samples

int Isis::GdalIoHandler::m_samples
private

Definition at line 74 of file GdalIoHandler.h.

◆ m_scale

double Isis::GdalIoHandler::m_scale
private

Definition at line 77 of file GdalIoHandler.h.

◆ m_virtualBands

QList<int>* Isis::ImageIoHandler::m_virtualBands
protectedinherited

◆ m_writeThreadMutex

QMutex* Isis::ImageIoHandler::m_writeThreadMutex
protectedinherited

The documentation for this class was generated from the following files: