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 MAGNUM_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 and magnum-sceneconverter 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 new in 2020.06
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 AstcImporter new in Git master
ASTC importer plugin.
class BasisImageConverter new in 2019.10
Basis Universal image converter plugin.
class BasisImporter new in 2019.10
Basis Universal importer plugin.
class BcDecImageConverter new in Git master
BCn-compressed image decoding using bcdec.
class CameraData
Camera data.
class CgltfImporter deprecated in Git master
glTF importer plugin
class DdsImporter
DDS image importer plugin.
class DevIlImageImporter
DevIL Image importer plugin.
class EtcDecImageConverter new in Git master
ETC/EAC-compressed image decoding using etcdec.
class FlatMaterialData new in Git master
Flat material data.
class GltfImporter new in Git master
glTF importer plugin
class GltfSceneConverter new in Git master
glTF converter plugin
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 KtxImageConverter new in Git master
KTX2 image converter plugin.
class KtxImporter new in Git master
KTX2 image 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 deprecated in Git master
Two-dimensional mesh object data.
class MeshObjectData3D deprecated in Git master
Three-dimensional mesh object data.
class MeshOptimizerSceneConverter new in 2020.06
MeshOptimizer converter plugin.
class MiniExrImageConverter
OpenEXR image converter plugin using miniexr.
class ObjectData2D deprecated in Git master
Two-dimensional object data.
class ObjectData3D deprecated in Git master
Three-dimensional object data.
class ObjImporter
OBJ importer plugin.
class OpenExrImageConverter new in Git master
OpenEXR image converter plugin.
class OpenExrImporter new in Git master
OpenEXR 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.
class SceneFieldData new in Git master
Scene field data.
template<UnsignedInt dimensions>
class SkinData new in Git master
Skin data.
class SpngImporter new in Git master
PNG importer plugin using libspng.
class StanfordImporter
Stanford PLY importer plugin.
class StanfordSceneConverter new in 2020.06
Stanford PLY converter plugin.
class StbDxtImageConverter new in Git master
BC1/BC3 compressor using stb_dxt.
class StbImageConverter
Image converter plugin using stb_image_write.
class StbImageImporter
Image importer plugin using stb_image.
class StbResizeImageConverter new in Git master
Image resizing using stb_image_resize.
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 deprecated in Git master
TinyGltf importer plugin.
class UfbxImporter new in Git master
FBX and OBJ importer using ufbx.
class WebPImageConverter new in Git master
WebP image converter plugin.
class WebPImporter new in Git master
WebP importer plugin.

Enums

