class new in Git masterAstcImporter
ASTC importer plugin.
Loads 2D and 3D ASTC (
*.astc) files produced by ARM ASTC encoder and other texture compression tools.
This plugin depends on the Trade library and is built if
MAGNUM_WITH_ASTCIMPORTER is enabled when building Magnum Plugins. To use as a dynamic plugin, load
"AstcImporter" via Corrade::
Additionally, if you're using Magnum as a CMake subproject, bundle the magnum-plugins repository and do the following:
set(MAGNUM_WITH_ASTCIMPORTER ON CACHE BOOL "" FORCE) add_subdirectory(magnum-plugins EXCLUDE_FROM_ALL) # So the dynamically loaded plugin gets built implicitly add_dependencies(your-app MagnumPlugins::AstcImporter)
To use as a static plugin or as a dependency of another plugin with CMake, put FindMagnumPlugins.cmake into your
modules/ directory, request the
AstcImporter component of the
MagnumPlugins package in CMake and link to the
find_package(MagnumPlugins REQUIRED AstcImporter) # ... target_link_libraries(your-app PRIVATE MagnumPlugins::AstcImporter)
By default, images are imported with CompressedPixelFormat::
*RGBAF formats instead of
*RGBAUnorm you have to explicitly set the
format configuration option.
Files with 3D ASTC blocks are always exposed as 3D images instead of 2D. Additionally, if a file has 2D ASTC blocks but the Z size is not 1 (a 2D array texture), the image is also exposed as 3D, with ImageFlag3D::
-array option enforces use of a 3D ASTC format), but other tools might.
It's possible to tune various import options through configuration(). See below for all options and their default values:
[configuration] # Set to srgb or float to return the imported image in *RGBASrgb or *RGBAF # pixel format instead of *RGBAUnorm. format=linear # As the ASTC file format doesn't contain any orientation metadata, it's # assumed to follow the D3D/Vulkan coordinate system with Y down and (for 3D # textures) Z forward. A warning is then printed on import, because the # compressed ASTC blocks can't be easily flipped. Enable this option to assume # the OpenGL coordinate system instead and silence the warning. assumeYUpZBackward=false
See Editing plugin-specific configuration for more information and an example showing how to edit the configuration values.
- class AbstractImporter
- Base for importer plugins.