Magnum::Trade::PngImageConverter class

PNG image converter plugin.

Creates Portable Network Graphics (*.png) files from images with format PixelFormat::Red, PixelFormat::RG, PixelFormat::RGB or PixelFormat::RGBA and type PixelType::UnsignedByte or PixelType::UnsignedShort. On OpenGL ES 2.0 and WebGL 1.0 accepts also PixelFormat::Luminance instead of PixelFormat::Red and PixelFormat::LuminanceAlpha instead of PixelFormat::RG. Does not support non-default PixelStorage::swapBytes() values.

This plugin depends on the Trade and libPNG libraries and is built if WITH_PNGIMAGECONVERTER is enabled when building Magnum Plugins. To use as a dynamic plugin, you need to load the "PngImageConverter" plugin from MAGNUM_PLUGINS_IMAGECONVERTER_DIR. To use as a static plugin or as a dependency of another plugin with CMake, you need to request the PngImageConverter component of the MagnumPlugins package and link to the MagnumPlugins::PngImageConverter target. 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.

Constructors, destructors, conversion operators

PngImageConverter() explicit
Default constructor.
PngImageConverter(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&)