Welcome to Python-flavored Magnum! Please note that, while already being rather stable, this functionality is still considered experimental and some APIs might get changed without preserving full backwards compatibility.

magnum.trade.AbstractImageConverter class

Interface for image converter plugins

Similarly to C++, image converter plugins are loaded through ImageConverterManager:

>>> manager = trade.ImageConverterManager()
>>> converter = manager.load_and_instantiate('PngImageConverter')

Unlike C++, errors in both API usage and file parsing are reported by raising an exception. See particular function documentation for detailed behavior.

Methods

def convert(self, image: ImageData1D) -> ImageData1D
Convert a 1D image data
def convert(self, image: ImageData2D) -> ImageData2D
Convert a 2D image data
def convert(self, image: ImageData3D) -> ImageData3D
Convert a 3D image data
def convert(self, image: ImageView1D) -> ImageData1D
Convert a 1D image
def convert(self, image: ImageView2D) -> ImageData2D
Convert a 2D image
def convert(self, image: ImageView3D) -> ImageData3D
Convert a 3D image
def convert(self, image: CompressedImageView1D) -> ImageData1D
Convert a compressed 1D image
def convert(self, image: CompressedImageView2D) -> ImageData2D
Convert a compressed 2D image
def convert(self, image: CompressedImageView3D) -> ImageData3D
Convert a compressed 3D image
def convert_to_file(self, image: ImageData1D, filename: str) -> None
Convert a 1D image data to a file
def convert_to_file(self, image: ImageData2D, filename: str) -> None
Convert a 2D image data to a file
def convert_to_file(self, image: ImageData3D, filename: str) -> None
Convert a 3D image data to a file
def convert_to_file(self, image: ImageView1D, filename: str) -> None
Convert a 1D image to a file
def convert_to_file(self, image: ImageView2D, filename: str) -> None
Convert a 2D image to a file
def convert_to_file(self, image: ImageView3D, filename: str) -> None
Convert a 3D image to a file
def convert_to_file(self, image: CompressedImageView1D, filename: str) -> None
Convert a compressed 1D image to a file
def convert_to_file(self, image: CompressedImageView2D, filename: str) -> None
Convert a compressed 2D image to a file
def convert_to_file(self, image: CompressedImageView3D, filename: str) -> None
Convert a compressed 3D image to a file

Properties

configuration: corrade.utility.ConfigurationGroup get
Plugin-specific configuration
features: ImageConverterFeatures get
Features supported by this converter
flags: ImageConverterFlags get set
Converter flags
manager: object get
Manager owning this plugin instance
metadata: corrade.pluginmanager.PluginMetadata get
Plugin metadata
plugin: str get
Plugin identifier string

Data

plugin_interface: str
Plugin interface string
plugin_metadata_suffix: str
Plugin metadata suffix
plugin_search_paths: typing.List[str]
Plugin search paths
plugin_suffix: str
Plugin suffix

Method documentation

def magnum.trade.AbstractImageConverter.convert(self, image: ImageData1D) -> ImageData1D

Convert a 1D image data

Exceptions
RuntimeError If image conversion fails

def magnum.trade.AbstractImageConverter.convert(self, image: ImageData2D) -> ImageData2D

Convert a 2D image data

Exceptions
RuntimeError If image conversion fails

def magnum.trade.AbstractImageConverter.convert(self, image: ImageData3D) -> ImageData3D

Convert a 3D image data

Exceptions
RuntimeError If image conversion fails

def magnum.trade.AbstractImageConverter.convert(self, image: ImageView1D) -> ImageData1D

Convert a 1D image

Exceptions
RuntimeError If image conversion fails

def magnum.trade.AbstractImageConverter.convert(self, image: ImageView2D) -> ImageData2D

Convert a 2D image

Exceptions
RuntimeError If image conversion fails

def magnum.trade.AbstractImageConverter.convert(self, image: ImageView3D) -> ImageData3D

Convert a 3D image

Exceptions
RuntimeError If image conversion fails

def magnum.trade.AbstractImageConverter.convert(self, image: CompressedImageView1D) -> ImageData1D

