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

#include <bulk.h>

Classes

class  ErrorsWillCorruptFile
 

Public Types

typedef std::function< bool(int, const std::string &)> LoggerFn
 

Public Member Functions

 ZgyInternalBulk (const std::shared_ptr< FileADT > &file, const std::shared_ptr< ZgyInternalMeta > &metadata, bool compressed_write, const LoggerFn &logger=LoggerFn())
 
std::pair< bool, double > readConstantValue (const std::array< std::int64_t, 3 > &start, const std::array< std::int64_t, 3 > &size, int32_t lod, bool as_float)
 Get hint about all constant region. More...
 
void readToExistingBuffer (const std::shared_ptr< DataBuffer > &data, const std::array< std::int64_t, 3 > &start, int32_t lod, bool as_float)
 
std::shared_ptr< DataBufferreadToNewBuffer (const std::array< std::int64_t, 3 > &start, const std::array< std::int64_t, 3 > &size, int32_t lod, bool as_float, bool check_constant)
 
void writeRegion (const std::shared_ptr< DataBuffer > &data, const std::array< std::int64_t, 3 > &start, int32_t lod, bool is_storage, const compressor_t &compressor)
 
bool errorflag () const
 
void set_errorflag (bool flag)
 
LoggerFn set_logger (const LoggerFn &logger)
 
std::array< double, 2 > valueRangeWritten () const
 

Detailed Description

Read or write bulk data. The meta data needs to have been read already. The user-callable API will forward its read requests here.

Member Function Documentation

◆ readConstantValue()

std::pair< bool, double > InternalZGY::ZgyInternalBulk::readConstantValue ( const std::array< std::int64_t, 3 > &  start,
const std::array< std::int64_t, 3 > &  size,
int32_t  lod,
bool  as_float 
)

Get hint about all constant region.

Check to see if the specified region is known to have all samples set to the same value. Returns a pair of (is_const, const_value).

The function only makes inexpensive checks so it might return is_const=false even if the region was in fact constant. It will not make the opposite mistake. This method is only intended as a hint to improve performance.

For int8 and int16 files the caller may specify whether to scale the values or not. Even if unscaled the function returns the value as a double.

◆ readToExistingBuffer()

void InternalZGY::ZgyInternalBulk::readToExistingBuffer ( const std::shared_ptr< DataBuffer > &  result,
const std::array< std::int64_t, 3 > &  start,
int32_t  lod,
bool  as_float 
)

Read bulk data starting at "start" in index space and store the result in the provided DataBuffer. Start should be in the range (0,0,0) to Size-1. The count of samples to read is implied by the size of the DataBuffer that is passed in. The valid data types for the result are float32 (in which case samples stored as int8 or int16 will be scaled) or the files's storage value type (in which case there is no scaling). It is valid to pass a size that includes the padding area between the survey and the end of the current brick. But not past that point.

◆ readToNewBuffer()

std::shared_ptr< DataBuffer > InternalZGY::ZgyInternalBulk::readToNewBuffer ( const std::array< std::int64_t, 3 > &  start,
const std::array< std::int64_t, 3 > &  size,
int32_t  lod,
bool  as_float,
bool  check_constant 
)

Read bulk data starting at "start" in index space size "size". Return the result in a newly allocated DataBuffer. The result will either be a scalar (constant-value) buffer or a regular buffer.

Pass check_constant=true to check extra hard for all-constant data. A region written with all samples identical, as opposed to a region flagged as constant without taking up space, will also be detected.

Start should be in the range (0,0,0) to Size-1. It is valid to pass a size that includes the padding area between the survey and the end of the current brick. But not past that point.


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