class new in Git master
BcDecImageConverterBCn-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::
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:
- CompressedPixelFormat::
Bc1RGBUnorm, Bc1RGBAUnorm, Bc2RGBAUnorm, Bc3RGBAUnorm and Bc7RGBAUnorm is decoded to PixelFormat:: RGBA8Unorm - CompressedPixelFormat::
Bc1RGBSrgb, Bc1RGBASrgb, Bc2RGBASrgb, Bc3RGBASrgb and Bc7RGBASrgb is decoded to PixelFormat:: RGBA8Srgb - CompressedPixelFormat::
Bc4RUnorm / Bc4RSnorm is decoded to PixelFormat:: R8Unorm / R8Snorm - CompressedPixelFormat::
Bc5RGUnorm / Bc5RGSnorm is decoded to PixelFormat:: RG8Unorm / RG8Snorm - CompressedPixelFormat::
Bc6hRGBUfloat / Bc6hRGBSfloat is decoded to PixelFormat:: RGB16F by default, and to PixelFormat:: RGB32F if the bc6hToFloat
configuration option is enabled
The output image always has data for whole 4x4 blocks, if the actual size isn't whole blocks, PixelStorage::
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.