Convert a compressed 1D image

Exceptions
RuntimeError If image conversion fails

def magnum.trade.AbstractImageConverter.convert(self, image: CompressedImageView2D) -> ImageData2D

Convert a compressed 2D image

Exceptions
RuntimeError If image conversion fails

def magnum.trade.AbstractImageConverter.convert(self, image: CompressedImageView3D) -> ImageData3D

Convert a compressed 3D image

Exceptions
RuntimeError If image conversion fails

def magnum.trade.AbstractImageConverter.convert_to_file(self, image: ImageData1D, filename: str) -> None

Convert a 1D image data to a file

Exceptions
RuntimeError If image conversion fails

For compatibility with os.path, on Windows this function converts all backslashes in filename to forward slashes before passing it to Trade::AbstractImageConverter::convertToFile(), which expects forward slashes as directory separators on all platforms.

def magnum.trade.AbstractImageConverter.convert_to_file(self, image: ImageData2D, filename: str) -> None

Convert a 2D image data to a file

Exceptions
RuntimeError If image conversion fails

For compatibility with os.path, on Windows this function converts all backslashes in filename to forward slashes before passing it to Trade::AbstractImageConverter::convertToFile(), which expects forward slashes as directory separators on all platforms.

def magnum.trade.AbstractImageConverter.convert_to_file(self, image: ImageData3D, filename: str) -> None

Convert a 3D image data to a file

Exceptions
RuntimeError If image conversion fails

For compatibility with os.path, on Windows this function converts all backslashes in filename to forward slashes before passing it to Trade::AbstractImageConverter::convertToFile(), which expects forward slashes as directory separators on all platforms.

def magnum.trade.AbstractImageConverter.convert_to_file(self, image: ImageView1D, filename: str) -> None

Convert a 1D image to a file

Exceptions
RuntimeError If image conversion fails

For compatibility with os.path, on Windows this function converts all backslashes in filename to forward slashes before passing it to Trade::AbstractImageConverter::convertToFile(), which expects forward slashes as directory separators on all platforms.

def magnum.trade.AbstractImageConverter.convert_to_file(self, image: ImageView2D, filename: str) -> None

Convert a 2D image to a file

Exceptions
RuntimeError If image conversion fails

For compatibility with os.path, on Windows this function converts all backslashes in filename to forward slashes before passing it to Trade::AbstractImageConverter::convertToFile(), which expects forward slashes as directory separators on all platforms.

def magnum.trade.AbstractImageConverter.convert_to_file(self, image: ImageView3D, filename: str) -> None

Convert a 3D image to a file

Exceptions
RuntimeError If image conversion fails

For compatibility with os.path, on Windows this function converts all backslashes in filename to forward slashes before passing it to Trade::AbstractImageConverter::convertToFile(), which expects forward slashes as directory separators on all platforms.

def magnum.trade.AbstractImageConverter.convert_to_file(self, image: CompressedImageView1D, filename: str) -> None

Convert a compressed 1D image to a file

Exceptions
RuntimeError If image conversion fails

For compatibility with os.path, on Windows this function converts all backslashes in filename to forward slashes before passing it to Trade::AbstractImageConverter::convertToFile(), which expects forward slashes as directory separators on all platforms.

def magnum.trade.AbstractImageConverter.convert_to_file(self, image: CompressedImageView2D, filename: str) -> None

Convert a compressed 2D image to a file

Exceptions
RuntimeError If image conversion fails

For compatibility with os.path, on Windows this function converts all backslashes in filename to forward slashes before passing it to Trade::AbstractImageConverter::convertToFile(), which expects forward slashes as directory separators on all platforms.

def magnum.trade.AbstractImageConverter.convert_to_file(self, image: CompressedImageView3D, filename: str) -> None

Convert a compressed 3D image to a file

Exceptions
RuntimeError If image conversion fails

For compatibility with os.path, on Windows this function converts all backslashes in filename to forward slashes before passing it to Trade::AbstractImageConverter::convertToFile(), which expects forward slashes as directory separators on all platforms.