enum class ImageConverterFeature: UnsignedInt { Convert1D = 1 << 0 new in Git master, Convert2D = 1 << 1 new in Git master, ConvertImage = Convert2D deprecated in Git master, ConvertCompressedImage = Convert2D deprecated in Git master, Convert3D = 1 << 3 new in Git master, ConvertCompressed1D = 1 << 4 new in Git master, ConvertCompressed2D = 1 << 5 new in Git master, ConvertCompressed3D = 1 << 6 new in Git master, Convert1DToFile = 1 << 7 new in Git master, Convert2DToFile = 1 << 8 new in Git master, ConvertFile = Convert2DToFile deprecated in Git master, Convert3DToFile = 1 << 9 new in Git master, ConvertCompressed1DToFile = 1 << 10 new in Git master, ConvertCompressed2DToFile = 1 << 11 new in Git master, ConvertCompressedFile = ConvertCompressed2DToFile deprecated in Git master, ConvertCompressed3DToFile = 1 << 12 new in Git master, Convert1DToData = Convert1DToFile|(1 << 13) new in Git master, Convert2DToData = Convert2DToFile|(1 << 13) new in Git master, ConvertData = Convert2DToData deprecated in Git master, Convert3DToData = Convert3DToFile|(1 << 13) new in Git master, ConvertCompressed1DToData = ConvertCompressed1DToFile|(1 << 13) new in Git master, ConvertCompressed2DToData = ConvertCompressed2DToFile|(1 << 13) new in Git master, ConvertCompressedData = ConvertCompressed2DToData deprecated in Git master, ConvertCompressed3DToData = ConvertCompressed3DToFile|(1 << 13) new in Git master, Levels = 1 << 14 new in Git master, ConvertLevels1DToFile = Convert1DToFile|Levels deprecated in Git master, ConvertLevels2DToFile = Convert2DToFile|Levels deprecated in Git master, ConvertLevels3DToFile = Convert3DToFile|Levels deprecated in Git master, ConvertCompressedLevels1DToFile = ConvertCompressed1DToFile|Levels deprecated in Git master, ConvertCompressedLevels2DToFile = ConvertCompressed2DToFile|Levels deprecated in Git master, ConvertCompressedLevels3DToFile = ConvertCompressed3DToFile|Levels deprecated in Git master, ConvertLevels1DToData = Convert1DToData|Levels deprecated in Git master, ConvertLevels2DToData = Convert2DToData|Levels deprecated in Git master, ConvertLevels3DToData = Convert3DToData|Levels deprecated in Git master, ConvertCompressedLevels1DToData = ConvertCompressed1DToData|Levels deprecated in Git master, ConvertCompressedLevels2DToData = ConvertCompressed2DToData|Levels deprecated in Git master, ConvertCompressedLevels3DToData = ConvertCompressed3DToData|Levels deprecated in Git master } new in 2020.06
Features supported by an image converter.
enum class ImageConverterFlag: UnsignedByte { Quiet = 1 << 1 new in Git master, 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 { Quiet = 1 << 1 new in Git master, Verbose = 1 << 0 } new in 2020.06
Importer flag.
enum class SceneConverterFeature: UnsignedInt { ConvertMesh = 1 << 0, ConvertMeshInPlace = 1 << 1, ConvertMeshToFile = 1 << 2, ConvertMeshToData = ConvertMeshToFile|(1 << 3), ConvertMultiple = 1 << 4 new in Git master, ConvertMultipleToFile = 1 << 5 new in Git master, ConvertMultipleToData = ConvertMultipleToFile|(1 << 6) new in Git master, AddScenes = 1 << 7 new in Git master, AddAnimations = 1 << 8 new in Git master, AddLights = 1 << 9 new in Git master, AddCameras = 1 << 10 new in Git master, AddSkins2D = 1 << 11 new in Git master, AddSkins3D = 1 << 12 new in Git master, AddMeshes = 1 << 13 new in Git master, AddMaterials = 1 << 14 new in Git master, AddTextures = 1 << 15 new in Git master, AddImages1D = 1 << 16 new in Git master, AddImages2D = 1 << 17 new in Git master, AddImages3D = 1 << 18 new in Git master, AddCompressedImages1D = 1 << 19 new in Git master, AddCompressedImages2D = 1 << 20 new in Git master, AddCompressedImages3D = 1 << 21 new in Git master, MeshLevels = 1 << 22 new in Git master, ImageLevels = 1 << 23 new in Git master } new in 2020.06
Features supported by a scene converter.
enum class SceneConverterFlag: UnsignedByte { Quiet = 1 << 1, Verbose = 1 << 0 } new in 2020.06
Scene converter flag.
enum class SceneContent: UnsignedInt { Scenes = 1 << 0, Animations = 1 << 1, Lights = 1 << 2, Cameras = 1 << 3, Skins2D = 1 << 4, Skins3D = 1 << 5, Meshes = 1 << 6, Materials = 1 << 7, Textures = 1 << 8, Images1D = 1 << 9, Images2D = 1 << 10, Images3D = 1 << 11, MeshLevels = 1 << 12, ImageLevels = 1 << 13, Names = 1 << 14 } new in Git master
Scene content.
enum class AnimationTrackType: UnsignedByte { Bool = 1, Float, UnsignedInt, Int, BitVector2 new in Git master, BoolVector2 = BitVector2 deprecated in Git master, BitVector3 new in Git master, BoolVector3 = BitVector3 deprecated in Git master, BitVector4 new in Git master, BoolVector4 = BitVector4 deprecated in Git master, Vector2, Vector2ui, Vector2i, Vector3, Vector3ui, Vector3i, Vector4, Vector4ui, Vector4i, Complex, Quaternion, DualQuaternion, CubicHermite1D, CubicHermite2D, CubicHermite3D, CubicHermiteComplex, CubicHermiteQuaternion }
Type of animation track data.
enum class AnimationTrackTarget: UnsignedShort { Translation2D = 1, Translation3D, Rotation2D, Rotation3D, Scaling2D, Scaling3D, Custom = Implementation::AnimationTrackTargetCustom deprecated in Git master }
Target of an animation track.
enum class CameraType: UnsignedByte { Orthographic2D, Orthographic3D, Perspective3D }
Camera type.
enum class DataFlag: UnsignedByte { Owned = 1 << 0, ExternallyOwned = 1 << 3 new in Git master, Global = 1 << 4 new in Git master, Mutable = 1 << 2 } new in 2020.06
Data flag.
enum class LightType: UnsignedByte { Ambient = 1 new in Git master, Directional new in Git master, Infinite = Directional deprecated in Git master, Point, Spot } new in Git master
Light type.
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, AmbientTextureLayer, DiffuseColor, DiffuseTexture, DiffuseTextureMatrix, DiffuseTextureCoordinates, DiffuseTextureLayer, SpecularColor, SpecularTexture, SpecularTextureSwizzle, SpecularTextureMatrix, SpecularTextureCoordinates, SpecularTextureLayer, Shininess, BaseColor, BaseColorTexture, BaseColorTextureMatrix, BaseColorTextureCoordinates, BaseColorTextureLayer, Metalness, MetalnessTexture, MetalnessTextureSwizzle, MetalnessTextureMatrix, MetalnessTextureCoordinates, MetalnessTextureLayer, Roughness, RoughnessTexture, RoughnessTextureSwizzle, RoughnessTextureMatrix, RoughnessTextureCoordinates, RoughnessTextureLayer, NoneRoughnessMetallicTexture, Glossiness, GlossinessTexture, GlossinessTextureSwizzle, GlossinessTextureMatrix, GlossinessTextureCoordinates, GlossinessTextureLayer, SpecularGlossinessTexture, NormalTexture, NormalTextureScale, NormalTextureSwizzle, NormalTextureMatrix, NormalTextureCoordinates, NormalTextureLayer, OcclusionTexture, OcclusionTextureStrength, OcclusionTextureSwizzle, OcclusionTextureMatrix, OcclusionTextureCoordinates, OcclusionTextureLayer, EmissiveColor, EmissiveTexture, EmissiveTextureMatrix, EmissiveTextureCoordinates, EmissiveTextureLayer, LayerFactor, LayerFactorTexture, LayerFactorTextureSwizzle, LayerFactorTextureMatrix, LayerFactorTextureCoordinates, LayerFactorTextureLayer, TextureMatrix, TextureCoordinates, TextureLayer } 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, Buffer, 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, JointIds new in Git master, Weights new in Git master, ObjectId } new in 2020.06
Mesh attribute name.
enum class ObjectInstanceType2D: UnsignedByte { Camera, Mesh, Empty } deprecated in Git master
Type of instance held by given 2D object.
enum class ObjectFlag2D: UnsignedByte { HasTranslationRotationScaling = 1 << 0 } deprecated in Git master
2D object flag
enum class ObjectInstanceType3D: UnsignedByte { Camera, Light, Mesh, Empty } deprecated in Git master
Type of instance held by given 3D object.
enum class ObjectFlag3D: UnsignedByte { HasTranslationRotationScaling = 1 << 0 } deprecated in Git master
3D object flag
enum class SceneMappingType: UnsignedByte { UnsignedByte = 1, UnsignedShort, UnsignedInt, UnsignedLong } new in Git master
Scene object mapping type.
enum class SceneField: UnsignedInt { Parent = 1, Transformation, Translation, Rotation, Scaling, Mesh, MeshMaterial, Light, Camera, Skin, ImporterState } new in Git master
Scene field name.
enum class SceneFieldType: UnsignedShort { Bit = 13, Float, Half, Double, UnsignedByte, Byte, UnsignedShort, Short, UnsignedInt, Int, UnsignedLong, Long, Vector2, Vector2h, Vector2d, Vector2ub, Vector2b, Vector2us, Vector2s, Vector2ui, Vector2i, Vector3, Vector3h, Vector3d, Vector3ub, Vector3b, Vector3us, Vector3s, Vector3ui, Vector3i, Vector4, Vector4h, Vector4d, Vector4ub, Vector4b, Vector4us, Vector4s, Vector4ui, Vector4i, Matrix2x2, Matrix2x2h, Matrix2x2d, Matrix2x3, Matrix2x3h, Matrix2x3d, Matrix2x4, Matrix2x4h, Matrix2x4d, Matrix3x2, Matrix3x2h, Matrix3x2d, Matrix3x3, Matrix3x3h, Matrix3x3d, Matrix3x4, Matrix3x4h, Matrix3x4d, Matrix4x2, Matrix4x2h, Matrix4x2d, Matrix4x3, Matrix4x3h, Matrix4x3d, Matrix4x4, Matrix4x4h, Matrix4x4d, Range1D, Range1Dh, Range1Dd, Range1Di, Range2D, Range2Dh, Range2Dd, Range2Di, Range3D, Range3Dh, Range3Dd, Range3Di, Complex, Complexd, DualComplex, DualComplexd, Quaternion, Quaterniond, DualQuaternion, DualQuaterniond, Deg, Degh, Degd, Rad, Radh, Radd, Pointer, MutablePointer, StringOffset32 = 3, StringOffset8 = 1, StringOffset16 = 2, StringOffset64 = 4, StringRange32 = 7, StringRange8 = 5, StringRange16 = 6, StringRange64 = 8, StringRangeNullTerminated32 = 11, StringRangeNullTerminated8 = 9, StringRangeNullTerminated16 = 10, StringRangeNullTerminated64 = 12 } new in Git master
Scene field type.
enum class SceneFieldFlag: UnsignedByte { OffsetOnly = 1 << 0, OrderedMapping = 1 << 1, ImplicitMapping = (1 << 2)|OrderedMapping, MultiEntry = 1 << 4, NullTerminatedString = 1 << 3 } new in Git master
Scene field flag.
enum class TextureType: UnsignedByte { Texture1D, Texture1DArray new in Git master, Texture2D, Texture2DArray new in Git master, Texture3D, CubeMap new in Git master, CubeMapArray new in Git master, Cube = CubeMap deprecated in Git master } new in Git master
Texture type.

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 SceneContents = Containers::EnumSet<SceneContent> new in Git master
Scene contents.
using AnimationTrackTargetType = AnimationTrackTarget deprecated in Git master
Target of an animation track.
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> deprecated in Git master
2D object flags
using ObjectFlags3D = Containers::EnumSet<ObjectFlag3D> deprecated in Git master
3D object flags
using SceneFieldFlags = Containers::EnumSet<SceneFieldFlag> new in Git master
Scene field 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, SceneContent value) -> Debug& new in Git master
Debug output operator.
auto operator<<(Debug& debug, SceneContents value) -> Debug& new in Git master
Debug output operator.
auto sceneContentsFor(const AbstractImporter& importer) -> SceneContents new in Git master
Scene contents for an importer.
auto sceneContentsFor(const AbstractSceneConverter& converter) -> SceneContents new in Git master
Scene contents supported by a converter.
auto operator<<(Debug& debug, AnimationTrackType value) -> Debug&
Debug output operator.
auto animationTrackTypeSize(AnimationTrackType type) -> UnsignedInt new in Git master
Size of given animation track data type.
auto animationTrackTypeAlignment(AnimationTrackType type) -> UnsignedInt new in Git master
Alignment of given animation track data type.
auto operator<<(Debug& debug, AnimationTrackTarget value) -> Debug&
Debug output operator.
auto isAnimationTrackTargetCustom(AnimationTrackTarget name) -> bool constexpr new in Git master
Whether a target for an animation track is custom.
auto animationTrackTargetCustom(UnsignedShort id) -> AnimationTrackTarget constexpr new in Git master
Create a custom target for an animation track.
auto animationTrackTargetCustom(AnimationTrackTarget name) -> UnsignedShort constexpr new in Git master
Get index of a custom target for an animation track.
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, LightType value) -> Debug&
Debug output operator.
auto materialLayerName(MaterialLayer layer) -> Containers::StringView
Material layer name as a string.
auto operator<<(Debug& debug, MaterialLayer value) -> Debug& new in Git master
Debug output operator.
auto materialAttributeName(MaterialAttribute attribute) -> Containers::StringView new in Git master
Material layer name as a string.
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& deprecated in Git master
Debug output operator.
auto operator<<(Debug& debug, ObjectFlag2D value) -> Debug& deprecated in Git master
Debug output operator.
auto operator<<(Debug& debug, ObjectFlags2D value) -> Debug& deprecated in Git master
Debug output operator.
auto operator<<(Debug& debug, ObjectInstanceType3D value) -> Debug& deprecated in Git master
Debug output operator.
auto operator<<(Debug& debug, ObjectFlag3D value) -> Debug& deprecated in Git master
Debug output operator.
auto operator<<(Debug& debug, ObjectFlags3D value) -> Debug& deprecated in Git master
Debug output operator.
auto operator<<(Debug& debug, PhongMaterialData::Flag value) -> Debug& deprecated in Git master
Debug output operator.
auto operator<<(Debug& debug, SceneMappingType value) -> Debug& new in Git master
Debug output operator.
auto sceneMappingTypeSize(SceneMappingType type) -> UnsignedInt new in Git master
Size of given scene object mapping type.
auto sceneMappingTypeAlignment(SceneMappingType type) -> UnsignedInt new in Git master
Alignment of given scene object mapping type.
auto operator<<(Debug& debug, SceneField value) -> Debug& new in Git master
Debug output operator.
auto isSceneFieldCustom(SceneField name) -> bool constexpr new in Git master
Whether a scene field is custom.
auto sceneFieldCustom(UnsignedInt id) -> SceneField constexpr new in Git master
Create a custom scene field.
auto sceneFieldCustom(SceneField name) -> UnsignedInt constexpr new in Git master
Get index of a custom scene field.
auto operator<<(Debug& debug, SceneFieldType value) -> Debug& new in Git master
Debug output operator.
auto sceneFieldTypeSize(SceneFieldType type) -> UnsignedInt new in Git master
Size of given scene field type.
auto sceneFieldTypeAlignment(SceneFieldType type) -> UnsignedInt new in Git master
Alignment of given scene field type.
auto operator<<(Debug& debug, SceneFieldFlag value) -> Debug& new in Git master
Debug output operator.
auto operator<<(Debug& debug, SceneFieldFlags value) -> Debug& new in Git master
Debug output operator.
auto sceneFieldDataNonOwningArray(Containers::ArrayView<const SceneFieldData> view) -> Containers::Array<SceneFieldData> new in Git master
Create a non-owning array of SceneFieldData items.
auto operator<<(Debug& debug, TextureType value) -> Debug&
Debug output operator.

Enum documentation

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

Features supported by an image converter.

Enumerators
Convert1D new in Git master

Convert a 1D image with AbstractImageConverter::convert(const ImageView1D&)

Convert2D new in Git master

Convert a 2D image with AbstractImageConverter::convert(const ImageView2D&)

ConvertImage

Convert a 2D image with AbstractImageConverter::convert(const ImageView2D&)

ConvertCompressedImage

Convert a 2D image with AbstractImageConverter::convert(const ImageView2D&)

Convert3D new in Git master

Convert a 3D image with AbstractImageConverter::convert(const ImageView3D&)

ConvertCompressed1D new in Git master

Convert a compressed 1D image with AbstractImageConverter::convert(const CompressedImageView1D&)

ConvertCompressed2D new in Git master

Convert a compressed 2D image with AbstractImageConverter::convert(const CompressedImageView2D&)

ConvertCompressed3D new in Git master

Convert a compressed 3D image with AbstractImageConverter::convert(const CompressedImageView3D&)

Convert1DToFile new in Git master

Convert a 1D image to a file with AbstractImageConverter::convertToFile(const ImageView1D&, Containers::StringView)

Convert2DToFile new in Git master

Convert a 2D image to a file with AbstractImageConverter::convertToFile(const ImageView2D&, Containers::StringView)

ConvertFile

Convert a 2D image to a file with AbstractImageConverter::convertToFile(const ImageView2D&, Containers::StringView)

Convert3DToFile new in Git master

Convert a 3D image to a file with AbstractImageConverter::convertToFile(const ImageView3D&, Containers::StringView)

ConvertCompressed1DToFile new in Git master

Convert a compressed 1D image to a file with AbstractImageConverter::convertToFile(const CompressedImageView1D&, Containers::StringView)

ConvertCompressed2DToFile new in Git master

Convert a compressed 2D image to a file with AbstractImageConverter::convertToFile(const CompressedImageView2D&, Containers::StringView)

ConvertCompressedFile

Convert a compressed 2D image to a file with AbstractImageConverter::convertToFile(const CompressedImageView2D&, Containers::StringView)

ConvertCompressed3DToFile new in Git master

Convert a compressed 3D image to a file with AbstractImageConverter::convertToFile(const CompressedImageView3D&, Containers::StringView)

Convert1DToData new in Git master

Convert a 1D image to raw data with AbstractImageConverter::convertToData(const ImageView1D&). Implies ImageConverterFeature::Convert1DToFile.

Convert2DToData new in Git master

Convert a 2D image to raw data with AbstractImageConverter::convertToData(const ImageView2D&). Implies ImageConverterFeature::Convert2DToFile.

ConvertData

Convert a 2D image to raw data with AbstractImageConverter::convertToData(const ImageView2D&). Implies ImageConverterFeature::Convert2DToFile.

Convert3DToData new in Git master

Convert a 3D image to raw data with AbstractImageConverter::convertToData(const ImageView3D&). Implies ImageConverterFeature::Convert3DToFile.

ConvertCompressed1DToData new in Git master

Convert a compressed 1D image to raw data with AbstractImageConverter::convertToData(const CompressedImageView1D&). Implies ImageConverterFeature::ConvertCompressed1DToFile.

ConvertCompressed2DToData new in Git master

Convert a compressed 2D image to raw data with AbstractImageConverter::convertToData(const CompressedImageView2D&). Implies ImageConverterFeature::ConvertCompressed2DToFile.

ConvertCompressedData

Convert a compressed 2D image to raw data with AbstractImageConverter::convertToData(const CompressedImageView2D&). Implies ImageConverterFeature::ConvertCompressed2DToFile.

ConvertCompressed3DToData new in Git master

Convert a compressed 3D image to raw data with AbstractImageConverter::convertToData(const CompressedImageView3D&). Implies ImageConverterFeature::ConvertCompressed3DToFile.

Levels new in Git master

Convert multiple image levels with AbstractImageConverter::convertToFile(Containers::ArrayView<const ImageView1D>, Containers::StringView) / AbstractImageConverter::convertToFile(Containers::ArrayView<const CompressedImageView1D>, Containers::StringView) if ImageConverterFeature::Convert1DToFile / ConvertCompressed1DToFile is also supported; with AbstractImageConverter::convertToFile(Containers::ArrayView<const ImageView2D>, Containers::StringView) / AbstractImageConverter::convertToFile(Containers::ArrayView<const CompressedImageView2D>, Containers::StringView) if ImageConverterFeature::Convert2DToFile / ConvertCompressed2DToFile is also supported; with AbstractImageConverter::convertToFile(Containers::ArrayView<const ImageView3D>, Containers::StringView) / AbstractImageConverter::convertToFile(Containers::ArrayView<const CompressedImageView3D>, Containers::StringView) if ImageConverterFeature::Convert3DToFile / ConvertCompressed3DToFile is also supported; with AbstractImageConverter::convertToData(Containers::ArrayView<const ImageView1D>) / AbstractImageConverter::convertToData(Containers::ArrayView<const CompressedImageView1D>) if ImageConverterFeature::Convert1DToData / ConvertCompressed1DToData is also supported; with AbstractImageConverter::convertToData(Containers::ArrayView<const ImageView2D>) / AbstractImageConverter::convertToData(Containers::ArrayView<const CompressedImageView2D>) if ImageConverterFeature::Convert2DToData / ConvertCompressed2DToData is also supported; with AbstractImageConverter::convertToData(Containers::ArrayView<const ImageView3D>) / AbstractImageConverter::convertToData(Containers::ArrayView<const CompressedImageView3D>) if ImageConverterFeature::Convert3DToData / ConvertCompressed3DToData is also supported.

ConvertLevels1DToFile
ConvertLevels2DToFile
ConvertLevels3DToFile
ConvertCompressedLevels1DToFile
ConvertCompressedLevels2DToFile
ConvertCompressedLevels3DToFile
ConvertLevels1DToData
ConvertLevels2DToData
ConvertLevels3DToData
ConvertCompressedLevels1DToData
ConvertCompressedLevels2DToData
ConvertCompressedLevels3DToData

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

Image converter flag.

Enumerators
Quiet new in Git master

Suppress warnings, print just errors. By default the converter prints both warnings and errors.

Verbose

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

Corresponds to the -v / --verbose option in magnum-imageconverter and magnum-sceneconverter.

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

Features supported by an importer.

Enumerators
OpenData

Opening files from raw data or non-temporary memory using AbstractImporter::openData() or openMemory()

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
Quiet new in Git master

Suppress warnings, print just errors. By default the converter prints both warnings and errors.

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.

Corresponds to the -v / --verbose option in magnum-imageconverter, magnum-sceneconverter and magnum-player.

enum class Magnum::Trade::SceneConverterFeature: UnsignedInt new in 2020.06

Features supported by a scene converter.

Enumerators
ConvertMesh

Convert a single mesh instance with AbstractSceneConverter::convert(const MeshData&). The function can be also used if both SceneConverterFeature::ConvertMultiple and SceneConverterFeature::AddMeshes are supported.

ConvertMeshInPlace

Convert a single mesh instance in-place with AbstractSceneConverter::convertInPlace(MeshData&).

ConvertMeshToFile

Convert a single mesh instance to a file with AbstractSceneConverter::convertToFile(const MeshData&, Containers::StringView). The function can be also used if both SceneConverterFeature::ConvertMultipleToFile and SceneConverterFeature::AddMeshes are supported.

ConvertMeshToData

Convert a single mesh instance to raw data with AbstractSceneConverter::convertToData(const MeshData&). Implies SceneConverterFeature::ConvertMeshToFile. The function can be also used if both SceneConverterFeature::ConvertMultipleToData and SceneConverterFeature::AddMeshes are supported.

ConvertMultiple new in Git master

Convert multiple data with AbstractSceneConverter::begin() and end().

ConvertMultipleToFile new in Git master

Convert multiple data to a file with AbstractSceneConverter::beginFile() and endFile(). The functions can be also used if SceneConverterFeature::ConvertMeshToFile is supported.

ConvertMultipleToData new in Git master

Convert multiple data to raw data with AbstractSceneConverter::beginData() and endData(). Implies SceneConverterFeature::ConvertMultipleToFile. The functions can be also used if SceneConverterFeature::ConvertMeshToData is supported.

AddScenes new in Git master

Add scene instances with AbstractSceneConverter::add(const SceneData&, Containers::StringView), together with setSceneFieldName(), setObjectName() and setDefaultScene().

AddAnimations new in Git master

Add animation instances with AbstractSceneConverter::add(const AnimationData&, Containers::StringView).

AddLights new in Git master

Add light instances with AbstractSceneConverter::add(const LightData&, Containers::StringView).

AddCameras new in Git master

Add camera instances with AbstractSceneConverter::add(const CameraData&, Containers::StringView).

AddSkins2D new in Git master

Add 2D skin instances with AbstractSceneConverter::add(const SkinData2D&, Containers::StringView).

AddSkins3D new in Git master

Add 3D skin instances with AbstractSceneConverter::add(const SkinData3D&, Containers::StringView).

AddMeshes new in Git master

Add single-level mesh instances with AbstractSceneConverter::add(const MeshData&, Containers::StringView), together with setMeshAttributeName(). This function can be also used if SceneConverterFeature::ConvertMesh, SceneConverterFeature::ConvertMeshToFile or SceneConverterFeature::ConvertMeshToData is supported.

AddMaterials new in Git master

Add material instances with AbstractSceneConverter::add(const MaterialData&, Containers::StringView).

AddTextures new in Git master

Add texture instances with AbstractSceneConverter::add(const TextureData&, Containers::StringView).

AddImages1D new in Git master

Add single-level 1D image instances with AbstractSceneConverter::add(const ImageData1D&, Containers::StringView) or AbstractSceneConverter::add(const ImageView1D&, Containers::StringView).

AddImages2D new in Git master

Add single-level 2D image instances with AbstractSceneConverter::add(const ImageData2D&, Containers::StringView) or AbstractSceneConverter::add(const ImageView2D&, Containers::StringView).

AddImages3D new in Git master

Add single-level 3D image instances with AbstractSceneConverter::add(const ImageData3D&, Containers::StringView) or AbstractSceneConverter::add(const ImageView3D&, Containers::StringView).

AddCompressedImages1D new in Git master

Add single-level compressed 1D image instances with AbstractSceneConverter::add(const ImageData1D&, Containers::StringView) or AbstractSceneConverter::add(const CompressedImageView1D&, Containers::StringView).

AddCompressedImages2D new in Git master

Add single-level compressed 2D image instances with AbstractSceneConverter::add(const ImageData2D&, Containers::StringView) or AbstractSceneConverter::add(const CompressedImageView2D&, Containers::StringView).

AddCompressedImages3D new in Git master

Add single-level compressed 3D image instances with AbstractSceneConverter::add(const ImageData3D&, Containers::StringView) or AbstractSceneConverter::add(const CompressedImageView3D&, Containers::StringView).

MeshLevels new in Git master

Add multiple mesh levels with AbstractSceneConverter::add(const Containers::Iterable<const MeshData>&, Containers::StringView) if SceneConverterFeature::AddMeshes is also supported.

ImageLevels new in Git master

Add multiple image levels with AbstractSceneConverter::add(const Containers::Iterable<const ImageData1D>&, Containers::StringView) if SceneConverterFeature::AddImages1D or AddCompressedImages1D is also supported; with AbstractSceneConverter::add(const Containers::Iterable<const ImageData2D>&, Containers::StringView) if SceneConverterFeature::AddImages2D or AddCompressedImages2D is also supported; or with AbstractSceneConverter::add(const Containers::Iterable<const ImageData1D>&, Containers::StringView) if SceneConverterFeature::AddImages3D or AddCompressedImages3D is also supported.

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

Scene converter flag.

Enumerators
Quiet

Suppress warnings, print just errors. By default the converter prints both warnings and errors.

Verbose

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

Corresponds to the -v / --verbose option in magnum-sceneconverter.

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

Scene content.

Content to be taken from an AbstractImporter and passed to an AbstractSceneConverter in AbstractSceneConverter::addImporterContents() and addSupportedImporterContents().

Enumerators
Scenes

Scenes. Passes SceneData from AbstractImporter::scene() to AbstractSceneConverter::add(const SceneData&, Containers::StringView); AbstractImporter::defaultScene() to AbstractSceneConverter::setDefaultScene(); and for all custom fields, AbstractImporter::sceneFieldName() to AbstractSceneConverter::setSceneFieldName().

Animations

Animations. Passes AnimationData from AbstractImporter::animation() to AbstractSceneConverter::add(const AnimationData&, Containers::StringView)

Lights

Lights. Passes LightData from AbstractImporter::light() to AbstractSceneConverter::add(const LightData&, Containers::StringView).

Cameras

Cameras. Passes SceneData from AbstractImporter::camera() to AbstractSceneConverter::add(const CameraData&, Containers::StringView).

Skins2D

2D skins. Passes SkinData2D from AbstractImporter::skin2D() to AbstractSceneConverter::add(const SkinData2D&, Containers::StringView).

Skins3D

3D skins. Passes SkinData3D from AbstractImporter::skin2D() to AbstractSceneConverter::add(const SkinData3D&, Containers::StringView).

Meshes

Meshes. Passes MeshData from AbstractImporter::mesh(), to AbstractSceneConverter::add(const MeshData&, Containers::StringView); and for all custom attributes, AbstractImporter::meshAttributeName() to AbstractSceneConverter::setMeshAttributeName().

Materials

Materials. Passes MaterialData from AbstractImporter::material() to AbstractSceneConverter::add(const MaterialData&, Containers::StringView).

Textures

Textures. Passes TextureData from AbstractImporter::texture() to AbstractSceneConverter::add(const TextureData&, Containers::StringView).

Images1D

1D images. Passes ImageData1D from AbstractImporter::image1D() to AbstractSceneConverter::add(const ImageData1D&, Containers::StringView). If the image is compressed and only SceneConverterFeature::AddImages1D is supported or the image is uncompressed and only SceneConverterFeature::AddCompressedImages1D is supported, results in an error.

Images2D

2D images. Passes ImageData2D from AbstractImporter::image2D() to AbstractSceneConverter::add(const ImageData2D&, Containers::StringView). If the image is compressed and only SceneConverterFeature::AddImages2D is supported or the image is uncompressed and only SceneConverterFeature::AddCompressedImages2D is supported, results in an error.

Images3D

3D images. Passes ImageData3D from AbstractImporter::image3D() to AbstractSceneConverter::add(const ImageData3D&, Containers::StringView). If the image is compressed and only SceneConverterFeature::AddImages3D is supported or the image is uncompressed and only SceneConverterFeature::AddCompressedImages3D is supported, results in an error.

MeshLevels

Multiple mesh levels. For every mesh gathers MeshData from all AbstractImporter::meshLevelCount() and passes them to AbstractSceneConverter::add(const Containers::Iterable<const MeshData>&, Containers::StringView) instead of passing just the first level to AbstractSceneConverter::add(const MeshData&, Containers::StringView).

ImageLevels

Multiple image levels. For every image gathers ImageData1D / ImageData2D / ImageData3D from all AbstractImporter::image1DLevelCount() / image2DLevelCount() / image3DLevelCount() and passes them to AbstractSceneConverter::add(const Containers::Iterable<const ImageData1D>&, Containers::StringView) / add(const Containers::Iterable<const ImageData2D>&, Containers::StringView) / add(const Containers::Iterable<const ImageData3D>&, Containers::StringView) instead of just passing the first level to

AbstractSceneConverter::add(const ImageData1D&, Containers::StringView) / add(const ImageData2D&, Containers::StringView) / add(const ImageData2D&, Containers::StringView).

Names

Data names. For every supported data queries also AbstractImporter::sceneName(), objectName(), animationName(), lightName(), cameraName(), skin2DName(), skin3DName(), meshName(), materialName(), textureName(), image1DName(), image2DName() or image3DName() and passes them to the converter. AbstractImporter::sceneFieldName() and meshAttributeName() are however passed always to avoid information loss.

enum class Magnum::Trade::AnimationTrackType: UnsignedByte

Type of animation track data.

A type in which track data for given AnimationTrackTarget is stored, See AnimationData for more information.

Enumerators
Bool

bool

Float

Float

UnsignedInt

UnsignedInt

Int

Int

BitVector2 new in Git master

BitVector2

BoolVector2

BitVector2

BitVector3 new in Git master

BitVector3

BoolVector3

BitVector3

BitVector4 new in Git master

BitVector4

BoolVector4

BitVector4

Vector2

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

Vector2ui

Vector2ui

Vector2i

Vector2i

Vector3

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

Vector3ui

Vector3ui

Vector3i

Vector3i

Vector4

Vector4

Vector4ui

Vector4ui

Vector4i

Vector4i

Complex

Complex. Usually used for AnimationTrackTarget::Rotation2D.

Quaternion

Quaternion. Usually used for AnimationTrackTarget::Rotation3D.

DualQuaternion

DualQuaternion

CubicHermite1D

CubicHermite1D

CubicHermite2D

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

CubicHermite3D

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

CubicHermiteComplex

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

CubicHermiteQuaternion

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

enum class Magnum::Trade::AnimationTrackTarget: UnsignedShort

Target of an animation track.

See AnimationData for more information.

Apart from builtin target types it's possible to have custom ones, which use the upper half of the enum range. Those are detected via isAnimationTrackTargetCustom() and can be converted to and from a numeric identifier using animationTrackTargetCustom(AnimationTrackTarget) and animationTrackTargetCustom(UnsignedShort). Unlike the builtin ones, these can be of any type and AnimationData::trackTarget() might or might not point to an existing object. An importer that exposes custom types then may also provide a string mapping using AbstractImporter::animationTrackTargetForName() and AbstractImporter::animationTrackTargetName(). See documentation of a particular importer for details.

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.

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.

Used to describe data contained in various classes returned from AbstractImporter interfaces and also data passed internally in the importer itself.

Enumerators
Owned

Data is owned by the instance, meaning it stays in scope for as long as the instance. If neither DataFlag::Owned, DataFlag::ExternallyOwned nor DataFlag::Global is set, the data is considered to be just a temporary allocation and no assumptions about its lifetime can be made.

ExternallyOwned new in Git master

Data has an owner external to the instance, for example a memory-mapped file or a constant memory. In general the data lifetime exceeds lifetime of the instance wrapping it. If neither DataFlag::Owned, DataFlag::ExternallyOwned nor DataFlag::Global is set, the data is considered to be just a temporary allocation and no assumptions about its lifetime can be made.

Global new in Git master

Data is global, for example stored in static memory, so guaranteed to never go out of scope. Usually such data are not DataFlag::Mutable. If neither DataFlag::Owned, DataFlag::ExternallyOwned nor DataFlag::Global is set, the data is considered to be just a temporary allocation and no assumptions about its lifetime can be made.

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::LightType: UnsignedByte new in Git master

Light type.

Enumerators
Ambient new in Git master

Ambient light, without any position, direction or attenuation. Meant to be added to ambient color in Phong workflows, has no use in physically based workflows.

Directional new in Git master

Light at a position that is infinitely far away, emitted in a direction of negative Z axis. The rotation is inherited from absolute object transformation; scale and position don't affect the light in any way. Because the light is at infinite distance, it's not attenuated in any way.

Infinite

Directional light.

Point

Point light, emitting light in all directions. The position is inherited from absolute object transformation; scale and rotation don't affect the light in any way. Brightness attenuates depending on the LightData::range() value.

Spot

Spot light, emitting light in a cone in direction of local negative Z axis. The position and rotation is inherited from absolute object transformation; scale doesn't affect the light in any way. The angle and falloff of the cone is defined using LightData::innerConeAngle() and LightData::outerConeAngle() and brightness attenuates depending on the LightData::range() value.

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" (with a space at the front).

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

Each attribute value documents the default value that should be used if the attribute isn't present. Some attributes, such as *Texture, have no defaults — in that case it means the material doesn't use given feature.

Enumerators
LayerName

Layer name, MaterialAttributeType::String.

Unlike other attributes where string name matches the enum name, in this case the corresponding string is " LayerName" (with a space at the front), done in order to have the layer name attribute appear first in each layer and thus simplify layer implementation.

Default value is an empty string.

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.

Default value is 0.5f.

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.

Default value is false.

DoubleSided

Double sided, MaterialAttributeType::Bool.

Default value is false.

AmbientColor

Ambient color for Phong materials, MaterialAttributeType::Vector4.

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

Default value is 0x000000ff_srgbaf if there's no MaterialAttribute::AmbientTexture and 0xffffffff_srgbaf if there is.

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.

Default value is an identity matrix.

AmbientTextureCoordinates

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

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

Default value is 0u.

AmbientTextureLayer

Ambient texture array layer for Phong materials, MaterialAttributeType::UnsignedInt.

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

Default value is 0u.

DiffuseColor

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

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

Default value is 0xffffffff_srgbaf.

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.

Default value is an identity matrix.

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.

Default value is 0u.

DiffuseTextureLayer

Diffuse texture array layer for Phong materials, MaterialAttributeType::UnsignedInt.

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

Default value is 0u.

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.

Default value is 0xffffff00_srgbaf.

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.

Default value is 0u.

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 is expected. Does not apply to MaterialAttribute::SpecularGlossinessTexture — in that case, the specular texture is always three-channel, regardless of this attribute.

Default value is MaterialTextureSwizzle::RGB.

SpecularTextureMatrix

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

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

Default value is an identity matrix.

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.

Default value is 0u.

SpecularTextureLayer

Specular texture array layer for Phong materials, MaterialAttributeType::UnsignedInt.

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

Default value is 0u.

Shininess

Shininess value for Phong materials, MaterialAttributeType::Float.

No default value is specified for this attribute.

BaseColor

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

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

Default value is 0xffffffff_srgbaf.

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.

Default value is an identity matrix.

BaseColorTextureCoordinates

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

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

Default value is 0u.

BaseColorTextureLayer

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

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

Default value is 0u.

Metalness

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

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

Default value is 1.0f.

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. Does not apply to MaterialAttribute::NoneRoughnessMetallicTexture — in that case, the metalness is implicitly in the red channel regardless of this attribute.

Default value is MaterialTextureSwizzle::R.

MetalnessTextureMatrix

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

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

Default value is an identity matrix.

MetalnessTextureCoordinates

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

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

Default value is 0u.

MetalnessTextureLayer

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

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

Default value is 0u.

Roughness

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

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

Default value is 1.0f.

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. Does not apply to MaterialAttribute::NoneRoughnessMetallicTexture — in that case, the metalness is implicitly in the green channel regardless of this attribute.

Default value is MaterialTextureSwizzle::R.

RoughnessTextureMatrix

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

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

Default value is an identity matrix.

RoughnessTextureCoordinates

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

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

Default value is 0u.

RoughnessTextureLayer

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

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

Default value is 0u.

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.

Default value is 1.0f.

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. Does not apply to MaterialAttribute::SpecularGlossinessTexture — in that case, the glossiness is implicitly in the alpha channel regardless of this attribute.

Default value is MaterialTextureSwizzle::R.

GlossinessTextureMatrix

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

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

Default value is an identity matrix.

GlossinessTextureCoordinates

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

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

Default value is 0u.

GlossinessTextureLayer

Metalness texture array layer for PBR specular/glossiness materials, MaterialAttributeType::UnsignedInt.

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

Default value is 0u.

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.

Default value is 1.0f.

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 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;
}

Default value is MaterialTextureSwizzle::RGB.

NormalTextureMatrix

Normal texture transformation matrix, MaterialAttributeType::Matrix3x3.

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

Default value is an identity matrix.

NormalTextureCoordinates

Normal texture coordinate set index, MaterialAttributeType::UnsignedInt.

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

Default value is 0u.

NormalTextureLayer

Normal texture array layer, MaterialAttributeType::UnsignedInt.

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

Default value is 0u.

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.

Default value is 1.0f.

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.

Default value is MaterialTextureSwizzle::R.

OcclusionTextureMatrix

Occlusion texture transformation matrix, MaterialAttributeType::Matrix3x3.

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

Default value is an identity matrix.

OcclusionTextureCoordinates

Occlusion texture coordinate set index, MaterialAttributeType::UnsignedInt.

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

Default value is 0u.

OcclusionTextureLayer

Occlusion texture array layer, MaterialAttributeType::UnsignedInt.

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

Default value is 0u.

EmissiveColor

Emissive color, MaterialAttributeType::Vector3.

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

Default value is 0x000000_srgbf.

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.

Default value is an identity matrix.

EmissiveTextureCoordinates

Emissive texture coordinate set index, MaterialAttributeType::UnsignedInt.

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

Default value is 0u.

EmissiveTextureLayer

Emissive texture array layer, MaterialAttributeType::UnsignedInt.

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

Default value is 0u.

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.

Default value is 1.0f.

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.

Default value is MaterialTextureSwizzle::R.

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.

Default value is an identity matrix.

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.

Default value is 0u.

LayerFactorTextureLayer

Layer intensity texture array layer, MaterialAttributeType::UnsignedInt.

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

Default value is 0u.

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.

Default value is an identity matrix.

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.

Default value is 0u.

TextureLayer

Common texture array layer for all textures, MaterialAttributeType::UnsignedInt.

MaterialAttribute::AmbientTextureLayer / MaterialAttribute::DiffuseTextureLayer / MaterialAttribute::SpecularTextureLayer / MaterialAttribute::MetalnessTextureLayer / MaterialAttribute::RoughnessTextureLayer / MaterialAttribute::GlossinessTextureLayer / MaterialAttribute::NormalTextureLayer / MaterialAttribute::OcclusionTextureLayer / MaterialAttribute::EmissiveTextureLayer / MaterialAttribute::LayerFactorTextureLayer have a precedence over this attribute for given texture, if present.

Default value is 0u.

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 Containers::StringView, retrieval has to be done using Containers::StringView.

Buffer

Opaque data. Can be stored using any type convertible to Containers::ArrayView, retrieval has to be done using Containers::ArrayView<const void>.

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.

See MeshData for more information.

Apart from the builtin attribute names it's possible to have custom ones, which use the upper half of the enum range. Those are detected via isMeshAttributeCustom() and can be converted to and from a numeric identifier using meshAttributeCustom(MeshAttribute) and meshAttributeCustom(UnsignedShort). Unlike the builtin ones, these can be of any type. An importer that exposes custom attributes then may also provide a string mapping using AbstractImporter::meshAttributeForName() and AbstractImporter::meshAttributeName(); conversely a scene converter supporting custom mesh attributes can have the string mapping specified via AbstractSceneConverter::setMeshAttributeName(). See documentation of a particular importer and scene converter for details.

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::GenericGL::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. Reconstructing the MeshAttribute::Bitangent can be then done like this:

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

When used as a morph target attribute, the handedness shouldn't change compared to the base attribute. It's not checked or enforced in any way though.

Corresponds to Shaders::GenericGL::Tangent or Shaders::GenericGL::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.

When used as a morph target attribute, the handedness shouldn't change compared to the base attribute. It's not checked or enforced in any way though.

Corresponds to Shaders::GenericGL::Bitangent.

Normal

Normal. Type is usually VertexFormat::Vector3, but can be also VertexFormat::Vector3h, VertexFormat::Vector3bNormalized or VertexFormat::Vector3sNormalized. Corresponds to Shaders::GenericGL::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::GenericGL::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::GenericGL::Color3 or Shaders::GenericGL::Color4.

JointIds new in Git master

Skin joint IDs. Array attribute, type is usually VertexFormat::UnsignedInt, but can be also VertexFormat::UnsignedShort or VertexFormat::UnsignedByte. Array size is not limited or enforced in any way, but shaders usually expect at most 8 items, or alternatively two instances of this attribute with at most 4 items in each.

Count of instances of this attribute and array size of each instance is expected to match instance count and array sizes of MeshAttribute::Weights. This attribute isn't allowed to be a morph target.

Corresponds to Shaders::GenericGL::JointIds and Shaders::GenericGL::SecondaryJointIds, divided between them based on array size or attribute count.

Weights new in Git master

Skin weights. Array attribute, type is usually VertexFormat::Float, but can be also VertexFormat::Half, VertexFormat::UnsignedByteNormalized or VertexFormat::UnsignedShortNormalized. Array size is not limited or enforced in any way, but shaders usually expect at most 8 items, or alternatively two instances of this attribute with at most 4 items in each.

Count of instances of this attribute and array size of each instance is expected to match instance count and array sizes of MeshAttribute::JointIds. This attribute isn't allowed to be a morph target.

Corresponds to Shaders::GenericGL::Weights and Shaders::GenericGL::SecondaryWeights, divided between them based on array size or attribute count.

ObjectId

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

This attribute isn't allowed to be a morph target.

Corresponds to Shaders::GenericGL::ObjectId.

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().

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

Scene object mapping type.

Type used for mapping fields to corresponding objects. Unlike SceneFieldType that is different for different fields, the object mapping type is the same for all fields, and is guaranteed to be large enough to fit SceneData::mappingBound() objects.

Enumerators
UnsignedByte

UnsignedByte

UnsignedShort

UnsignedShort

UnsignedInt

UnsignedInt

UnsignedLong

UnsignedLong

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

Scene field name.

See SceneData for more information.

Apart from the builtin field names it's possible to have custom ones, which use the upper half of the enum range. While it's unlikely to have billions of custom fields, the enum intentionally reserves a full 31-bit range to avoid the need to remap field identifiers coming from 3rd party ECS frameworks, for example.

Custom fields are detected via isSceneFieldCustom() and can be converted to and from a numeric identifier using sceneFieldCustom(SceneField) and sceneFieldCustom(UnsignedInt). Unlike the builtin ones, these can be of any type. An importer that exposes custom fields then may also provide a string mapping using AbstractImporter::sceneFieldForName() and AbstractImporter::sceneFieldName(); conversely a scene converter supporting custom scene fields can have the string mapping specified via AbstractSceneConverter::setSceneFieldName(). See documentation of a particular importer and scene converter for details.

Enumerators
Parent

Parent object. Type is usually SceneFieldType::Int, but can be also any of Byte, Short or a Long. A value of -1 means there's no parent. An object should have only one parent, altough this isn't enforced in any way, and which of the duplicate fields gets used is not defined.

Transformation

Transformation. Type is usually SceneFieldType::Matrix3x3 for 2D and SceneFieldType::Matrix4x4 for 3D, but can be also any of Matrix3x3d, Matrix3x2 or Matrix3x2d (with the bottom row implicitly assumed to be $ \begin{pmatrix} 0 & 0 & 1 \end{pmatrix} $ ), DualComplex or DualComplexd for 2D and Matrix4x4d, Matrix4x3 or Matrix4x3d (with the bottom row implicitly assumed to be $ \begin{pmatrix} 0 & 0 & 0 & 1 \end{pmatrix} $ ), DualQuaternion or DualQuaterniond for 3D. An object should have only one transformation, altough this isn't enforced in any way, and which of the duplicate fields gets used is not defined.

The transformation can be also represented by separate SceneField::Translation, SceneField::Rotation and SceneField::Scaling fields. All present transformation-related fields are expected to have the same dimensionality — either all 2D or all 3D. If both SceneField::Transformation and TRS fields are specified, it's expected that all objects that have TRS fields have a combined transformation field as well, and SceneData::transformations2DAsArray() / SceneData::transformations3DAsArray() then takes into account only the combined transformation field. TRS fields can however be specified only for a subset of transformed objects, useful for example when only certain objects have these properties animated.

Translation

Translation. Type is usually SceneFieldType::Vector2 for 2D and SceneFieldType::Vector3 for 3D, but can be also any of Vector2d for 2D and Vector3d for 3D. An object should have only one translation, altough this isn't enforced in any way, and which of the duplicate fields gets used is not defined.

The translation field usually is (but doesn't have to be) complemented by a SceneField::Rotation and SceneField::Scaling, which, if present, are expected to all share the same object mapping view and have the same dimensionality, either all 2D or all 3D. The TRS components can either completely replace SceneField::Transformation or be provided just for a subset of it — see its documentation for details.

Rotation

Rotation. Type is usually SceneFieldType::Complex for 2D and SceneFieldType::Quaternion for 3D, but can be also any of Complexd for 2D and Quaterniond for 3D. An object should have only one rotation, altough this isn't enforced in any way, and which of the duplicate fields gets used is not defined.

The rotation field usually is (but doesn't have to be) complemented by a SceneField::Translation and SceneField::Scaling, which, if present, are expected to all share the same object mapping view and have the same dimensionality, either all 2D or all 3D. The TRS components can either completely replace SceneField::Transformation or be provided just for a subset of it — see its documentation for details.

Scaling

Scaling. Type is usually SceneFieldType::Vector2 for 2D and SceneFieldType::Vector3 for 3D, but can be also any of Vector2d for 2D and Vector3d for 3D. An object should have only one scaling, altough this isn't enforced in any way, and which of the duplicate fields gets used is not defined.

The scaling field usually is (but doesn't have to be) complemented by a SceneField::Translation and SceneField::Rotation, which, if present, are expected to all share the same object mapping view and have the same dimensionality, either all 2D or all 3D. The TRS components can either completely replace SceneField::Transformation or be provided just for a subset of it — see its documentation for details.

Mesh

ID of a mesh associated with this object, corresponding to the ID passed to AbstractImporter::mesh(). Type is usually SceneFieldType::UnsignedInt, but can be also any of UnsignedByte or UnsignedShort. An object can have multiple meshes associated.

Usually complemented with a SceneField::MeshMaterial, although not required. If present, both should share the same object mapping view. Objects with multiple meshes then have the Nth mesh associated with the Nth material.

MeshMaterial

ID of a material for a SceneField::Mesh, corresponding to the ID passed to AbstractImporter::material() or -1 if the mesh has no material associated. Type is usually SceneFieldType::Int, but can be also any of Byte or Short. Expected to share the object mapping view with SceneField::Mesh.

Light

ID of a light associated with this object, corresponding to the ID passed to AbstractImporter::light(). Type is usually SceneFieldType::UnsignedInt, but can be also any of UnsignedByte or UnsignedShort. An object can have multiple lights associated.

Camera

ID of a camera associated with this object, corresponding to the ID passed to AbstractImporter::camera(). Type is usually SceneFieldType::UnsignedInt, but can be also any of UnsignedByte or UnsignedShort. An object can have multiple cameras associated.

Skin

ID of a skin associated with this object, corresponding to the ID passed to AbstractImporter::skin2D() or AbstractImporter::skin3D(), depending on whether the scene has a 2D or 3D transformation. Type is usually SceneFieldType::UnsignedInt, but can be also any of UnsignedByte or UnsignedShort. An object can have multiple skins associated.

ImporterState

Importer state for given object, per-object counterpart to scene-specific SceneData::importerState(). Type is usually SceneFieldType::Pointer but can be also SceneFieldType::MutablePointer. An object should have only one importer state, altough this isn't enforced in any way, and which of the duplicate fields gets used is not defined.

enum class Magnum::Trade::SceneFieldType: UnsignedShort new in Git master

Scene field type.

A type in which a SceneField is stored. See SceneData for more information.

Enumerators
Bit

A single bit or an array of bits. Use SceneData::fieldBits() or fieldBitArrays() for convenient access.

Float

Float

Half

Half

Double

Double

UnsignedByte

UnsignedByte

Byte

Byte

UnsignedShort

UnsignedShort

Short

Short

UnsignedInt

UnsignedInt

Int

Int

UnsignedLong

UnsignedLong

Long

Long

Vector2

Vector2

Vector2h

Vector2h

Vector2d

Vector2d

Vector2ub

Vector2ub

Vector2b

Vector2b

Vector2us

Vector2us

Vector2s

Vector2s

Vector2ui

Vector2ui

Vector2i

Vector2i

Vector3

Vector3

Vector3h

Vector3h

Vector3d

Vector3d

Vector3ub

Vector3ub

Vector3b

Vector3b

Vector3us

Vector3us

Vector3s

Vector3s

Vector3ui

Vector3ui

Vector3i

Vector3i

Vector4

Vector4

Vector4h

Vector4h

Vector4d

Vector4d

Vector4ub

Vector4ub

Vector4b

Vector4b

Vector4us

Vector4us

Vector4s

Vector4s

Vector4ui

Vector4ui

Vector4i

Vector4i

Matrix2x2

Matrix2x2

Matrix2x2h

Matrix2x2h

Matrix2x2d

Matrix2x2d

Matrix2x3

Matrix2x3

Matrix2x3h

Matrix2x3h

Matrix2x3d

Matrix2x3d

Matrix2x4

Matrix2x4

Matrix2x4h

Matrix2x4h

Matrix2x4d

Matrix2x4d

Matrix3x2

Matrix3x2

Matrix3x2h

Matrix3x2h

Matrix3x2d

Matrix3x2d

Matrix3x3

Matrix3x3

Matrix3x3h

Matrix3x3h

Matrix3x3d

Matrix3x3d

Matrix3x4

Matrix3x4

Matrix3x4h

Matrix3x4h

Matrix3x4d

Matrix3x4d

Matrix4x2

Matrix4x2

Matrix4x2h

Matrix4x2h

Matrix4x2d

Matrix4x2d

Matrix4x3

Matrix4x3

Matrix4x3h

Matrix4x3h

Matrix4x3d

Matrix4x3d

Matrix4x4

Matrix4x4

Matrix4x4h

Matrix4x4h

Matrix4x4d

Matrix4x4d

Range1D

Range1D

Range1Dh

Range1Dh

Range1Dd

Range1Dd

Range1Di

Range1Di

Range2D

Range2D

Range2Dh

Range2Dh

Range2Dd

Range2Dd

Range2Di

Range2Di

Range3D

Range3D

Range3Dh

Range3Dh

Range3Dd

Range3Dd

Range3Di

Range3Di

Complex

Complex

Complexd

Complexd

DualComplex

DualComplex

DualComplexd

DualComplexd

Quaternion

Quaternion

Quaterniond

Quaterniond

DualQuaternion

DualQuaternion

DualQuaterniond

DualQuaterniond

Deg

Deg

Degh

Degh

Degd

Degh

Rad

Rad

Radh

Radh

Radd

Radd

Pointer

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

StringOffset32

32-bit string offsets with implicit sizes. Use SceneData::fieldStrings() for convenient access.

Internally, the first string starts at SceneData::fieldStringData(), second string starts at fieldStringData() plus field<UnsignedInt>()[0], etc. String sizes are implicitly the distance between two successive offsets or field<UnsignedInt>()[0] in case of the first string; if SceneFieldFlag::NullTerminatedString is set the distance includes the null terminator.

The StringOffset* types are useful mainly for cases where each string is unique, for strings with many duplicates SceneFieldType::StringRange* or StringRangeNullTerminated32* may be a more space-efficient option.

StringOffset8

8-bit string offsets with implicit sizes. Use SceneData::fieldStrings() for convenient access.

The internal layout is similar to SceneFieldType::StringOffset32 except that UnsignedByte is used as the type, see its documentation for more information.

StringOffset16

16-bit string offsets with implicit sizes. Use SceneData::fieldStrings() for convenient access.

The internal layout is similar to SceneFieldType::StringOffset32 except that UnsignedShort is used as the type, see its documentation for more information.

StringOffset64

64-bit string offsets with implicit sizes. Use SceneData::fieldStrings() for convenient access.

The internal layout is similar to SceneFieldType::StringOffset32 except that UnsignedLong is used as the type, see its documentation for more information.

StringRange32

Containers::Pair of 32-bit string offsets and sizes. Use SceneData::fieldStrings() for convenient access.

Internally, string i starts at SceneData::fieldStringData() plus field<Containers::Pair<UnsignedInt, UnsignedInt>>()[i].first() and has a size of field<Containers::Pair<UnsignedInt, UnsignedInt>>()[i].second().

The main use case for StringRange* types is to be able to reference the same string from multiple field entries without having to duplicate it. For strings without duplicates SceneFieldType::StringOffset* may be a more space-efficient option, as the size is implicit. Alternatively, StringRangeNullTerminated32* has the same space requirements as StringOffset* with SceneFieldFlag::NullTerminatedString set and allows deduplication, however at the cost of a std::strlen() call on every access.

StringRange8

Containers::Pair of 8-bit string offsets and sizes. Use SceneData::fieldStrings() for convenient access.

The internal layout is similar to SceneFieldType::StringRange32 except that UnsignedByte is used for the pair types, see its documentation for more information.

StringRange16

Containers::Pair of 16-bit string offsets and sizes. Use SceneData::fieldStrings() for convenient access.

The internal layout is similar to SceneFieldType::StringRange32 except that UnsignedShort is used for the pair types, see its documentation for more information.

StringRange64

Containers::Pair of 64-bit string offsets and sizes. Use SceneData::fieldStrings() for convenient access.

The internal layout is similar to SceneFieldType::StringRange32 except that UnsignedLong is used for the pair types, see its documentation for more information.

StringRangeNullTerminated32

32-bit offsets to null-terminated strings. Use SceneData::fieldStrings() for convenient access.

Compared to SceneFieldType::StringRange32 stores just the offset, the size is calculated on-the-fly with std::strlen().

Internally, string i starts at SceneData::fieldStringData() plus field<UnsignedInt>()[i], size is implicitly until the first '\0' byte. See SceneFieldType::StringRange32 for use case recommendations.

StringRangeNullTerminated8

8-bit offsets to null-terminated strings. Use SceneData::fieldStrings() for convenient access.

The internal layout is similar to SceneFieldType::StringRangeNullTerminated32 except that UnsignedByte is used as the type, see its documentation for more information.

StringRangeNullTerminated16

16-bit offsets to null-terminated strings. Use SceneData::fieldStrings() for convenient access.

The internal layout is similar to SceneFieldType::StringRangeNullTerminated32 except that UnsignedShort is used as the type, see its documentation for more information.

StringRangeNullTerminated64

32-bit offsets to null-terminated strings. Use SceneData::fieldStrings() for convenient access.

The internal layout is similar to SceneFieldType::StringRangeNullTerminated32 except that UnsignedLong is used as the type, see its documentation for more information.

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

Scene field flag.

Enumerators
OffsetOnly

The field is offset-only, i.e. doesn't contain the data views directly but referes to unspecified external data. Set implicitly by the SceneFieldData::SceneFieldData(SceneField, std::size_t, SceneMappingType, std::size_t, std::ptrdiff_t, SceneFieldType, std::size_t, std::ptrdiff_t, UnsignedShort, SceneFieldFlags) constructor, can't be used for any other constructor.

OrderedMapping

The field has an ordered object mapping, i.e. a monotonically increasing sequence. Object IDs in fields marked with this flag can be looked up with an $ \mathcal{O}(\log{} n) $ complexity, gaps and duplicates are possible.

Note that validity of the object mapping data isn't checked in any way and if the data doesn't correspond to rules of the flag, queries such as SceneData::findFieldObjectOffset() may return a wrong value.

If a field has neither this nor the SceneFieldFlag::ImplicitMapping flag, it's assumed to be unordered, with an $ \mathcal{O}(n) $ lookup complexity.

ImplicitMapping

The field has an implicit object mapping, i.e. a contiguous sequence from 0 up to size of the field. A superset of SceneFieldFlag::OrderedMapping. Object IDs in fields marked with this flag can be looked up with an $ \mathcal{O}(1) $ complexity, but the field is restricted to exactly one value for each object.

Note that validity of the object mapping data isn't checked in any way and if the data doesn't correspond to rules of the flag, queries such as SceneData::findFieldObjectOffset() may return a wrong value.

If a field has neither this nor the SceneFieldFlag::OrderedMapping flag, it's assumed to be unordered, with an $ \mathcal{O}(n) $ lookup complexity.

MultiEntry

The field may have multiple entries for the same object. Meant to be used as a hint to distinguish between fields that are expected to have at most one entry for an object and fields that can have multiple entries for an object but sometimes have just one.

Note that presence of this flag isn't enforced in any way, fields without this flag may still have multiple entries for the same object.

Can't be set for SceneField::Parent, Transformation, Translation, Rotation or Scaling; however mapping uniqueness for those fields isn't enforced in any way either.

NullTerminatedString

The string field is null-terminated, i.e. string views returned from SceneData::fieldStrings() will always have Containers::StringViewFlag::NullTerminated set. Internally it means that the distance between successive SceneFieldType::StringOffset* entries includes the null terminator; SceneFieldType::StringRange* size is excluding the null terminator but assumes it's present right after; for SceneFieldType,StringRangeNullTerminated* it's set implicitly as that's the default behavior.

Can only be set for string SceneFieldType.

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

Texture type.

Enumerators
Texture1D

One-dimensional texture. The TextureData::image() ID corresponds to an image from AbstractImporter::image1D().

Texture1DArray new in Git master

One-dimensional texture array. The TextureData::image() ID corresponds to an image from AbstractImporter::image2D().

Texture2D

Two-dimensional texture. The TextureData::image() ID corresponds to an image from AbstractImporter::image2D().

Texture2DArray new in Git master

Two-dimensional texture array. The TextureData::image() ID corresponds to an image from AbstractImporter::image3D().

Texture3D

Three-dimensional texture. The TextureData::image() ID corresponds to an image from AbstractImporter::image3D().

CubeMap new in Git master

Cube map texture. The TextureData::image() ID corresponds to an image from AbstractImporter::image3D(), which is assumed to have exactly 6 layers in order +X, -X, +Y, -Y, +Z, -Z.

CubeMapArray new in Git master

Cube map texture array. The TextureData::image() ID corresponds to an image from AbstractImporter::image3D(), which is assumed to have the layer count divisible by 6, each set in order +X, -X, +Y, -Y, +Z, -Z.

Cube

Cube map texture.

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 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, SceneContent value) new in Git master

Debug output operator.

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

Debug output operator.

SceneContents Magnum::Trade::sceneContentsFor(const AbstractImporter& importer) new in Git master

Scene contents for an importer.

Returns contents exposed by given importer, i.e. all for which the importer returns a non-zero count. Expects that the importer is opened. SceneContent::Names is present always. As querying level count usually involves parsing additional files and thus may be time- and memory-consuming operation, SceneContent::MeshLevels and ImageLevels is never present.

SceneContents Magnum::Trade::sceneContentsFor(const AbstractSceneConverter& converter) new in Git master

Scene contents supported by a converter.

Returns contents supported by given converter, as exposed via AbstractSceneConverter::features(). SceneContent::Names is present always.

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

Debug output operator.

UnsignedInt Magnum::Trade::animationTrackTypeAlignment(AnimationTrackType type) new in Git master

Alignment of given animation track data type.

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

Debug output operator.

bool Magnum::Trade::isAnimationTrackTargetCustom(AnimationTrackTarget name) constexpr new in Git master

Whether a target for an animation track is custom.

Returns true if name has a value in the upper 15 bits of the enum range, false otherwise.

AnimationTrackTarget Magnum::Trade::animationTrackTargetCustom(UnsignedShort id) constexpr new in Git master

Create a custom target for an animation track.

Returns a custom animation track target with index id. The index is expected to fit into 15 bits. Use animationTrackTargetCustom(AnimationTrackTarget) to get the index back.

UnsignedShort Magnum::Trade::animationTrackTargetCustom(AnimationTrackTarget name) constexpr new in Git master

Get index of a custom target for an animation track.

Inverse to animationTrackTargetCustom(UnsignedShort). Expects that the type is custom.

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, LightType value)

Debug output operator.

Containers::StringView Magnum::Trade::materialLayerName(MaterialLayer layer)

Material layer name as a string.

Expects that layer is a valid MaterialLayer value. The returned view has both Containers::StringViewFlag::Global and NullTerminated set.

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

Debug output operator.

Containers::StringView Magnum::Trade::materialAttributeName(MaterialAttribute attribute) new in Git master

Material layer name as a string.

Expects that attribute is a valid MaterialAttribute value. The returned view has both Containers::StringViewFlag::Global and NullTerminated set.

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 in the upper 15 bits of the enum range, 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 fit into 15 bits. 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. See documentation about populating a MeshData instance for more information.

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, SceneMappingType value) new in Git master

Debug output operator.

UnsignedInt Magnum::Trade::sceneMappingTypeSize(SceneMappingType type) new in Git master

Size of given scene object mapping type.

UnsignedInt Magnum::Trade::sceneMappingTypeAlignment(SceneMappingType type) new in Git master

Alignment of given scene object mapping type.

Returns the same value as sceneMappingTypeSize().

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

Debug output operator.

bool Magnum::Trade::isSceneFieldCustom(SceneField name) constexpr new in Git master

Whether a scene field is custom.

Returns true if name has a value in the upper 31 bits of the enum range, false otherwise.

SceneField Magnum::Trade::sceneFieldCustom(UnsignedInt id) constexpr new in Git master

Create a custom scene field.

Returns a custom scene field with index id. The index is expected to fit into 31 bits. Use sceneFieldCustom(SceneField) to get the index back.

UnsignedInt Magnum::Trade::sceneFieldCustom(SceneField name) constexpr new in Git master

Get index of a custom scene field.

Inverse to sceneFieldCustom(UnsignedInt). Expects that the field is custom.

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

Debug output operator.

UnsignedInt Magnum::Trade::sceneFieldTypeSize(SceneFieldType type) new in Git master

Size of given scene field type.

Expects that type isn't SceneFieldType::Bit, for which the size isn't representable in bytes.

UnsignedInt Magnum::Trade::sceneFieldTypeAlignment(SceneFieldType type) new in Git master

Alignment of given scene field type.

Expects that type isn't SceneFieldType::Bit, for which the alignment isn't representable in bytes.

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

Debug output operator.

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

Debug output operator.

Containers::Array<SceneFieldData> Magnum::Trade::sceneFieldDataNonOwningArray(Containers::ArrayView<const SceneFieldData> view) new in Git master

Create a non-owning array of SceneFieldData items.

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

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

Debug output operator.