Pression  1.1.1
Compressor, decompressor, uploader and downloader plugins
pression::Downloader Class Reference

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

#include <downloader.h>

+ Collaboration diagram for pression::Downloader:

Public Member Functions

 Downloader ()
 Construct a new, invalid downloader instance. More...
 
 Downloader (PluginRegistry &from, const uint32_t name, const GLEWContext *gl=0)
 Construct a new, named downloader instance. More...
 
virtual ~Downloader ()
 Destruct this downloader. More...
 
bool isGood () const
 
bool uses (const uint32_t name) const
 
bool supports (const uint32_t inputToken, const bool noAlpha, const uint64_t capabilities) const
 
const EqCompressorInfogetInfo () const
 
bool setup (PluginRegistry &from, const uint32_t name, const GLEWContext *gl=0)
 Set up a new, named downloader instance. More...
 
bool setup (PluginRegistry &from, const uint32_t internalFormat, const float minQuality, const bool ignoreAlpha, const uint64_t capabilities, const GLEWContext *gl)
 Set up a new, auto-selected downloader instance. More...
 
void clear ()
 Reset to EQ_COMPRESSOR_NONE. More...
 
bool start (void **buffer, const uint64_t inDims[4], const uint64_t flags, uint64_t outDims[4], const unsigned source, const GLEWContext *gl)
 Start downloading data from the GPU to the CPU. More...
 
void finish (void **buffer, const uint64_t inDims[4], const uint64_t flags, uint64_t outDims[4], const GLEWContext *gl)
 Finish download data from the GPU to the CPU. More...
 

Static Public Member Functions

static uint32_t choose (const PluginRegistry &from, const uint32_t internalFormat, const float minQuality, const bool ignoreAlpha, const uint64_t capabilities, const GLEWContext *gl)
 Find the best downloader in all plugins for the given parameters. More...
 

Detailed Description

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

Definition at line 32 of file downloader.h.

Constructor & Destructor Documentation

pression::Downloader::Downloader ( )

Construct a new, invalid downloader instance.

Version
1.7.1
pression::Downloader::Downloader ( PluginRegistry from,
const uint32_t  name,
const GLEWContext *  gl = 0 
)

Construct a new, named downloader instance.

Parameters
fromthe plugin registry.
namethe name of the downloader.
glthe OpenGL function table to verify that the plugin is compatible with this GL implementation.
Version
1.7.1
virtual pression::Downloader::~Downloader ( )
virtual

Destruct this downloader.

Version
1.7.1

Member Function Documentation

static uint32_t pression::Downloader::choose ( const PluginRegistry from,
const uint32_t  internalFormat,
const float  minQuality,
const bool  ignoreAlpha,
const uint64_t  capabilities,
const GLEWContext *  gl 
)
static

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

This convenience method searches all compressors in all plugins to find the downloader which supports the given parameters and provides the highest speed.

Parameters
fromthe plugin registry to choose from.
internalFormatthe input token type to the downloader.
minQualitythe minimum quality.
ignoreAlphatrue if the downloader may drop the alpha channel.
capabilitiesthe capabilities required by the downloader.
glthe OpenGL function table.
Returns
the name of the chosen downloader.
Version
1.7.1
void pression::Downloader::clear ( )

Reset to EQ_COMPRESSOR_NONE.

Version
1.7.1
void pression::Downloader::finish ( void **  buffer,
const uint64_t  inDims[4],
const uint64_t  flags,
uint64_t  outDims[4],
const GLEWContext *  gl 
)

Finish download data from the GPU to the CPU.

Parameters
bufferdata destination buffer.
inDimsthe dimensions of the input data.
flagscapability flags for the compression.
outDimsreturn value for the dimensions of the output data.
glthe OpenGL function table.
Version
1.7.1
const EqCompressorInfo& pression::Downloader::getInfo ( ) const
Returns
the information about the allocated instance.
Version
1.7.1
bool pression::Downloader::isGood ( ) const
Returns
true if the instance is usable.
Version
1.7.1
bool pression::Downloader::setup ( PluginRegistry from,
const uint32_t  name,
const GLEWContext *  gl = 0 
)

Set up a new, named downloader instance.

Parameters
fromthe plugin registry.
namethe name of the downloader.
glthe OpenGL function table to verify that the plugin is compatible with this GL implementation.
Returns
true on success, false otherwise.
Version
1.7.1
bool pression::Downloader::setup ( PluginRegistry from,
const uint32_t  internalFormat,
const float  minQuality,
const bool  ignoreAlpha,
const uint64_t  capabilities,
const GLEWContext *  gl 
)

Set up a new, auto-selected downloader instance.

See also
choose() for parameters.
Version
1.7.1
bool pression::Downloader::start ( void **  buffer,
const uint64_t  inDims[4],
const uint64_t  flags,
uint64_t  outDims[4],
const unsigned  source,
const GLEWContext *  gl 
)

Start downloading data from the GPU to the CPU.

Parameters
bufferdata destination buffer.
inDimsthe dimensions of the input data.
flagscapability flags for the compression.
outDimsreturn value for the dimensions of the output data.
sourcethe source texture name, or 0 for framebuffer.
glthe OpenGL function table.
Returns
true if finish is needed, false if a synchronous download was performed.
Version
1.7.1
bool pression::Downloader::supports ( const uint32_t  inputToken,
const bool  noAlpha,
const uint64_t  capabilities 
) const
Returns
true if the download supports the given parameters.
Version
1.7.1
bool pression::Downloader::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: