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

magnum module

Root Magnum module

Modules

module math
Math library
module gl
OpenGL wrapping layer
module materialtools
Material tools
module meshtools
Mesh tools
module platform
Platform-specific application and context creation
module primitives
Primitive library
module shaders
Builtin shaders
module scenegraph
Scene graph library
module scenetools
Scene manipulation and optimization tools
module text
Text rendering
module trade
Data format exchange

Classes

class Deg
Degrees
class Rad
Radians
class BitVector2
Two-component vector of bits
class BitVector3
Three-component vector of bits
class BitVector4
Four-component vector of bits
class Vector2
Two-component float vector
class Vector3
Three-component float vector
class Vector4
Four-component float vector
class Vector2d
Two-component double vector
class Vector3d
Three-component double vector
class Vector4d
Four-component double vector
class Vector2i
Two-component signed integer vector
class Vector3i
Three-component signed integral vector
class Vector4i
Four-component signed integral vector
class Vector2ui
Two-component unsigned integral vector
class Vector3ui
Three-component unsigned integral vector
class Vector4ui
Four-component unsigned integral vector
class Color3
Color in linear RGB color space
class Color4
Color in linear RGBA color space
class Matrix2x2
2x2 float matrix
class Matrix2x3
2x3 float matrix
class Matrix2x4
2x4 float matrix
class Matrix3x2
3x2 float matrix
class Matrix3x3
3x3 float matrix
class Matrix3x4
3x4 float matrix
class Matrix4x2
4x2 float matrix
class Matrix4x3
4x3 float matrix
class Matrix4x4
4x4 float matrix
class Matrix2x2d
2x2 double matrix
class Matrix2x3d
2x3 double matrix
class Matrix2x4d
2x4 double matrix
class Matrix3x2d
3x2 double matrix
class Matrix3x3d
3x3 double matrix
class Matrix3x4d
3x4 double matrix
class Matrix4x2d
4x2 double matrix
class Matrix4x3d
4x3 double matrix
class Matrix4x4d
4x4 double matrix
class Matrix3
2D float transformation matrix
class Matrix4
3D float transformation matrix
class Matrix3d
2D double transformation matrix
class Matrix4d
3D double transformation matrix
class Quaternion
Float quaternion
class Quaterniond
Double quaternion
class Range1D
One-dimensional float range
class Range1Di
One-dimensional float range
class Range1Dd
One-dimensional double range
class Range2D
Two-dimensional float range
class Range2Di
Two-dimensional float range
class Range2Dd
Two-dimensional double range
class Range3D
Three-dimensional float range
class Range3Di
Three-dimensional float range
class Range3Dd
Three-dimensional double range
class PixelStorage
Pixel storage parameters
class Image1D
One-dimensional image
class Image2D
Two-dimensional image
class Image3D
Three-dimensional image
class CompressedImage1D
One-dimensional compressed image
class CompressedImage2D
Two-dimensional compressed image
class CompressedImage3D
Three-dimensional compressed image
class ImageView1D
One-dimensional image view
class ImageView2D
Two-dimensional image view
class ImageView3D
Three-dimensional image view
class MutableImageView1D
One-dimensional mutable image view
class MutableImageView2D
Two-dimensional mutable image view
class MutableImageView3D
Three-dimensional mutable image view
class CompressedImageView1D
One-dimensional compressed image view
class CompressedImageView2D
Two-dimensional compressed image view
class CompressedImageView3D
Three-dimensional compressed image view
class MutableCompressedImageView1D
One-dimensional mutable compressed image view
class MutableCompressedImageView2D
Two-dimensional mutable compressed image view
class MutableCompressedImageView3D
Three-dimensional mutable compressed image view

Enums

