Skip to content

acl/core/track_formats.h

#include "acl/core/track_formats.h"

The formats of the rotation, translation, scale, and scalar samples.

rotation_format8

enum class rotation_format8 : uint8_t
{
    quatf_full = 0,
    quatf_drop_w_full = 2,
    quatf_drop_w_variable = 3,
    quatf_drop_largest_full = 4,
    quatf_drop_largest_variable = 5,
};

The format of the rotation samples of transform tracks.

Value Description
quatf_full Full precision quaternion, [x,y,z,w] stored with float32.
quatf_drop_w_full Full precision quaternion, [x,y,z] stored with float32 (w is dropped).
quatf_drop_w_variable Quantized quaternion, [x,y,z] stored with [N,N,N] bits (w is dropped, same number of bits per component).
quatf_drop_largest_full Full precision quaternion, [a,b,c] stored with float32 (the largest component of each sample is dropped).
quatf_drop_largest_variable Quantized quaternion, [a,b,c] stored with [N,N,N] bits (each segment drops the component whose smallest absolute value is the largest, same number of bits per component).

vector_format8

enum class vector_format8 : uint8_t
{
    vector3f_full = 0,
    vector3f_variable = 1,
};

The format of the translation and scale samples of transform tracks.

Value Description
vector3f_full Full precision vector3f, [x,y,z] stored with float32.
vector3f_variable Quantized vector3f, [x,y,z] stored with [N,N,N] bits (same number of bits per component).

scalar_format8

enum class scalar_format8 : uint8_t
{
    scalarf_full = 0,
    scalarf_variable = 1,
};

The format of the samples of scalar tracks. The compressed data does not store this value, the bit rate of each track tells how its samples are stored.

Value Description
scalarf_full Full precision scalar track, each component stored with float32.
scalarf_variable Quantized scalar track, each component stored with N bits (same number of bits per component), N depends on the track precision.

track_format8

union track_format8

The format of a rotation, translation, or scale sub-track.

track_format8::rotation

rotation_format8 rotation;

The format of a rotation sub-track.

track_format8::vector

vector_format8 vector;

The format of a translation or scale sub-track.

track_format8::track_format8

track_format8() noexcept

Constructs a format without a value.

explicit track_format8(rotation_format8 format) noexcept

Constructs the format of a rotation sub-track.

explicit track_format8(vector_format8 format) noexcept

Constructs the format of a translation or scale sub-track.

animation_track_type8

enum class animation_track_type8 : uint8_t
{
    rotation,
    translation,
    scale,
};

The type of a sub-track of a transform track.

Value Description
rotation The rotation sub-track.
translation The translation sub-track.
scale The scale sub-track.

rotation_variant8

enum class rotation_variant8 : uint8_t
{
    quat,
    quat_drop_w,
    quat_drop_largest,
};

The representation of a rotation, without its precision.

Value Description
quat A quaternion with the four components [x,y,z,w].
quat_drop_w A quaternion with the three components [x,y,z], [w] is dropped.
quat_drop_largest A quaternion with three components, one component is dropped.

get_rotation_format_name

const char* get_rotation_format_name(rotation_format8 format)

Returns the name of a rotation format.

get_rotation_format

bool get_rotation_format(const char* format, rotation_format8& out_format)

Finds the rotation format that has the given name. Returns true and writes the format to out_format when the name is valid, otherwise returns false.

get_vector_format_name

constexpr const char* get_vector_format_name(vector_format8 format)

Returns the name of a vector format.

get_vector_format

bool get_vector_format(const char* format, vector_format8& out_format)

Finds the vector format that has the given name. Returns true and writes the format to out_format when the name is valid, otherwise returns false.

get_scalar_format_name

constexpr const char* get_scalar_format_name(scalar_format8 format)

Returns the name of a scalar format.

get_scalar_format

bool get_scalar_format(const char* format, scalar_format8& out_format)

Finds the scalar format that has the given name. Returns true and writes the format to out_format when the name is valid, otherwise returns false.

get_rotation_variant

constexpr rotation_variant8 get_rotation_variant(rotation_format8 rotation_format)

Returns the rotation variant of a rotation format.

get_highest_variant_precision

constexpr rotation_format8 get_highest_variant_precision(rotation_variant8 variant)

Returns the full precision rotation format of a rotation variant.

is_rotation_format_variable

constexpr bool is_rotation_format_variable(rotation_format8 format)

Returns true if the rotation format uses a variable bit rate.

is_rotation_format_full_precision

constexpr bool is_rotation_format_full_precision(rotation_format8 format)

Returns true if the rotation format stores each component with float32.

is_vector_format_variable

constexpr bool is_vector_format_variable(vector_format8 format)

Returns true if the vector format uses a variable bit rate.

is_vector_format_full_precision

constexpr bool is_vector_format_full_precision(vector_format8 format)

Returns true if the vector format stores each component with float32.