class new in Git masterStbDxtImageConverter
BC1/BC3 compressor using stb_dxt.
Converts uncompressed 2D, 2D array or cube and 3D RGB and RGBA images to block-compressed BC1/BC3 images using the stb_
This plugin depends on the Trade library and is built if
MAGNUM_WITH_STBDXTIMAGECONVERTER is enabled when building Magnum Plugins. To use as a dynamic plugin, load
"StbDxtImageConverter" via Corrade::
Additionally, if you're using Magnum as a CMake subproject, bundle the magnum-plugins repository and do the following:
set(MAGNUM_WITH_STBDXTIMAGECONVERTER ON CACHE BOOL "" FORCE) add_subdirectory(magnum-plugins EXCLUDE_FROM_ALL) # So the dynamically loaded plugin gets built implicitly add_dependencies(your-app MagnumPlugins::StbDxtImageConverter)
To use as a static plugin or as a dependency of another plugin with CMake, put FindMagnumPlugins.cmake into your
modules/ directory, request the
StbDxtImageConverter component of the
MagnumPlugins package and link to the
find_package(MagnumPlugins REQUIRED StbDxtImageConverter) # ... target_link_libraries(your-app PRIVATE MagnumPlugins::StbDxtImageConverter)
alpha configuration option.
Image flags are passed through unchanged. 3D images are compressed slice-by-slice, independently of whether ImageFlag3D::
The input image size is expected to be divisible by four in the X and Y dimension. If your image doesn't fit this requirement, you have to pad/crop or resample it first. Since 3D images are compressed slice-by-slice, there's no restriction on the Z dimension.
Unlike image converters dealing with uncompressed pixel formats, the image isn't Y-flipped on export due to the nontrivial amount of work involved with Y-flipping block-compressed data. This is in line with importers of compressed pixel formats such as AstcImporter, DdsImporter or KtxImporter, which don't Y-flip compressed formats on import either.
Various compressor options can be set through configuration(). See below for all options and their default values:
[configuration] # Store the alpha channel. If enabled, the output format is BC3 (128 bits per # block), if disabled the format is BC1 (64 bits per block). By default it's # inferred from whether the input is RGB or RGBA. alpha= # High-quality mode, does two refinement steps instead of one. ~30–40% # slower. highQuality=false
See Editing plugin-specific configuration for more information and an example showing how to edit the configuration values.
- class AbstractImageConverter
- Base for image converter plugins.