class new in Git masterKtxImageConverter
KTX2 image converter plugin.
Creates Khronos Texture 2.0 (
*.ktx2) files from 1D, 2D and 3D images with optional mip levels. You can use KtxImporter to import images in this format.
This plugin depends on the Trade library and is built if
MAGNUM_WITH_KTXIMAGECONVERTER is enabled when building Magnum Plugins. To use as a dynamic plugin, load
"KtxImageConverter" via Corrade::
Additionally, if you're using Magnum as a CMake subproject, bundle the magnum-plugins and do the following:
set(MAGNUM_WITH_KTXIMAGECONVERTER ON CACHE BOOL "" FORCE) add_subdirectory(magnum-plugins EXCLUDE_FROM_ALL) # So the dynamically loaded plugin gets built implicitly add_dependencies(your-app MagnumPlugins::KtxImageConverter)
To use as a static plugin or as a dependency of another plugin with CMake, put FindMagnumPlugins.cmake into your
modules/ directory, request the
KtxImageConverter component of the
MagnumPlugins package and link to the
find_package(MagnumPlugins REQUIRED KtxImageConverter) # ... target_link_libraries(your-app PRIVATE MagnumPlugins::KtxImageConverter)
The following formats can be written:
All image types can be saved with multiple levels by using the list variants of convertToFile() / convertToData(). Largest level is expected to be first, 1D, 2D and 3D images then have each following level having width, height and depth divided by two, rounded down. Array and cube map images differ in that they don't shrink along the last dimension. Incomplete mip chains are supported.
It's possible to tune various metadata options through configuration(). See below for all options and their default values:
[configuration] # Orientation string to save in the file header. This doesn't flip the input # pixels, it only tells readers the orientation during import. Must be empty or # a string of the form [rl][du][oi]: # r/l: right/left # d/u: down/up # o/i: out of/into the screen # Only subsets of rdi and ruo are recommended, other values may not be # supported by all readers. The file gets a prefix of the string based on # dimension count, for array and cube map images the last dimension doesn't # specify any orientation. orientation=ruo # Format swizzle string to save in the file header. This doesn't save swizzled # data, it only tells readers the desired channel mapping during import. Must # be empty or 4 characters long, valid characters are r,g,b,a,0,1. swizzle= # Name of the tool writing the image file, saved in the file header writerName=Magnum KtxImageConverter
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.