class MeshPrimitive: POINTS = 1 LINES = 2 LINE_LOOP = 3 LINE_STRIP = 4 TRIANGLES = 5 TRIANGLE_STRIP = 6 TRIANGLE_FAN = 7
Mesh primitive type
class MeshIndexType: UNSIGNED_BYTE = 1 UNSIGNED_SHORT = 2 UNSIGNED_INT = 3
Mesh index type
class PixelFormat: R8_UNORM = 1 RG8_UNORM = 2 RGB8_UNORM = 3 RGBA8_UNORM = 4 R8_SNORM = 5 RG8_SNORM = 6 RGB8_SNORM = 7 RGBA8_SNORM = 8 R8_SRGB = 9 RG8_SRGB = 10 RGB8_SRGB = 11 RGBA8_SRGB = 12 R8UI = 13 RG8UI = 14 RGB8UI = 15 RGBA8UI = 16 R8I = 17 RG8I = 18 RGB8I = 19 RGBA8I = 20 R16_UNORM = 21 RG16_UNORM = 22 RGB16_UNORM = 23 RGBA16_UNORM = 24 R16_SNORM = 25 RG16_SNORM = 26 RGB16_SNORM = 27 RGBA16_SNORM = 28 R16UI = 29 RG16UI = 30 RGB16UI = 31 RGBA16UI = 32 R16I = 33 RG16I = 34 RGB16I = 35 RGBA16I = 36 R32UI = 37 RG32UI = 38 RGB32UI = 39 RGBA32UI = 40 R32I = 41 RG32I = 42 RGB32I = 43 RGBA32I = 44 R16F = 45 RG16F = 46 RGB16F = 47 RGBA16F = 48 R32F = 49 RG32F = 50 RGB32F = 51 RGBA32F = 52 DEPTH16_UNORM = 53 DEPTH24_UNORM = 54 DEPTH32F = 55 STENCIL8UI = 56 DEPTH16_UNORM_STENCIL8UI = 57 DEPTH24_UNORM_STENCIL8UI = 58 DEPTH32F_STENCIL8UI = 59
Format of pixel data
class CompressedPixelFormat: BC1_RGB_UNORM = 1 BC1_RGB_SRGB = 2 BC1_RGBA_UNORM = 3 BC1_RGBA_SRGB = 4 BC2_RGBA_UNORM = 5 BC2_RGBA_SRGB = 6 BC3_RGBA_UNORM = 7 BC3_RGBA_SRGB = 8 BC4_R_UNORM = 9 BC4_R_SNORM = 10 BC5_RG_UNORM = 11 BC5_RG_SNORM = 12 BC6H_RGB_UFLOAT = 13 BC6H_RGB_SFLOAT = 14 BC7_RGBA_UNORM = 15 BC7_RGBA_SRGB = 16 EAC_R11_UNORM = 17 EAC_R11_SNORM = 18 EAC_RG11_UNORM = 19 EAC_RG11_SNORM = 20 ETC2_RGB8_UNORM = 21 ETC2_RGB8_SRGB = 22 ETC2_RGB8A1_UNORM = 23 ETC2_RGB8A1_SRGB = 24 ETC2_RGBA8_UNORM = 25 ETC2_RGBA8_SRGB = 26 ASTC_4X4_RGBA_UNORM = 27 ASTC_4X4_RGBA_SRGB = 28 ASTC_4X4_RGBAF = 29 ASTC_5X4_RGBA_UNORM = 30 ASTC_5X4_RGBA_SRGB = 31 ASTC_5X4_RGBAF = 32 ASTC_5X5_RGBA_UNORM = 33 ASTC_5X5_RGBA_SRGB = 34 ASTC_5X5_RGBAF = 35 ASTC_6X5_RGBA_UNORM = 36 ASTC_6X5_RGBA_SRGB = 37 ASTC_6X5_RGBAF = 38 ASTC_6X6_RGBA_UNORM = 39 ASTC_6X6_RGBA_SRGB = 40 ASTC_6X6_RGBAF = 41 ASTC_8X5_RGBA_UNORM = 42 ASTC_8X5_RGBA_SRGB = 43 ASTC_8X5_RGBAF = 44 ASTC_8X6_RGBA_UNORM = 45 ASTC_8X6_RGBA_SRGB = 46 ASTC_8X6_RGBAF = 47 ASTC_8X8_RGBA_UNORM = 48 ASTC_8X8_RGBA_SRGB = 49 ASTC_8X8_RGBAF = 50 ASTC_10X5_RGBA_UNORM = 51 ASTC_10X5_RGBA_SRGB = 52 ASTC_10X5_RGBAF = 53 ASTC_10X6_RGBA_UNORM = 54 ASTC_10X6_RGBA_SRGB = 55 ASTC_10X6_RGBAF = 56 ASTC_10X8_RGBA_UNORM = 57 ASTC_10X8_RGBA_SRGB = 58 ASTC_10X8_RGBAF = 59 ASTC_10X10_RGBA_UNORM = 60 ASTC_10X10_RGBA_SRGB = 61 ASTC_10X10_RGBAF = 62 ASTC_12X10_RGBA_UNORM = 63 ASTC_12X10_RGBA_SRGB = 64 ASTC_12X10_RGBAF = 65 ASTC_12X12_RGBA_UNORM = 66 ASTC_12X12_RGBA_SRGB = 67 ASTC_12X12_RGBAF = 68 ASTC_3X3X3_RGBA_UNORM = 69 ASTC_3X3X3_RGBA_SRGB = 70 ASTC_3X3X3_RGBAF = 71 ASTC_4X3X3_RGBA_UNORM = 72 ASTC_4X3X3_RGBA_SRGB = 73 ASTC_4X3X3_RGBAF = 74 ASTC_4X4X3_RGBA_UNORM = 75 ASTC_4X4X3_RGBA_SRGB = 76 ASTC_4X4X3_RGBAF = 77 ASTC_4X4X4_RGBA_UNORM = 78 ASTC_4X4X4_RGBA_SRGB = 79 ASTC_4X4X4_RGBAF = 80 ASTC_5X4X4_RGBA_UNORM = 81 ASTC_5X4X4_RGBA_SRGB = 82 ASTC_5X4X4_RGBAF = 83 ASTC_5X5X4_RGBA_UNORM = 84 ASTC_5X5X4_RGBA_SRGB = 85 ASTC_5X5X4_RGBAF = 86 ASTC_5X5X5_RGBA_UNORM = 87 ASTC_5X5X5_RGBA_SRGB = 88 ASTC_5X5X5_RGBAF = 89 ASTC_6X5X5_RGBA_UNORM = 90 ASTC_6X5X5_RGBA_SRGB = 91 ASTC_6X5X5_RGBAF = 92 ASTC_6X6X5_RGBA_UNORM = 93 ASTC_6X6X5_RGBA_SRGB = 94 ASTC_6X6X5_RGBAF = 95 ASTC_6X6X6_RGBA_UNORM = 96 ASTC_6X6X6_RGBA_SRGB = 97 ASTC_6X6X6_RGBAF = 98 PVRTC_RGB_2PP_UNORM = 99 PVRTC_RGB_2PP_SRGB = 100 PVRTC_RGBA_2PP_UNORM = 101 PVRTC_RGBA_2PP_SRGB = 102 PVRTC_RGB_4PP_UNORM = 103 PVRTC_RGB_4PP_SRGB = 104 PVRTC_RGBA_4PP_UNORM = 105 PVRTC_RGBA_4PP_SRGB = 106
Format of compressed pixel data
class SamplerFilter: NEAREST = 0 LINEAR = 1
Texture sampler filtering
class SamplerMipmap: BASE = 0 NEAREST = 1 LINEAR = 2
Texture sampler mip level selection
class SamplerWrapping: REPEAT = 0 MIRRORED_REPEAT = 1 CLAMP_TO_EDGE = 2 CLAMP_TO_BORDER = 3 MIRROR_CLAMP_TO_EDGE = 4
Texture sampler wrapping
class VertexFormat: FLOAT = 1 HALF = 2 DOUBLE = 3 UNSIGNED_BYTE = 4 UNSIGNED_BYTE_NORMALIZED = 5 BYTE = 6 BYTE_NORMALIZED = 7 UNSIGNED_SHORT = 8 UNSIGNED_SHORT_NORMALIZED = 9 SHORT = 10 SHORT_NORMALIZED = 11 UNSIGNED_INT = 12 INT = 13 VECTOR2 = 14 VECTOR2H = 15 VECTOR2D = 16 VECTOR2UB = 17 VECTOR2UB_NORMALIZED = 18 VECTOR2B = 19 VECTOR2B_NORMALIZED = 20 VECTOR2US = 21 VECTOR2US_NORMALIZED = 22 VECTOR2S = 23 VECTOR2S_NORMALIZED = 24 VECTOR2UI = 25 VECTOR2I = 26 VECTOR3 = 27 VECTOR3H = 28 VECTOR3D = 29 VECTOR3UB = 30 VECTOR3UB_NORMALIZED = 31 VECTOR3B = 32 VECTOR3B_NORMALIZED = 33 VECTOR3US = 34 VECTOR3US_NORMALIZED = 35 VECTOR3S = 36 VECTOR3S_NORMALIZED = 37 VECTOR3UI = 38 VECTOR3I = 39 VECTOR4 = 40 VECTOR4H = 41 VECTOR4D = 42 VECTOR4UB = 43 VECTOR4UB_NORMALIZED = 44 VECTOR4B = 45 VECTOR4B_NORMALIZED = 46 VECTOR4US = 47 VECTOR4US_NORMALIZED = 48 VECTOR4S = 49 VECTOR4S_NORMALIZED = 50 VECTOR4UI = 51 VECTOR4I = 52 MATRIX2X2 = 53 MATRIX2X2H = 54 MATRIX2X2D = 55 MATRIX2X2B_NORMALIZED = 56 MATRIX2X2S_NORMALIZED = 57 MATRIX2X3 = 58 MATRIX2X3H = 59 MATRIX2X3D = 60 MATRIX2X3B_NORMALIZED = 61 MATRIX2X3S_NORMALIZED = 62 MATRIX2X4 = 63 MATRIX2X4H = 64 MATRIX2X4D = 65 MATRIX2X4B_NORMALIZED = 66 MATRIX2X4S_NORMALIZED = 67 MATRIX2X2B_NORMALIZED_ALIGNED = 68 MATRIX2X3H_ALIGNED = 69 MATRIX2X3B_NORMALIZED_ALIGNED = 70 MATRIX2X3S_NORMALIZED_ALIGNED = 71 MATRIX3X2 = 72 MATRIX3X2H = 73 MATRIX3X2D = 74 MATRIX3X2B_NORMALIZED = 75 MATRIX3X2S_NORMALIZED = 76 MATRIX3X3 = 77 MATRIX3X3H = 78 MATRIX3X3D = 79 MATRIX3X3B_NORMALIZED = 80 MATRIX3X3S_NORMALIZED = 81 MATRIX3X4 = 82 MATRIX3X4H = 83 MATRIX3X4D = 84 MATRIX3X4B_NORMALIZED = 85 MATRIX3X4S_NORMALIZED = 86 MATRIX3X2B_NORMALIZED_ALIGNED = 87 MATRIX3X3H_ALIGNED = 88 MATRIX3X3B_NORMALIZED_ALIGNED = 89 MATRIX3X3S_NORMALIZED_ALIGNED = 90 MATRIX4X2 = 91 MATRIX4X2H = 92 MATRIX4X2D = 93 MATRIX4X2B_NORMALIZED = 94 MATRIX4X2S_NORMALIZED = 95 MATRIX4X3 = 96 MATRIX4X3H = 97 MATRIX4X3D = 98 MATRIX4X3B_NORMALIZED = 99 MATRIX4X3S_NORMALIZED = 100 MATRIX4X4 = 101 MATRIX4X4H = 102 MATRIX4X4D = 103 MATRIX4X4B_NORMALIZED = 104 MATRIX4X4S_NORMALIZED = 105 MATRIX4X2B_NORMALIZED_ALIGNED = 106 MATRIX4X3H_ALIGNED = 107 MATRIX4X3B_NORMALIZED_ALIGNED = 108 MATRIX4X3S_NORMALIZED_ALIGNED = 109
Vertex format

Data

BUILD_DEPRECATED: bool
Build with deprecated features enabled
BUILD_STATIC: bool
Static library build
TARGET_GL: bool
OpenGL interoperability
TARGET_GLES: bool
OpenGL ES target
TARGET_GLES2: bool
OpenGL ES 2.0 target
TARGET_WEBGL: bool
WebGL target
TARGET_EGL
EGL target
TARGET_VK: bool
Vulkan interoperability

Enum documentation

class magnum.PixelFormat()

Format of pixel data

The size, channel_format, channel_count, is_normalized, is_integral, is_floating_point, is_srgb, is_depth_or_stencil and is_implementation_specific properties match pixelFormatSize(), pixelFormatChannelFormat() and other helpers.

>>> PixelFormat.RGB8_SRGB.channel_count
3
>>> PixelFormat.RGB16F.is_floating_point
True

class magnum.CompressedPixelFormat()

Format of compressed pixel data

The block_size, block_data_size and is_implementation_specific properties match compressedPixelFormatBlockSize(), compressedPixelFormatBlockDataSize() and other helpers.

>>> CompressedPixelFormat.ASTC_6X5_RGBA_SRGB.block_size
Vector(6, 5, 1)
>>> CompressedPixelFormat.ASTC_6X5_RGBA_SRGB.block_data_size
16