class
StbImageConverterImage converter plugin using stb_image_write.
Contents
Creates files in one of the following formats:
- Windows Bitmap (
*.bmp
) if the plugin was loaded asStbBmpImageConverter
/BmpImageConverter
or Format::Bmp was passed to the constructor - Radiance HDR (
*.hdr
) if the plugin was loaded asStbHdrImageConverter
/HdrImageConverter
or Format::Hdr was passed to the constructor - Portable Network Graphics (
*.png
) if the plugin was loaded asStbPngImageConverter
/PngImageConverter
or Format::Png was passed to the constructor - Truevision TGA (
*.tga
,*.vda
,*.icb
,*.vst
) if the plugin was loaded asStbTgaImageConverter
/TgaImageConverter
or Format::Tga was passed to the constructor
For BMP, PNG and TGA output the images must have format PixelFormat::
This plugin depends on the Trade library and is built if WITH_STBIMAGECONVERTER
is enabled when building Magnum Plugins. To use as a dynamic plugin, you need to load one of the "StbBmpImageConverter"
, "StbHdrImageConverter"
, "StbPngImageConverter"
, "StbTgaImageConverter"
plugins from MAGNUM_PLUGINS_IMAGECONVERTER_DIR
. If you would load the plugin as just "StbImageConverter"
, it won't be able to guess the desired output format. To use as a static plugin or as a dependency of another plugin with CMake, you need to request the StbImageConverter
component of the MagnumPlugins
package and link to the MagnumPlugins::StbImageConverter
target.
Besides StbBmpImageConverter
, StbHdrImageConverter
, StbPngImageConverter
and StbTgaImageConverter
aliases this plugin provides also BmpImageConverter
, HdrImageConverter
, PngImageConverter
and TgaImageConverter
plugins, but note that this plugin may generate slightly larger files and the performance might be worse than when using plugins dedicated for given format.
See Downloading and building plugins, Plugin usage with CMake and Loading and using plugins for more information.
Base classes
- class AbstractImageConverter
- Base for image converter plugins.
Public types
Constructors, destructors, conversion operators
- StbImageConverter(Format format) explicit
- Default constructor.
-
StbImageConverter(PluginManager::
AbstractManager& manager, const std:: string& plugin) explicit - Plugin manager constructor.
Private functions
- auto doFeatures() const override -> Features virtual
- Implementation of features()
-
auto doExportToData(const ImageView2D& image) override -> Containers::
Array<char> virtual - Implementation of exportToData(const ImageView2D&)
Enum documentation
Function documentation
Magnum:: Trade:: StbImageConverter:: StbImageConverter(Format format) explicit
Default constructor.
The converter outputs files in format defined by Format.
Magnum:: Trade:: StbImageConverter:: StbImageConverter(PluginManager:: AbstractManager& manager,
const std:: string& plugin) explicit
Plugin manager constructor.
Outputs files in format based on which alias was used to load the plugin.