Magnum::Trade::BcDecImageConverter class new in Git master

BCn-compressed image decoding using bcdec.

Decodes BC1, BC2, BC3, BC4, BC5, BC6H and BC7 blocks to uncompressed RGBA using the bcdec library. See also the EtcDecImageConverter plugin for decoding ETC and EAC images.

Usage

This plugin depends on the Trade library and is built if MAGNUM_WITH_BCDECIMAGECONVERTER is enabled when building Magnum Plugins. To use as a dynamic plugin, load "BcDecImageConverter" via Corrade::PluginManager::Manager.

Additionally, if you're using Magnum as a CMake subproject, bundle the magnum-plugins repository and do the following:

set(MAGNUM_WITH_BCDECIMAGECONVERTER ON CACHE BOOL "" FORCE)
add_subdirectory(magnum-plugins EXCLUDE_FROM_ALL)

# So the dynamically loaded plugin gets built implicitly
add_dependencies(your-app MagnumPlugins::BcDecImageConverter)

To use as a static plugin or as a dependency of another plugin with CMake, put FindMagnumPlugins.cmake into your modules/ directory, request the BcDecImageConverter component of the MagnumPlugins package and link to the MagnumPlugins::BcDecImageConverter target:

find_package(MagnumPlugins REQUIRED BcDecImageConverter)

# ...
target_link_libraries(your-app PRIVATE MagnumPlugins::BcDecImageConverter)

See Downloading and building plugins, Plugin usage with CMake and Loading and using plugins for more information.

Behavior and limitations

The following formats are supported:

The output image always has data for whole 4x4 blocks, if the actual size isn't whole blocks, PixelStorage::setRowLength() is set to treat the extra pixels at the end of each row as padding. Non-default CompressedPixelStorage isn't supported in input images.

Only 2D image conversion is supported at the moment. Image flags, if any, are passed through unchanged.

Plugin-specific configuration

It's possible to tune various conversion options through configuration(). See below for all options and their default values:

[configuration]
# Decode BC6H to 32-bit floats. By default decodes to 16-bit half-floats as
# that's the expected output format for this encoding.
bc6hToFloat=false

See Editing plugin-specific configuration for more information and an example showing how to edit the configuration values.

Base classes

class AbstractImageConverter
Base for image converter plugins.

Constructors, destructors, conversion operators

BcDecImageConverter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin) explicit
Plugin manager constructor.