Lunchbox  1.13.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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. More...
 
 Compressor (PluginRegistry &from, const uint32_t name)
 Construct a new, named compressor instance. More...
 
virtual ~Compressor ()
 Destruct the compressor. More...
 
bool isGood () const
 
 operator bool_t () const
 
bool operator! () 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. More...
 
bool setup (PluginRegistry &registry, const uint32_t tokenType, const float minQuality, const bool ignoreMSE)
 Set up a new, auto-selected compressor instance. More...
 
bool realloc ()
 Reallocate the current instance. More...
 
void clear ()
 Reset to EQ_COMPRESSOR_NONE. More...
 
void compress (void *const in, const uint64_t inDims[2])
 Compress one-dimensional data. More...
 
void compress (void *const in, const uint64_t pvp[4], const uint64_t flags)
 Compress two-dimensional data. More...
 
unsigned getNumResults () const LB_DEPRECATED
 
CompressorResult getResult () const
 
void getResult (const unsigned i, void **const out, uint64_t *const outSize) const LB_DEPRECATED
 

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. More...
 

Detailed Description

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

Example:

Definition at line 37 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
Deprecated:
use new getResult()
Returns
the number of compressed chunks of the last compression.
Version
1.7.1
CompressorResult lunchbox::Compressor::getResult ( ) const
Returns
the result of the last compression.
Version
1.9.1
void lunchbox::Compressor::getResult ( const unsigned  i,
void **const  out,
uint64_t *const  outSize 
) const
bool lunchbox::Compressor::isGood ( ) const
Returns
true if the instance is usable.
Version
1.7.1

Referenced by operator bool_t(), and operator!().

+ Here is the caller graph for this function:

lunchbox::Compressor::operator bool_t ( ) const
inline
Returns
true if the instance is usable, false otherwise.
Version
1.9.1

Definition at line 64 of file compressor.h.

References isGood().

+ Here is the call graph for this function:

bool lunchbox::Compressor::operator! ( ) const
inline
Returns
true if the instance is not usable.
Version
1.9.1

Definition at line 67 of file compressor.h.

References isGood().

+ Here is the call graph for this function:

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: