Magnum::Trade namespace

Data format exchange.

Contains plugin interfaces for importing data of various formats and classes for direct access to the data.

This library is built if WITH_TRADE is enabled when building Magnum. To use this library with CMake, request the Trade component of the Magnum package and link to the Magnum::Trade target:

find_package(Magnum REQUIRED Trade)

# ...
target_link_libraries(your-app PRIVATE Magnum::Trade)

Additional plugins and utilities are built separately. See particular Trade::*Importer and *ImageConverter class documentation, the magnum-imageconverter utility documentation, Downloading and building, Downloading and building plugins, Usage with CMake, Plugin usage with CMake and Loading and using plugins for more information.

Namespaces

namespace OpenGex
OpenGEX structure and property names.

Classes

class AbstractImageConverter
Base for image converter plugins.
class AbstractImporter
Base for importer plugins.
class AbstractSceneConverter new in 2020.06
Base for scene converter plugins.
class AnimationData
Animation clip data.
class AnimationTrackData
Animation track data.
class AnyImageConverter
Any image converter plugin.
class AnyImageImporter
Any image importer plugin.
class AnySceneConverter
Any scene converter plugin.
class AnySceneImporter
Any scene importer plugin.
template<class T>
struct ArrayAllocator new in 2020.06
Growable array allocator to be used in importer plugins.
class AssimpImporter
Assimp importer.
class BasisImageConverter new in 2019.10
Basis Universal image converter plugin.
class BasisImporter new in 2019.10
Basis Universal importer plugin.
class CameraData
Camera data.
class DdsImporter
DDS image importer plugin.
class DevIlImageImporter
DevIL Image importer plugin.
class FlatMaterialData new in Git master
Flat material data.
class IcoImporter new in 2020.06
ICO importer plugin.
template<UnsignedInt dimensions>
class ImageData
Image data.
class JpegImageConverter
JPEG image converter plugin.
class JpegImporter
JPEG importer plugin.
class LightData
Light data.
class MaterialAttributeData new in Git master
Material attribute data.
class MaterialData new in Git master
Material data.
template<MaterialLayer layer>
class MaterialLayerData new in Git master
Material layer data.
class MeshAttributeData new in 2020.06
Mesh attribute data.
class MeshData new in 2020.06
Mesh data.
class MeshData2D deprecated in 2020.06
Two-dimensional mesh data.
class MeshData3D deprecated in 2020.06
Three-dimensional mesh data.
class MeshIndexData new in 2020.06
Mesh index data.
class MeshObjectData2D
Two-dimensional mesh object data.
class MeshObjectData3D
Three-dimensional mesh object data.
class MeshOptimizerSceneConverter new in 2020.06
MeshOptimizer converter plugin.
class MiniExrImageConverter
OpenEXR image converter plugin using miniexr.
class ObjectData2D
Two-dimensional object data.
class ObjectData3D
Three-dimensional object data.
class ObjImporter
OBJ importer plugin.
class OpenGexImporter
OpenGEX importer.
class PbrClearCoatMaterialData new in Git master
Clear coat material layer data.
class PbrMetallicRoughnessMaterialData new in Git master
PBR metallic/roughness material data.
class PbrSpecularGlossinessMaterialData new in Git master
PBR specular/glossiness material data.
class PhongMaterialData
Phong material data.
class PngImageConverter
PNG image converter plugin.
class PngImporter
PNG importer plugin.
class PrimitiveImporter new in 2020.06
Primitive importer plugin.
class SceneData
Scene data.
template<UnsignedInt dimensions>
class SkinData new in Git master
Skin data.
class StanfordImporter
Stanford PLY importer plugin.
class StanfordSceneConverter new in 2020.06
Stanford PLY converter plugin.
class StbImageConverter
Image converter plugin using stb_image_write.
class StbImageImporter
Image importer plugin using stb_image.
class StlImporter new in 2020.06
STL importer plugin.
class TextureData
Texture data.
class TgaImageConverter
TGA image converter plugin.
class TgaImporter
TGA importer plugin.
class TinyGltfImporter
TinyGltf importer plugin.

Enums

enum class ImageConverterFeature: UnsignedByte { ConvertImage = 1 << 0, ConvertCompressedImage = 1 << 1, ConvertFile = 1 << 2, ConvertCompressedFile = 1 << 3, ConvertData = ConvertFile|(1 << 4), ConvertCompressedData = ConvertCompressedFile|(1 << 4) } new in 2020.06
Features supported by an image converter.
enum class ImageConverterFlag: UnsignedByte { Verbose = 1 << 0 } new in 2020.06
Image converter flag.
enum class ImporterFeature: UnsignedByte { OpenData = 1 << 0, OpenState = 1 << 1, FileCallback = 1 << 2 } new in 2020.06
Features supported by an importer.
enum class ImporterFlag: UnsignedByte { Verbose = 1 << 0 } new in 2020.06
Importer flag.
enum class SceneConverterFeature: UnsignedByte { ConvertMesh = 1 << 0, ConvertMeshInPlace = 1 << 1, ConvertMeshToFile = 1 << 2, ConvertMeshToData = ConvertMeshToFile|(1 << 3) } new in 2020.06
Features supported by a scene converter.
enum class SceneConverterFlag: UnsignedByte { Verbose = 1 << 0 } new in 2020.06
Scene converter flag.
enum class AnimationTrackType: UnsignedByte { Bool, Float, UnsignedInt, Int, BoolVector2, BoolVector3, BoolVector4, Vector2, Vector2ui, Vector2i, Vector3, Vector3ui, Vector3i, Vector4, Vector4ui, Vector4i, Complex, Quaternion, DualQuaternion, CubicHermite1D, CubicHermite2D, CubicHermite3D, CubicHermiteComplex, CubicHermiteQuaternion }
Type of animation track data.
enum class AnimationTrackTargetType: UnsignedByte { Translation2D, Translation3D, Rotation2D, Rotation3D, Scaling2D, Scaling3D, Custom = 128 }
Target of an animation track.
enum class CameraType: UnsignedByte { Orthographic2D, Orthographic3D, Perspective3D }
Camera type.
enum class DataFlag: UnsignedByte { Owned = 1 << 0, Mutable = 2 << 0 } new in 2020.06
Data flag.
enum class MaterialLayer: UnsignedInt { ClearCoat = 1 } new in Git master
Material layer name.
enum class MaterialAttribute: UnsignedInt { LayerName = 1, AlphaMask, AlphaBlend, DoubleSided, AmbientColor, AmbientTexture, AmbientTextureMatrix, AmbientTextureCoordinates, DiffuseColor, DiffuseTexture, DiffuseTextureMatrix, DiffuseTextureCoordinates, SpecularColor, SpecularTexture, SpecularTextureSwizzle, SpecularTextureMatrix, SpecularTextureCoordinates, Shininess, BaseColor, BaseColorTexture, BaseColorTextureMatrix, BaseColorTextureCoordinates, Metalness, MetalnessTexture, MetalnessTextureSwizzle, MetalnessTextureMatrix, MetalnessTextureCoordinates, Roughness, RoughnessTexture, RoughnessTextureSwizzle, RoughnessTextureMatrix, RoughnessTextureCoordinates, NoneRoughnessMetallicTexture, Glossiness, GlossinessTexture, GlossinessTextureSwizzle, GlossinessTextureMatrix, GlossinessTextureCoordinates, SpecularGlossinessTexture, NormalTexture, NormalTextureScale, NormalTextureSwizzle, NormalTextureMatrix, NormalTextureCoordinates, OcclusionTexture, OcclusionTextureStrength, OcclusionTextureSwizzle, OcclusionTextureMatrix, OcclusionTextureCoordinates, EmissiveColor, EmissiveTexture, EmissiveTextureMatrix, EmissiveTextureCoordinates, LayerFactor, LayerFactorTexture, LayerFactorTextureSwizzle, LayerFactorTextureMatrix, LayerFactorTextureCoordinates, TextureMatrix, TextureCoordinates } new in Git master
Material attribute name.
enum class MaterialTextureSwizzle: UnsignedInt { R = Utility::Endianness::fourCC('R', '\0', '\0', '\0'), G = Utility::Endianness::fourCC('G', '\0', '\0', '\0'), B = Utility::Endianness::fourCC('B', '\0', '\0', '\0'), A = Utility::Endianness::fourCC('A', '\0', '\0', '\0'), RG = Utility::Endianness::fourCC('R', 'G', '\0', '\0'), GB = Utility::Endianness::fourCC('G', 'B', '\0', '\0'), GA = Utility::Endianness::fourCC('G', 'A', '\0', '\0'), BA = Utility::Endianness::fourCC('B', 'A', '\0', '\0'), RGB = Utility::Endianness::fourCC('R', 'G', 'B', '\0'), GBA = Utility::Endianness::fourCC('G', 'B', 'A', '\0'), RGBA = Utility::Endianness::fourCC('R', 'G', 'B', 'A') } new in Git master
Material texture swizzle.
enum class MaterialAttributeType: UnsignedByte { Bool = 1, Float, Deg, Rad, UnsignedInt, Int, UnsignedLong, Long, Vector2, Vector2ui, Vector2i, Vector3, Vector3ui, Vector3i, Vector4, Vector4ui, Vector4i, Matrix2x2, Matrix2x3, Matrix2x4, Matrix3x2, Matrix3x3, Matrix3x4, Matrix4x2, Matrix4x3, Pointer, MutablePointer, String, TextureSwizzle } new in Git master
Material attribute type.
enum class MaterialType: UnsignedInt { Flat = 1 << 0, Phong = 1 << 1, PbrMetallicRoughness = 1 << 2, PbrSpecularGlossiness = 1 << 3, PbrClearCoat = 1 << 4 }
Material type.
enum class MaterialAlphaMode: UnsignedByte { Opaque, Mask, Blend }
Material alpha mode.
enum class MeshAttribute: UnsignedShort { Position = 1, Tangent, Bitangent, Normal, TextureCoordinates, Color, ObjectId, Custom = 32768 } new in 2020.06
Mesh attribute name.
enum class ObjectInstanceType2D: UnsignedByte { Camera, Mesh, Empty }
Type of instance held by given 2D object.
enum class ObjectFlag2D: UnsignedByte { HasTranslationRotationScaling = 1 << 0 }
2D object flag
enum class ObjectInstanceType3D: UnsignedByte { Camera, Light, Mesh, Empty }
Type of instance held by given 3D object.
enum class ObjectFlag3D: UnsignedByte { HasTranslationRotationScaling = 1 << 0 }
3D object flag

Typedefs

using ImageConverterFeatures = Containers::EnumSet<ImageConverterFeature> new in 2020.06
Features supported by an image converter.
using ImageConverterFlags = Containers::EnumSet<ImageConverterFlag> new in 2020.06
Image converter flags.
using ImporterFeatures = Containers::EnumSet<ImporterFeature> new in 2020.06
Set of features supported by an importer.
using ImporterFileCallbackPolicy = InputFileCallbackPolicy deprecated in 2019.10
Input file callback policy.
using ImporterFlags = Containers::EnumSet<ImporterFlag> new in 2020.06
Importer flags.
using AbstractMaterialData = MaterialData deprecated in Git master
Material data.
using SceneConverterFeatures = Containers::EnumSet<SceneConverterFeature> new in 2020.06
Features supported by a scene converter.
using SceneConverterFlags = Containers::EnumSet<SceneConverterFlag> new in 2020.06
Scene converter flags.
using DataFlags = Containers::EnumSet<DataFlag> new in 2020.06
Data flags.
using ImageData1D = ImageData<1>
One-dimensional image data.
using ImageData2D = ImageData<2>
Two-dimensional image data.
using ImageData3D = ImageData<3>
Three-dimensional image data.
using MaterialTypes = Containers::EnumSet<MaterialType> new in Git master
Material types.
using ObjectFlags2D = Containers::EnumSet<ObjectFlag2D>
2D object flags
using ObjectFlags3D = Containers::EnumSet<ObjectFlag3D>
3D object flags
using SkinData2D = SkinData<2> new in Git master
Two-dimensional skin data.
using SkinData3D = SkinData<3> new in Git master
Three-dimensional skin data.

Functions

auto operator<<(Debug& debug, ImageConverterFeature value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, ImageConverterFeatures value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, ImageConverterFlag value) -> Debug& new in 2020.06
Debug output operator.
auto operator<<(Debug& debug, ImageConverterFlags value) -> Debug& new in 2020.06
Debug output operator.
auto operator<<(Debug& debug, ImporterFeature value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, ImporterFeatures value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, ImporterFlag value) -> Debug& new in 2020.06
Debug output operator.
auto operator<<(Debug& debug, ImporterFlags value) -> Debug& new in 2020.06
Debug output operator.
auto operator<<(Debug& debug, SceneConverterFeature value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, SceneConverterFeatures value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, SceneConverterFlag value) -> Debug& new in 2020.06
Debug output operator.
auto operator<<(Debug& debug, SceneConverterFlags value) -> Debug& new in 2020.06
Debug output operator.
auto operator<<(Debug& debug, AnimationTrackType value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, AnimationTrackTargetType value) -> Debug&
Debug output operator.
template<class V, class R = Animation::ResultOf<V>>
auto animationInterpolatorFor(Animation::Interpolation interpolation) -> auto
Animation interpolator function for given interpolation behavior.
auto operator<<(Debug& debug, CameraType value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, DataFlag value) -> Debug& new in 2020.06
Debug output operator.
auto operator<<(Debug& debug, DataFlags value) -> Debug& new in 2020.06
Debug output operator.
auto operator<<(Debug& debug, LightData::Type value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, MaterialLayer value) -> Debug& new in Git master
Debug output operator.
auto operator<<(Debug& debug, MaterialAttribute value) -> Debug& new in Git master
Debug output operator.
auto materialTextureSwizzleComponentCount(MaterialTextureSwizzle swizzle) -> UnsignedInt new in Git master
Component count in a material texture swizzle.
auto operator<<(Debug& debug, MaterialTextureSwizzle value) -> Debug& new in Git master
Debug output operator.
auto materialAttributeTypeSize(MaterialAttributeType type) -> std::size_t new in Git master
Byte size of a material attribute type.
auto operator<<(Debug& debug, MaterialAttributeType value) -> Debug& new in Git master
Debug output operator.
auto operator<<(Debug& debug, MaterialType value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, MaterialTypes value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, MaterialAlphaMode value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, MaterialData::Flag value) -> Debug& deprecated in Git master
Debug output operator.
auto operator<<(Debug& debug, MaterialData::Flags value) -> Debug& deprecated in Git master
Debug output operator.
auto operator<<(Debug& debug, MeshAttribute value) -> Debug& new in 2020.06
Debug output operator.
auto isMeshAttributeCustom(MeshAttribute name) -> bool constexpr new in 2020.06
Whether a mesh attribute is custom.
auto meshAttributeCustom(UnsignedShort id) -> MeshAttribute constexpr new in 2020.06
Create a custom mesh attribute.
auto meshAttributeCustom(MeshAttribute name) -> UnsignedShort constexpr new in 2020.06
Get index of a custom mesh attribute.
auto meshAttributeDataNonOwningArray(Containers::ArrayView<const MeshAttributeData> view) -> Containers::Array<MeshAttributeData> new in 2020.06
Create a non-owning array of MeshAttributeData items.
auto operator<<(Debug& debug, ObjectInstanceType2D value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, ObjectFlag2D value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, ObjectFlags2D value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, ObjectInstanceType3D value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, ObjectFlag3D value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, ObjectFlags3D value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, PhongMaterialData::Flag value) -> Debug& deprecated in Git master
Debug output operator.
auto operator<<(Debug& debug, TextureData::Type value) -> Debug&
Debug output operator.

Enum documentation

enum class Magnum::Trade::ImageConverterFeature: UnsignedByte new in 2020.06

Features supported by an image converter.

Enumerators
ConvertImage

Conversion to image with different format with AbstractImageConverter::exportToImage()

ConvertCompressedImage

Conversion to compressed image with AbstractImageConverter::exportToCompressedImage()

ConvertFile

Exporting to file with AbstractImageConverter::exportToFile(const ImageView2D&, const std::string&)

ConvertCompressedFile

Exporting to file with AbstractImageConverter::exportToFile(const CompressedImageView2D&, const std::string&)

ConvertData

Exporting to raw data with AbstractImageConverter::exportToData(const ImageView2D&). Implies ImageConverterFeature::ConvertFile.

ConvertCompressedData

Exporting compressed image to raw data with AbstractImageConverter::exportToData(const CompressedImageView2D&). Implies ImageConverterFeature::ConvertCompressedFile.

enum class Magnum::Trade::ImageConverterFlag: UnsignedByte new in 2020.06

Image converter flag.

Enumerators
Verbose

Print verbose diagnostic during import. By default the importer only prints messages on error or when some operation might cause unexpected data modification or loss.

enum class Magnum::Trade::ImporterFeature: UnsignedByte new in 2020.06

Features supported by an importer.

Enumerators
OpenData

Opening files from raw data using AbstractImporter::openData()

OpenState

Opening already loaded state using AbstractImporter::openState()

FileCallback

Specifying callbacks for loading additional files referenced from the main file using AbstractImporter::setFileCallback(). If the importer * doesn't expose this feature, the format is either single-file or loading via callbacks is not supported.

See Loading data from memory, using file callbacks and particular importer documentation for more information.

enum class Magnum::Trade::ImporterFlag: UnsignedByte new in 2020.06

Importer flag.

Enumerators
Verbose

Print verbose diagnostic during import. By default the importer only prints messages on error or when some operation might cause unexpected data modification or loss.

enum class Magnum::Trade::SceneConverterFlag: UnsignedByte new in 2020.06

Scene converter flag.

Enumerators
Verbose

Print verbose diagnostic during import. By default the importer only prints messages on error or when some operation might cause unexpected data modification or loss.

enum class Magnum::Trade::AnimationTrackType: UnsignedByte

Type of animation track data.

Enumerators
Bool

bool

Float

Float

UnsignedInt

UnsignedInt

Int

Int

BoolVector2

Math::BoolVector<2>

BoolVector3

Math::BoolVector<3>

BoolVector4

Math::BoolVector<4>

Vector2

Vector2. Usually used for AnimationTrackTargetType::Translation2D and AnimationTrackTargetType::Scaling2D.

Vector2ui

Vector2ui

Vector2i

Vector2i

Vector3

Vector3. Usually used for AnimationTrackTargetType::Translation3D and AnimationTrackTargetType::Scaling3D.

Vector3ui

Vector3ui

Vector3i

Vector3i

Vector4

Vector4

Vector4ui

Vector4ui

Vector4i

Vector4i

Complex

Complex. Usually used for AnimationTrackTargetType::Rotation2D.

Quaternion

Quaternion. Usually used for AnimationTrackTargetType::Rotation3D.

DualQuaternion

DualQuaternion

CubicHermite1D

CubicHermite1D

CubicHermite2D

CubicHermite2D. Usually used for spline-interpolated AnimationTrackTargetType::Translation2D and AnimationTrackTargetType::Scaling2D.

CubicHermite3D

CubicHermite3D. Usually used for spline-interpolated AnimationTrackTargetType::Translation3D and AnimationTrackTargetType::Scaling3D.

CubicHermiteComplex

CubicHermiteComplex. Usually used for spline-interpolated AnimationTrackTargetType::Rotation2D.

CubicHermiteQuaternion

CubicHermiteQuaternion. Usually used for spline-interpolated AnimationTrackTargetType::Rotation3D.

enum class Magnum::Trade::AnimationTrackTargetType: UnsignedByte

Target of an animation track.

Enumerators
Translation2D

Modifies 2D object translation. Type is usually Vector2 or CubicHermite2D for spline-interpolated data.

Translation3D

Modifies 3D object translation. Type is usually Vector3 or CubicHermite3D for spline-interpolated data.

Rotation2D

Modifies 2D object rotation. Type is usually Complex or CubicHermiteComplex for spline-interpolated data.

Rotation3D

Modifies 3D object rotation. Type is usually Quaternion or CubicHermiteQuaternion for spline-interpolated data.

Scaling2D

Modifies 2D object scaling. Type is usually Vector2 or CubicHermite2D for spline-interpolated data.

Scaling3D

Modifies 3D object scaling. Type is usually Vector3 or CubicHermite3D for spline-interpolated data.

Custom

This and all higher values are for importer-specific targets. Can be of any type, AnimationData::trackTarget() might or might not point to an existing object. See documentation of a particular importer for details.

enum class Magnum::Trade::CameraType: UnsignedByte

Camera type.

Enumerators
Orthographic2D

2D orthographic camera

Orthographic3D

3D orthographic camera

Perspective3D

3D perspective camera

enum class Magnum::Trade::DataFlag: UnsignedByte new in 2020.06

Data flag.

Enumerators
Owned

Data is owned by the instance. If this flag is not set, the instance might be for example referencing a memory-mapped file or a constant memory.

Mutable

Data is mutable. If this flag is not set, the instance might be for example referencing a readonly memory-mapped file or a constant memory.

enum class Magnum::Trade::MaterialLayer: UnsignedInt new in Git master

Material layer name.

Convenience aliases to actual layer name strings. The alias is in the same form and capitalization — so for example MaterialLayer::ClearCoat is an alias for "ClearCoat". Each layer is expected to contain (a subset of) the MaterialAttribute::LayerName, MaterialAttribute::LayerFactor, MaterialAttribute::LayerFactorTexture, MaterialAttribute::LayerFactorTextureSwizzle, MaterialAttribute::LayerFactorTextureMatrix, MaterialAttribute::LayerFactorTextureCoordinates attributes in addition to what's specified for a particular named layer.

Enumerators
ClearCoat

Clear coat material layer.

Expected to contain (a subset of) the MaterialAttribute::Roughness, MaterialAttribute::RoughnessTexture, MaterialAttribute::RoughnessTextureSwizzle, MaterialAttribute::RoughnessTextureMatrix, MaterialAttribute::RoughnessTextureCoordinates, MaterialAttribute::NormalTexture, MaterialAttribute::NormalTextureSwizzle, MaterialAttribute::NormalTextureMatrix and MaterialAttribute::NormalTextureCoordinates attributes.

enum class Magnum::Trade::MaterialAttribute: UnsignedInt new in Git master

Material attribute name.

Convenience aliases to actual attribute name strings. In most cases the alias is in the same form and capitalization — so for example MaterialAttribute::DoubleSided is an alias for "DoubleSided", the only exception is MaterialAttribute::LayerName which is "$LayerName".

When this enum si used in MaterialAttributeData constructors, the data are additionally checked for type compatibility. Other than that, there is no difference to the string variants.

Enumerators
LayerName

Layer name, MaterialAttributeType::String.

Unlike other attributes where string name matches the enum name, in this case the corresponding string is "$LayerName", done in order to have the layer name attribute appear first in each layer and thus simplify layer implementation.

AlphaMask

Alpha mask, MaterialAttributeType::Float.

If set together with MaterialAttribute::AlphaBlend, blending is preferred, however renderers can fall back to alpha-masked rendering. Alpha values below this value are meant to be rendered as fully transparent and alpha values above this value as fully opaque.

AlphaBlend

Alpha blending, MaterialAttributeType::Bool.

If true, the material is expected to be rendered with blending enabled and in correct depth order. If false or not present, the material should be treated as opaque. If set together with MaterialAttribute::AlphaMask, blending is preferred, however renderers can fall back to alpha-masked rendering.

DoubleSided

Double sided, MaterialAttributeType::Bool.

If not present, the default value is false.

AmbientColor

Ambient color for Phong materials, MaterialAttributeType::Vector4.

If MaterialAttribute::AmbientTexture is present as well, these two are multiplied together.

AmbientTexture

Ambient texture index for Phong materials, MaterialAttributeType::UnsignedInt.

If MaterialAttribute::AmbientColor is present as well, these two are multiplied together.

AmbientTextureMatrix

Ambient texture transformation matrix for Phong materials, MaterialAttributeType::Matrix3x3.

Has a precedence over MaterialAttribute::TextureMatrix if both are present.

AmbientTextureCoordinates

Ambient texture coordinate set index for Phong materials, MaterialAttributeType::UnsignedInt.

Has a precedence over MaterialAttribute::TextureCoordinates if both are present.

DiffuseColor

Diffuse color for Phong or PBR specular/glossiness materials, MaterialAttributeType::Vector4.

If MaterialAttribute::DiffuseTexture is present as well, these two are multiplied together.

DiffuseTexture

Diffuse texture index for Phong or PBR specular/glossiness materials, MaterialAttributeType::UnsignedInt.

If MaterialAttribute::DiffuseColor is present as well, these two are multiplied together.

DiffuseTextureMatrix

Diffuse texture transformation matrix for Phong or PBR specular/glossiness materials, MaterialAttributeType::Matrix3x3.

Has a precedence over MaterialAttribute::TextureMatrix if both are present.

DiffuseTextureCoordinates

Diffuse texture coordinate set index for Phong or PBR specular/glossiness materials, MaterialAttributeType::UnsignedInt.

Has a precedence over MaterialAttribute::TextureCoordinates if both are present.

SpecularColor

Specular color for Phong or PBR specular/glossiness materials, MaterialAttributeType::Vector4. Alpha is commonly zero to not interfere with alpha-masked objects, non-zero alpha can be for example used to render transparent material which are still expected to have specular highlights such as glass or soap bubbles.

If MaterialAttribute::SpecularTexture or MaterialAttribute::SpecularGlossinessTexture is present as well, these two are multiplied together.

SpecularTexture

Specular texture index for Phong or PBR specular/glossiness materials, MaterialAttributeType::UnsignedInt.

If MaterialAttribute::SpecularColor is present as well, these two are multiplied together. Can be alternatively supplied as a packed MaterialAttribute::SpecularGlossinessTexture.

SpecularTextureSwizzle

Specular texture swizzle for Phong or PBR specular/glossiness materials, MaterialAttributeType::TextureSwizzle.

Can be used to describe whether the alpha channel of a MaterialAttribute::SpecularTexture is used or not. Either MaterialTextureSwizzle::RGBA or MaterialTextureSwizzle::RGB (which is the default) is expected. Does not apply to MaterialAttribute::SpecularGlossinessTexture — in that case, the specular texture is always three-channel, regardless of this attribute.

SpecularTextureMatrix

Specular texture transformation matrix for Phong or PBR specular/glossiness materials, MaterialAttributeType::Matrix3x3.

Has a precedence over MaterialAttribute::TextureMatrix if both are present.

SpecularTextureCoordinates

Specular texture coordinate set index for Phong or PBR specular/glossiness materials, MaterialAttributeType::UnsignedInt.

Has a precedence over MaterialAttribute::TextureCoordinates if both are present.

Shininess

Shininess value for Phong materials, MaterialAttributeType::Float.

BaseColor

Base color for PBR metallic/roughness materials, MaterialAttributeType::Vector4.

If MaterialAttribute::BaseColorTexture is present as well, these two are multiplied together.

BaseColorTexture

Base color texture index for PBR metallic/roughness materials, MaterialAttributeType::UnsignedInt.

If MaterialAttribute::BaseColor is present as well, these two are multiplied together.

BaseColorTextureMatrix

Base color texture transformation matrix for PBR metallic/roughness materials, MaterialAttributeType::Matrix3x3.

Has a precedence over MaterialAttribute::TextureMatrix if both are present.

BaseColorTextureCoordinates

Base color texture coordinate set index for PBR metallic/roughness materials, MaterialAttributeType::UnsignedInt.

Has a precedence over MaterialAttribute::TextureCoordinates if both are present.

Metalness

Metalness for PBR metallic/roughness materials, MaterialAttributeType::Float.

If MaterialAttribute::MetalnessTexture or MaterialAttribute::NoneRoughnessMetallicTexture is present as well, these two are multiplied together.

MetalnessTexture

Metalness texture index for PBR metallic/roughness materials, MaterialAttributeType::UnsignedInt.

If MaterialAttribute::Metalness is present as well, these two are multiplied together. Can be alternatively supplied as a packed MaterialAttribute::NoneRoughnessMetallicTexture.

MetalnessTextureSwizzle

Metalness texture swizzle for PBR metallic/roughness materials, MaterialAttributeType::TextureSwizzle.

Can be used to express arbitrary packing of MaterialAttribute::MetalnessTexture together with other maps in a single texture. A single-channel swizzle value is expected. If not present, MaterialTextureSwizzle::R is assumed. Does not apply to MaterialAttribute::NoneRoughnessMetallicTexture — in that case, the metalness is implicitly in the red channel regardless of this attribute.

MetalnessTextureMatrix

Metalness texture transformation matrix for PBR metallic/roughness materials, MaterialAttributeType::Matrix3x3.

Has a precedence over MaterialAttribute::TextureMatrix if both are present.

MetalnessTextureCoordinates

Metalness texture coordinate set index for PBR metallic/roughness materials, MaterialAttributeType::UnsignedInt.

Has a precedence over MaterialAttribute::TextureCoordinates if both are present.

Roughness

Roughness for PBR metallic/roughness materials, MaterialAttributeType::Float.

If MaterialAttribute::RoughnessTexture or MaterialAttribute::NoneRoughnessMetallicTexture is present as well, these two are multiplied together.

RoughnessTexture

Roughness texture index for PBR metallic/roughness materials, MaterialAttributeType::UnsignedInt.

If MaterialAttribute::Roughness is present as well, these two are multiplied together. Can be alternatively supplied as a packed MaterialAttribute::NoneRoughnessMetallicTexture.

RoughnessTextureSwizzle

Roughness texture swizzle for PBR metallic/roughness materials, MaterialAttributeType::TextureSwizzle.

Can be used to express arbitrary packing of MaterialAttribute::RoughnessTexture together with other maps in a single texture. A single-channel swizzle value is expected. If not present, MaterialTextureSwizzle::R is assumed. Does not apply to MaterialAttribute::NoneRoughnessMetallicTexture — in that case, the metalness is implicitly in the green channel regardless of this attribute.

RoughnessTextureMatrix

Roughness texture transformation matrix for PBR metallic/roughness materials, MaterialAttributeType::Matrix3x3.

Has a precedence over MaterialAttribute::TextureMatrix if both are present.

RoughnessTextureCoordinates

Roughness texture coordinate set index for PBR metallic/roughness materials, MaterialAttributeType::UnsignedInt.

Has a precedence over MaterialAttribute::TextureCoordinates if both are present.

NoneRoughnessMetallicTexture

Combined roughness/metallic texture index for PBR metallic/roughness materials with metalness in the blue channel and roughness in the green channel, MaterialAttributeType::UnsignedInt.

If MaterialAttribute::Metalness / MaterialAttribute::Roughness is present as well, these two are multiplied together.

This is a convenience alias to simplify representation of glTF and UE4 materials, which is where this packing is used (rationale). This packing (and other variants) can be alternatively specified as a pair of MaterialAttribute::RoughnessTexture / MaterialAttribute::MetalnessTexture attributes together with MaterialAttribute::RoughnessTextureSwizzle set to MaterialTextureSwizzle::G and MaterialAttribute::MetalnessTextureSwizzle set to MaterialTextureSwizzle::B. Texture transformation and coordinate set, if needed, have to be specified either using the global MaterialAttribute::TextureMatrix and MaterialAttribute::TextureCoordinates attributes or the per-texture MaterialAttribute::RoughnessTextureMatrix, MaterialAttribute::MetalnessTextureMatrix, MaterialAttribute::RoughnessTextureCoordinates and MaterialAttribute::MetalnessTextureCoordinates variants.

Glossiness

Glossiness for PBR specular/glossiness materials, MaterialAttributeType::Float.

If MaterialAttribute::GlossinessTexture or MaterialAttribute::SpecularGlossinessTexture is present as well, these two are multiplied together.

GlossinessTexture

Glossiness texture index for PBR specular/glossiness materials, MaterialAttributeType::UnsignedInt.

If MaterialAttribute::Glossiness is present as well, these two are multiplied together. Can be alternatively supplied as a packed MaterialAttribute::SpecularGlossinessTexture.

GlossinessTextureSwizzle

Glossiness texture swizzle for PBR specular/glossiness materials, MaterialAttributeType::TextureSwizzle.

Can be used to express arbitrary packing of MaterialAttribute::GlossinessTexture together with other maps in a single texture. A single-channel swizzle value is expected. If not present, MaterialTextureSwizzle::R is assumed. Does not apply to MaterialAttribute::SpecularGlossinessTexture — in that case, the glossiness is implicitly in the alpha channel regardless of this attribute.

GlossinessTextureMatrix

Glossiness texture transformation matrix for PBR specular/glossiness materials, MaterialAttributeType::Matrix3x3.

Has a precedence over MaterialAttribute::TextureMatrix if both are present.

GlossinessTextureCoordinates

Glossiness texture coordinate set index for PBR specular/glossiness materials, MaterialAttributeType::UnsignedInt.

Has a precedence over MaterialAttribute::TextureCoordinates if both are present.

SpecularGlossinessTexture

Combined specular/glossiness texture index for PBR specular/glossiness materials with specular color in the RGB channels and glossiness in alpha, MaterialAttributeType::UnsignedInt.

If MaterialAttribute::SpecularColor / MaterialAttribute::Glossiness is present as well, these two are multiplied together. Can be alternatively specified as a pair of MaterialAttribute::SpecularTexture / MaterialAttribute::GlossinessTexture attributes together with MaterialAttribute::GlossinessTextureSwizzle set to MaterialTextureSwizzle::A. Texture transformation and coordinate set, if needed, have to be specified either using the global MaterialAttribute::TextureMatrix and MaterialAttribute::TextureCoordinates attributes or the per-texture MaterialAttribute::SpecularTextureMatrix, MaterialAttribute::GlossinessTextureMatrix, MaterialAttribute::SpecularTextureCoordinates and MaterialAttribute::GlossinessTextureCoordinates variants.

NormalTexture

Tangent-space normal map texture index, MaterialAttributeType::UnsignedInt.

If MaterialAttribute::NormalTextureScale is present as well, these two are multiplied together, affecting strength of the effect. The scale $ s $ multiplies the XY channels of a normal $ \boldsymbol{n}' $ fetched from (usually) an unsigned normal texture $ \boldsymbol{t}_n $ . The result is renormalized again after to form the final normal $ \boldsymbol{n} $ :

\[ \begin{array}{rcl} \boldsymbol{n}' & = & (2 \boldsymbol{t}_n - \boldsymbol{1}) (s, s, 1)^T \\ \boldsymbol{n}\phantom{'} & = & \frac{\boldsymbol{n}'}{|\boldsymbol{n}'|} \end{array} \]
NormalTextureScale

Normal texture scale, MaterialAttributeType::Float.

Scales the texture defined by MaterialAttribute::NormalTexture, see above for details.

NormalTextureSwizzle

Normal texture swizzle, MaterialAttributeType::TextureSwizzle.

Can be used to express arbitrary packing together with other maps in a single texture. A two- or three-channel swizzle value is expected. If not present, MaterialTextureSwizzle::RGB is assumed.

If the texture is just two-component, the remaining component is implicit and calculated as $ z = \sqrt{1 - x^2 - y^2} $ . In order to account for numeric issues and avoid negative values under the square root, it's commonly done as $ z = \sqrt{\max(0, 1 - x^2 - y^2)} $ . Additionally, to mitigate artifacts when storing normal texture in a compressed format, MaterialTextureSwizzle::GA may get used instead of MaterialTextureSwizzle::RG.

Shader code that is able to reconstruct a XYZ normal from both RG and GA variants assuming constant values in other channels (source):

/* Assumes (1, y, 1, x) or (x, y, <anything>, 1) */
vec3 unpackTwoChannelNormal(vec4 packed) {
    packed.x *= packed.w;

    /* reconstruct Z */
    vec3 normal;
    normal.xy = packed.xy*2.0 - 1.0;
    normal.z = sqrt(max(0.0, 1.0 - dot(normal.xy,
                                       normal.xy)));
    return normal;
}
NormalTextureMatrix

Normal texture transformation matrix, MaterialAttributeType::Matrix3x3.

Has a precedence over MaterialAttribute::TextureMatrix if both are present.

NormalTextureCoordinates

Normal texture coordinate set index, MaterialAttributeType::UnsignedInt.

Has a precedence over MaterialAttribute::TextureCoordinates if both are present.

OcclusionTexture

Occlusion texture index, MaterialAttributeType::UnsignedInt.

Single-channel texture that multiplies the resulting material color $ \boldsymbol{c} $ :

\[ \boldsymbol{c}_o = o \boldsymbol{c} \]

If MaterialAttribute::OcclusionTextureStrength is present as well, it's used as an interpolation factor $ \color{m-success} s $ between material color $ \boldsymbol{c} $ and color with occlusion applied $ o \boldsymbol{c} $ :

\[ \boldsymbol{c}_o = \operatorname{lerp}(\boldsymbol{c}, o \boldsymbol{c}, {\color{m-success} s}) = \boldsymbol{c} (1 - {\color{m-success} s}) + o \boldsymbol{c} {\color{m-success} s} \]
OcclusionTextureStrength

Occlusion texture strength, MaterialAttributeType::Float.

Affects the texture defined by MaterialAttribute::OcclusionTexture, see above for details.

OcclusionTextureSwizzle

Occlusion texture swizzle, MaterialAttributeType::TextureSwizzle.

Can be used to express arbitrary packing together with other maps in a single texture. A single-channel swizzle value is expected. If not present, MaterialTextureSwizzle::R is assumed.

OcclusionTextureMatrix

Occlusion texture transformation matrix, MaterialAttributeType::Matrix3x3.

Has a precedence over MaterialAttribute::TextureMatrix if both are present.

OcclusionTextureCoordinates

Occlusion texture coordinate set index, MaterialAttributeType::UnsignedInt.

Has a precedence over MaterialAttribute::TextureCoordinates if both are present.

EmissiveColor

Emissive color, MaterialAttributeType::Vector3.

If MaterialAttribute::EmissiveTexture is present as well, these two are multiplied together.

EmissiveTexture

Emissive texture index, MaterialAttributeType::UnsignedInt.

If MaterialAttribute::EmissiveColor is present as well, these two are multiplied together.

EmissiveTextureMatrix

Emissive texture transformation matrix, MaterialAttributeType::Matrix3x3.

Has a precedence over MaterialAttribute::TextureMatrix if both are present.

EmissiveTextureCoordinates

Emissive texture coordinate set index, MaterialAttributeType::UnsignedInt.

Has a precedence over MaterialAttribute::TextureCoordinates if both are present.

LayerFactor

Layer intensity. MaterialAttributeType::Float.

Expected to be contained in additional layers, not the base material. The exact semantic of this attribute is layer-specific. If MaterialAttribute::LayerFactorTexture is present as well, these two are multiplied together.

LayerFactorTexture

Layer intensity texture, MaterialAttributeType::UnsignedInt.

Expected to be contained in additional layers, not the base material. The exact semantic of this attribute is layer-specific. If MaterialAttribute::LayerFactor is present as well, these two are multiplied together.

LayerFactorTextureSwizzle

Layer intensity texture swizzle, MaterialAttributeType::TextureSwizzle.

Can be used to express arbitrary packing together with other maps in a single texture. A single-channel swizzle value is expected. If not present, MaterialTextureSwizzle::R is assumed.

LayerFactorTextureMatrix

Layer intensity texture transformation matrix, MaterialAttributeType::Matrix3x3.

Expected to be contained in additional layers, not the base material. Has a precedence over MaterialAttribute::TextureMatrix if both are present.

LayerFactorTextureCoordinates

Layer intensity texture coordinate set index, MaterialAttributeType::UnsignedInt.

Expected to be contained in additional layers, not the base material. Has a precedence over MaterialAttribute::TextureCoordinates if both are present.

TextureMatrix

Common texture transformation matrix for all textures, MaterialAttributeType::Matrix3x3.

MaterialAttribute::AmbientTextureMatrix / MaterialAttribute::DiffuseTextureMatrix / MaterialAttribute::SpecularTextureMatrix / MaterialAttribute::MetalnessTextureMatrix / MaterialAttribute::RoughnessTextureMatrix / MaterialAttribute::GlossinessTextureMatrix / MaterialAttribute::NormalTextureMatrix / MaterialAttribute::OcclusionTextureMatrix / MaterialAttribute::EmissiveTextureMatrix / MaterialAttribute::LayerFactorTextureMatrix have a precedence over this attribute for given texture, if present.

TextureCoordinates

Common texture coordinate set index for all textures, MaterialAttributeType::UnsignedInt.

MaterialAttribute::AmbientTextureCoordinates / MaterialAttribute::DiffuseTextureCoordinates / MaterialAttribute::SpecularTextureCoordinates / MaterialAttribute::MetalnessTextureCoordinates / MaterialAttribute::RoughnessTextureCoordinates / MaterialAttribute::GlossinessTextureCoordinates / MaterialAttribute::NormalTextureCoordinates / MaterialAttribute::OcclusionTextureCoordinates / MaterialAttribute::EmissiveTextureCoordinates / MaterialAttribute::LayerFactorTextureCoordinates have a precedence over this attribute for given texture, if present.

enum class Magnum::Trade::MaterialTextureSwizzle: UnsignedInt new in Git master

Material texture swizzle.

See MaterialData for more information.

Enumerators
R

Red component

G

Green component

B

Blue component

A

Alpha component

RG

Red and green component

GB

Green and blue component

GA

Green and alpha component. May get used to mitigate artifacts when storing two independent channels (such as two-channel normal maps) in compressed texture formats — these commonly have separately compressed RGB and alpha, with green channel having the most precision of the RGB triplet.

BA

Blue and alpha component

RGB

RGB components

GBA

GBA components

RGBA

RGBA components

enum class Magnum::Trade::MaterialAttributeType: UnsignedByte new in Git master

Material attribute type.

See MaterialData for more information.

Enumerators
Bool

bool

Float

Float

Deg

Deg

Rad

Rad

UnsignedInt

UnsignedInt

Int

Int

UnsignedLong

UnsignedLong

Long

Long

Vector2

Vector2

Vector2ui

Vector2ui

Vector2i

Vector2i

Vector3

Vector3

Vector3ui

Vector3ui

Vector3i

Vector3i

Vector4

Vector4

Vector4ui

Vector4ui

Vector4i

Vector4i

Matrix2x2

Matrix2x2

Matrix2x3

Matrix2x3

Matrix2x4

Matrix2x4

Matrix3x2

Matrix3x2

Matrix3x3

Matrix3x3

Matrix3x4

Matrix3x4

Matrix4x2

Matrix4x2

Matrix4x3

Matrix4x3

Pointer

const void*, type is not preserved. For convenience it's possible to retrieve the value by calling attribute<const T>() with an arbitrary T but the user has to ensure the type is correct.

MutablePointer

void*, type is not preserved. For convenience it's possible to retrieve the value by calling attribute<T>() with an arbitrary T but the user has to ensure the type is correct.

String

Null-terminated string. Can be stored using any type convertible to Corrade::Containers::StringView, retrieval has to be done using Corrade::Containers::StringView.

TextureSwizzle

One of the values from MaterialTextureSwizzle

enum class Magnum::Trade::MaterialType: UnsignedInt

Material type.

Enumerators
Flat

Flat. Use FlatMaterialData for convenience attribute access. Materials of this type are generally not combined with any other types.

Phong

Phong. Use PhongMaterialData for convenience attribute access.

PbrMetallicRoughness

PBR metallic/roughness. Use PbrMetallicRoughnessMaterialData for convenience attribute access.

PbrSpecularGlossiness

PBR specular/glossiness. Use PbrSpecularGlossinessMaterialData for convenience attribute access.

PbrClearCoat

PBR clear coat layer. Use PbrClearCoatMaterialData for convenience attribute access.

enum class Magnum::Trade::MaterialAlphaMode: UnsignedByte

Material alpha mode.

Convenience access to MaterialAttribute::AlphaBlend and MaterialAttribute::AlphaMask attributes.

Enumerators
Opaque

Alpha value is ignored and the rendered output is fully opaque.

Mask

The rendered output is either fully transparent or fully opaque, depending on the alpha value and specified MaterialData::alphaMask() value.

Blend

The alpha value is used to combine source and destination colors using additive blending.

enum class Magnum::Trade::MeshAttribute: UnsignedShort new in 2020.06

Mesh attribute name.

Enumerators
Position

Position. Type is usually VertexFormat::Vector2 for 2D and VertexFormat::Vector3 for 3D, but can be also any of VertexFormat::Vector2h, VertexFormat::Vector3h, VertexFormat::Vector2ub, VertexFormat::Vector2ubNormalized, VertexFormat::Vector2b, VertexFormat::Vector2bNormalized, VertexFormat::Vector2us, VertexFormat::Vector2usNormalized, VertexFormat::Vector2s, VertexFormat::Vector2sNormalized, VertexFormat::Vector3ub, VertexFormat::Vector3ubNormalized, VertexFormat::Vector3b, VertexFormat::Vector3bNormalized, VertexFormat::Vector3us, VertexFormat::Vector3usNormalized, VertexFormat::Vector3s or VertexFormat::Vector3sNormalized. Corresponds to Shaders::Generic::Position.

Tangent

Tangent, optionally including bitangent sign. In the first case the type is usually VertexFormat::Vector3, but can be also VertexFormat::Vector3h, VertexFormat::Vector3bNormalized or VertexFormat::Vector3sNormalized; in the second case the type is VertexFormat::Vector4 (or VertexFormat::Vector4h, VertexFormat::Vector4bNormalized, VertexFormat::Vector4sNormalized) and the fourth component is a sign value (-1.0f or +1.0f) defining handedness of the tangent basis. Reconstruct the MeshAttribute::Bitangent can be then done like this:

Vector3 bitangent = Math::cross(normal, tangent.xyz())*tangent.w();

Corresponds to Shaders::Generic::Tangent or Shaders::Generic::Tangent4.

Bitangent

Bitangent. Type is usually VertexFormat::Vector3, but can be also VertexFormat::Vector3h, VertexFormat::Vector3bNormalized or VertexFormat::Vector3sNormalized. For better storage efficiency, the bitangent can be also reconstructed from the normal and tangent, see MeshAttribute::Tangent for more information. Corresponds to Shaders::Generic::Bitangent.

Normal

Normal. Type is usually VertexFormat::Vector3, but can be also VertexFormat::Vector3h. VertexFormat::Vector3bNormalized or VertexFormat::Vector3sNormalized. Corresponds to Shaders::Generic::Normal.

TextureCoordinates

Texture coordinates. Type is usually VertexFormat::Vector2 for 2D coordinates, but can be also any of VertexFormat::Vector2h, VertexFormat::Vector2ub, VertexFormat::Vector2ubNormalized, VertexFormat::Vector2b, VertexFormat::Vector2bNormalized, VertexFormat::Vector2us, VertexFormat::Vector2usNormalized, VertexFormat::Vector2s or VertexFormat::Vector2sNormalized. Corresponds to Shaders::Generic::TextureCoordinates.

Color

Vertex color. Type is usually VertexFormat::Vector3 or VertexFormat::Vector4, but can be also any of VertexFormat::Vector3h, VertexFormat::Vector4h, VertexFormat::Vector3ubNormalized, VertexFormat::Vector3usNormalized, VertexFormat::Vector4ubNormalized or VertexFormat::Vector4usNormalized. Corresponds to Shaders::Generic::Color3 or Shaders::Generic::Color4.

ObjectId

(Instanced) object ID for editor selection or scene annotation. Type is usually VertexFormat::UnsignedInt, but can be also VertexFormat::UnsignedShort or VertexFormat::UnsignedByte. Corresponds to Shaders::Generic::ObjectId.

Custom

This and all higher values are for importer-specific attributes. Can be of any type. See documentation of a particular importer for details.

enum class Magnum::Trade::ObjectInstanceType2D: UnsignedByte

Type of instance held by given 2D object.

Enumerators
Camera

Camera instance (see CameraData)

Mesh

Mesh instance. The data can be cast to MeshObjectData2D to provide more information.

Empty

Empty

enum class Magnum::Trade::ObjectFlag2D: UnsignedByte

2D object flag

Enumerators
HasTranslationRotationScaling

The object provides separate translation / rotation / scaling properties. The ObjectData2D::transformation() matrix returns them combined, but it's possible to access particular parts of the transformation using ObjectData2D::translation(), ObjectData2D::rotation() and ObjectData2D::scaling().

enum class Magnum::Trade::ObjectInstanceType3D: UnsignedByte

Type of instance held by given 3D object.

Enumerators
Camera

Camera instance (see CameraData)

Light

Light instance (see LightData)

Mesh

Mesh instance. The data can be cast to MeshObjectData3D to provide more information.

Empty

Empty

enum class Magnum::Trade::ObjectFlag3D: UnsignedByte

3D object flag

Enumerators
HasTranslationRotationScaling

The object provides separate translation / rotation / scaling properties. The ObjectData3D::transformation() matrix returns them combined, but it's possible to access particular parts of the transformation using ObjectData3D::translation(), ObjectData3D::rotation() and ObjectData3D::scaling().

Typedef documentation

typedef Containers::EnumSet<ImporterFeature> Magnum::Trade::ImporterFeatures new in 2020.06

Set of features supported by an importer.

typedef ImageData<1> Magnum::Trade::ImageData1D

One-dimensional image data.

typedef ImageData<2> Magnum::Trade::ImageData2D

Two-dimensional image data.

typedef ImageData<3> Magnum::Trade::ImageData3D

Three-dimensional image data.

typedef Containers::EnumSet<ObjectFlag2D> Magnum::Trade::ObjectFlags2D

2D object flags

typedef Containers::EnumSet<ObjectFlag3D> Magnum::Trade::ObjectFlags3D

3D object flags

typedef SkinData<2> Magnum::Trade::SkinData2D new in Git master

Two-dimensional skin data.

typedef SkinData<3> Magnum::Trade::SkinData3D new in Git master

Three-dimensional skin data.

Function documentation

Debug& Magnum::Trade::operator<<(Debug& debug, ImageConverterFeature value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, ImageConverterFeatures value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, ImageConverterFlag value) new in 2020.06

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, ImageConverterFlags value) new in 2020.06

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, ImporterFeature value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, ImporterFeatures value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, ImporterFlag value) new in 2020.06

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, ImporterFlags value) new in 2020.06

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, SceneConverterFeature value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, SceneConverterFeatures value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, SceneConverterFlag value) new in 2020.06

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, SceneConverterFlags value) new in 2020.06

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, AnimationTrackType value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, AnimationTrackTargetType value)

Debug output operator.

template<class V, class R = Animation::ResultOf<V>>
auto Magnum::Trade::animationInterpolatorFor(Animation::Interpolation interpolation)

Animation interpolator function for given interpolation behavior.

To be used from importer plugins — wrapper around Animation::interpolatorFor(), guaranteeing that the returned function pointer is not instantiated inside the plugin binary to avoid dangling function pointers on plugin unload.

Debug& Magnum::Trade::operator<<(Debug& debug, CameraType value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, DataFlag value) new in 2020.06

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, DataFlags value) new in 2020.06

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, LightData::Type value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, MaterialLayer value) new in Git master

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, MaterialAttribute value) new in Git master

Debug output operator.

UnsignedInt Magnum::Trade::materialTextureSwizzleComponentCount(MaterialTextureSwizzle swizzle) new in Git master

Component count in a material texture swizzle.

Returns for example 2 for MaterialTextureSwizzle::GA.

Debug& Magnum::Trade::operator<<(Debug& debug, MaterialTextureSwizzle value) new in Git master

Debug output operator.

std::size_t Magnum::Trade::materialAttributeTypeSize(MaterialAttributeType type) new in Git master

Byte size of a material attribute type.

Can't be used with MaterialAttributeType::String, as the size varies depending on the value.

Debug& Magnum::Trade::operator<<(Debug& debug, MaterialAttributeType value) new in Git master

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, MaterialType value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, MaterialTypes value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, MaterialAlphaMode value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, MaterialData::Flag value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, MaterialData::Flags value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, MeshAttribute value) new in 2020.06

Debug output operator.

bool Magnum::Trade::isMeshAttributeCustom(MeshAttribute name) constexpr new in 2020.06

Whether a mesh attribute is custom.

Returns true if name has a value larger or equal to MeshAttribute::Custom, false otherwise.

MeshAttribute Magnum::Trade::meshAttributeCustom(UnsignedShort id) constexpr new in 2020.06

Create a custom mesh attribute.

Returns a custom mesh attribute with index id. The index is expected to be less than the value of MeshAttribute::Custom. Use meshAttributeCustom(MeshAttribute) to get the index back.

UnsignedShort Magnum::Trade::meshAttributeCustom(MeshAttribute name) constexpr new in 2020.06

Get index of a custom mesh attribute.

Inverse to meshAttributeCustom(UnsignedShort). Expects that the attribute is custom.

Containers::Array<MeshAttributeData> Magnum::Trade::meshAttributeDataNonOwningArray(Containers::ArrayView<const MeshAttributeData> view) new in 2020.06

Create a non-owning array of MeshAttributeData items.

Useful when you have the attribute definitions statically defined (for example when the vertex data themselves are already defined at compile time) and don't want to allocate just to pass those to MeshData.

Debug& Magnum::Trade::operator<<(Debug& debug, ObjectInstanceType2D value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, ObjectFlag2D value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, ObjectFlags2D value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, ObjectInstanceType3D value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, ObjectFlag3D value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, ObjectFlags3D value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, PhongMaterialData::Flag value)

Debug output operator.

Debug& Magnum::Trade::operator<<(Debug& debug, TextureData::Type value)

Debug output operator.