CVB++ 14.1
WrappedCube Class Reference

Spectral Wrapped cube objects are linear non-owning cubes. More...

#include <cvb/spectral/wrapped_cube.hpp>

Inherits Cube.

Static Public Member Functions

static std::unique_ptr< WrappedCubeCreate (void *pBase, int numSamples, int numLines, int numBands, Cvb::DataType datatype, intptr_t sampleInc, intptr_t lineInc, intptr_t bandInc)
 Creates a wrapped cube object of type linear non-owning. More...
 
static std::unique_ptr< WrappedCubeFromHandle (HandleGuard< WrappedCube > &&guard)
 Creates wrapped cube from a classic API handle. More...
 
- Static Public Member Functions inherited from Cube
static std::unique_ptr< CubeCreate (int numSamples, int numLines, int numBands, DataType dataType, CubeEncoding bufferLayout=CubeEncoding::BandInterleavedByLine)
 Creates a Continuous Cube object. More...
 
static std::unique_ptr< CubeFromImages (const std::vector< ImagePtr > &images, CubeEncoding bufferLayout)
 Initializes a stacked cube using an array of images. More...
 
static std::unique_ptr< CubeLoad (Cvb::String EnviHeader, Cvb::String EnviBinary)
 Static function Loads a cube from ENVI. More...
 
static std::unique_ptr< CubeFromHandle (HandleGuard< Cube > &&guard)
 Creates cube from a classic API handle. More...
 

Additional Inherited Members

- Public Member Functions inherited from Cube
std::unique_ptr< CubeClone ()
 Copies the memory to a new instance of a cube. More...
 
CubeType Type () const
 Retrieves the type of this cube object. More...
 
class DataType DataType () const
 Retrieves the data type of this cube object. More...
 
std::unique_ptr< CubeConvert (CubeEncoding targetView) const
 Converts cube to given cube encoding targetView. More...
 
std::unique_ptr< CubeMap (CubeRange spectralCubeoid)
 Creates a cropped cube. More...
 
Cvb::ImagePtr BufferView () const
 Retrieves the buffer view of the cube. More...
 
MetaDataPtr MetaData () const
 Retrieves the meta data object of the cube. More...
 
bool TryLinearAccess (LinearAccessData &linearAccessOut) const noexcept
 Retrieve linear access of cube data without throwing an exception. More...
 
LinearAccessData LinearAccess () const
 Retrieve linear access of cube data. More...
 
template<typename T >
std::vector< T > SpectralDensity (int sampleIndex, int lineIndex) const
 Retrieves spectral density at given pixel. More...
 
void Save (Cvb::String EnviHeader, Cvb::String EnviBinary) const
 Writes this cube object to ENVI-format. More...
 
void * Handle () const noexcept
 Returns C-API style handle to the Cube. More...
 
bool TryBufferView (ImagePtr &bufferViewOut) const noexcept
 Retrieves the buffer view of the cube without throwing an exception. More...
 
bool TryMetaData (MetaDataPtr &metaDataOut) const noexcept
 Retrieves the meta data object of the cube without throwing an exception. More...
 

Detailed Description

Spectral Wrapped cube objects are linear non-owning cubes.

A WrappedCube can be created from an existing buffer. Consequently they do not own their buffer. The buffer needs to be linear, meaning each increment is independent.

Member Function Documentation

◆ Create()

static std::unique_ptr< WrappedCube > Create ( void *  pBase,
int  numSamples,
int  numLines,
int  numBands,
Cvb::DataType  datatype,
intptr_t  sampleInc,
intptr_t  lineInc,
intptr_t  bandInc 
)
inlinestatic

Creates a wrapped cube object of type linear non-owning.

Parameters
[in]pBaseBase pointer to the buffer
[in]numSamplesNumber of samples
[in]numLinesNumber of lines
[in]numBandsNumber of bands
[in]datatypeData type
[in]sampleIncIncrement for samples
[in]lineIncIncrement for lines
[in]bandIncIncrement for bands
Returns
Pointer to Continuous Cube object.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
FromImages Load FromHandle

◆ FromHandle()

static std::unique_ptr< WrappedCube > FromHandle ( HandleGuard< WrappedCube > &&  guard)
inlinestatic

Creates wrapped cube from a classic API handle.

Parameters
[in]guardLife time guard for C-API handle.
Returns
The Cube created from the classic API handle.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
Handle

The Cube takes ownership of the handle, so you must share it before using this function.