Lunchbox  1.8.0
Public Member Functions | Static Public Member Functions | List of all members
lunchbox::Compressor Class Reference

A C++ class to handle one compressor plugin instance. More...

#include <compressor.h>

+ Inheritance diagram for lunchbox::Compressor:
+ Collaboration diagram for lunchbox::Compressor:

Public Member Functions

 Compressor ()
 Construct a new, invalid compressor instance.
 Compressor (PluginRegistry &from, const uint32_t name)
 Construct a new, named compressor instance.
virtual ~Compressor ()
 Destruct the compressor.
bool isGood () const
bool uses (const uint32_t name) const
const EqCompressorInfogetInfo () const
bool setup (PluginRegistry &from, const uint32_t name)
 Set up a new, named compressor instance.
bool setup (PluginRegistry &registry, const uint32_t tokenType, const float minQuality, const bool ignoreMSE)
 Set up a new, auto-selected compressor instance.
bool realloc ()
 Reallocate the current instance.
void clear ()
 Reset to EQ_COMPRESSOR_NONE.
void compress (void *const in, const uint64_t inDims[2])
 Compress one-dimensional data.
void compress (void *const in, const uint64_t pvp[4], const uint64_t flags)
 Compress two-dimensional data.
unsigned getNumResults () const
void getResult (const unsigned i, void **const out, uint64_t *const outSize) const
 Get one compressed chunk of the last compression.

Static Public Member Functions

static uint32_t choose (const PluginRegistry &registry, const uint32_t tokenType, const float minQuality, const bool ignoreMSE)
 Find the best compressor in all plugins for the given parameters.

Detailed Description

A C++ class to handle one compressor plugin instance.

Definition at line 33 of file compressor.h.

Constructor & Destructor Documentation

lunchbox::Compressor::Compressor ( )

Construct a new, invalid compressor instance.

Version
1.7.1
lunchbox::Compressor::Compressor ( PluginRegistry from,
const uint32_t  name 
)

Construct a new, named compressor instance.

Parameters
fromthe plugin registry
namethe name of the compressor
Version
1.7.1
virtual lunchbox::Compressor::~Compressor ( )
virtual

Destruct the compressor.

Version
1.7.1

Member Function Documentation

static uint32_t lunchbox::Compressor::choose ( const PluginRegistry registry,
const uint32_t  tokenType,
const float  minQuality,
const bool  ignoreMSE 
)
static

Find the best compressor in all plugins for the given parameters.

This convenience method searches all compressors in all plugins to find the compressor which matches best the given parameters.

Parameters
registrythe plugin registry to choose from.
tokenTypethe structure of the data to compress.
minQualityminimal quality of the compressed data, with 0 = no quality and 1 = full quality, no loss.
ignoreMSEthe most-significant element of a four-element token can be ignored, typically the alpha channel of an image.
Returns
the name of the chosen compressor.
Version
1.7.1
void lunchbox::Compressor::clear ( )

Reset to EQ_COMPRESSOR_NONE.

Version
1.7.1
void lunchbox::Compressor::compress ( void *const  in,
const uint64_t  inDims[2] 
)

Compress one-dimensional data.

Parameters
inthe pointer to the input data.
inDimsthe dimensions of the input data
Version
1.7.1
void lunchbox::Compressor::compress ( void *const  in,
const uint64_t  pvp[4],
const uint64_t  flags 
)

Compress two-dimensional data.

Parameters
inthe pointer to the input data.
pvpthe dimensions of the input data
flagscapability flags for the compression
Version
1.7.1
const EqCompressorInfo& lunchbox::Compressor::getInfo ( ) const
Returns
the information about the allocated instance.
Version
1.7.1
unsigned lunchbox::Compressor::getNumResults ( ) const
Returns
the number of compressed chunks of the last compression.
Version
1.7.1
void lunchbox::Compressor::getResult ( const unsigned  i,
void **const  out,
uint64_t *const  outSize 
) const

Get one compressed chunk of the last compression.

Parameters
ithe result index to return.
outthe return value to store the result pointer
outSizethe return value to store the result size in bytes
Version
1.7.1
bool lunchbox::Compressor::isGood ( ) const
Returns
true if the instance is usable.
Version
1.7.1
bool lunchbox::Compressor::realloc ( )

Reallocate the current instance.

Version
1.7.1
bool lunchbox::Compressor::setup ( PluginRegistry from,
const uint32_t  name 
)

Set up a new, named compressor instance.

Parameters
fromthe plugin registry.
namethe name of the compressor.
Returns
true on success, false otherwise.
Version
1.7.1
bool lunchbox::Compressor::setup ( PluginRegistry registry,
const uint32_t  tokenType,
const float  minQuality,
const bool  ignoreMSE 
)

Set up a new, auto-selected compressor instance.

See Also
choose() for parameters.
Version
1.7.1
bool lunchbox::Compressor::uses ( const uint32_t  name) const
Returns
true if the instance is usable for the given name.
Version
1.7.1

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