OpenZGY/C++ API and Internals (ALPHA)
Access seismic data stored in ZGY format.
Public Types | Static Public Member Functions | List of all members
InternalZGY::CompressFactoryImpl Class Reference

Registry of known compress and decompress algorithms. More...

Public Types

typedef std::function< compressor_t(const std::vector< std::string > &)> compfactory_t
 
typedef std::function< rawdata_t(const rawdata_t &, BrickStatus, const index3_t &)> decompressor_t
 

Static Public Member Functions

static void registerCompressor (const std::string &name, const compfactory_t &fn)
 Register a function that will be called to create a compressor function.
 
static void registerDecompressor (const std::string &name, const decompressor_t &fn)
 Register a function that can decompress one or more types of compressed data. More...
 
static std::vector< std::string > knownCompressors ()
 
static std::vector< std::string > knownDecompressors ()
 
static compressor_t getCompressor (const std::string &name, const std::vector< std::string > &args)
 
static rawdata_t decompress (const rawdata_t &cdata, BrickStatus status, const index3_t &shape)
 

Detailed Description

Registry of known compress and decompress algorithms.

The compression and decompression algorithms are completely separate but we might as well handle both in the same class.

Member Function Documentation

◆ decompress()

rawdata_t InternalZGY::CompressFactoryImpl::decompress ( const rawdata_t cdata,
BrickStatus  status,
const index3_t shape 
)
static

Loop over all registered decompressors and try to find one that can handle this particular brick. Raises an error if none found. See CompressPlugin.decompress() for parameter descriptions.

◆ knownCompressors()

std::vector< std::string > InternalZGY::CompressFactoryImpl::knownCompressors ( )
static

Return the names of all compressors known to the system. This is primarily for logging, but might in principle be used in a GUI to present a list of compressors to choose from. The problem with that is how to handle the argument list.

◆ knownDecompressors()

std::vector< std::string > InternalZGY::CompressFactoryImpl::knownDecompressors ( )
static

Return the names of all decompressors known to the system. This is primarily for logging.

◆ registerDecompressor()

void InternalZGY::CompressFactoryImpl::registerDecompressor ( const std::string &  name,
const decompressor_t &  fn 
)
static

Register a function that can decompress one or more types of compressed data.

Pass an empty function in order to remove the registration.

The registered functions will be called in reverse order of registration until one of them indicates that it has decompressed the data. The supplied name is only for information, and technically doesn't even need to be unique. But it really should match the name of the compressor.


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