Skip to content

acl/core/additive_utils.h

#include "acl/core/additive_utils.h"

The additive clip formats, and the functions that combine a transform with its base.

additive_clip_format8

enum class additive_clip_format8 : uint8_t
{
    none = 0,
    relative = 1,
    additive0 = 2,
    additive1 = 3,
    custom = 4,
};

Describes the format used by the additive clip.

Value Description
none Clip is not additive Default scale value is 1.0
relative Clip is in relative space, transform_mul or equivalent is used to combine them. Default scale value is 1.0 transform = transform_mul(additive_transform, base_transform)
additive0 Clip is in additive space where scale is combined with: base_scale * additive_scale Default scale value is 1.0 transform = transform_add0(additive_transform, base_transform)
additive1 Clip is in additive space where scale is combined with: base_scale * (1.0 + additive_scale) Default scale value is 0.0 transform = transform_add1(additive_transform, base_transform)
custom Clip is combined with its base by a custom base adapter, see itransform_base_adapter_t. Only compression supports this format: it requires a base adapter in transform_base_desc_t. The functions in this file do not support it. Default scale value is the default scale of the base adapter.

get_additive_clip_format_name

const char* get_additive_clip_format_name(additive_clip_format8 format)

Returns the name of an additive clip format.

get_additive_clip_format

bool get_additive_clip_format(const char* format, additive_clip_format8& out_format)

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

transform_add0

rtm::vqvf transform_add0(rtm::vqvf base, rtm::vqvf additive)

Combines an additive transform with its base transform with the additive0 format. The scale is: base_scale * additive_scale.

transform_add1

rtm::vqvf transform_add1(rtm::vqvf base, rtm::vqvf additive)

Combines an additive transform with its base transform with the additive1 format. The scale is: base_scale * (1.0 + additive_scale).

transform_add_no_scale

rtm::vqvf transform_add_no_scale(rtm::vqvf base, rtm::vqvf additive)

Combines an additive transform with its base transform with the additive0 or additive1 format. The function ignores the scale and the scale of the result is 1.0.

apply_additive_to_base

rtm::vqvf apply_additive_to_base(
    additive_clip_format8 additive_format,
    rtm::vqvf base,
    rtm::vqvf additive)

Combines an additive transform with its base transform with the given additive format. With the none format, the function returns the additive transform. The function does not support the custom format.

apply_additive_to_base_no_scale

rtm::vqvf apply_additive_to_base_no_scale(
    additive_clip_format8 additive_format,
    rtm::vqvf base,
    rtm::vqvf additive)

Combines an additive transform with its base transform with the given additive format, without the scale. The scale of the result is 1.0, except with the none format where the function returns the additive transform. The function does not support the custom format.

convert_to_relative

rtm::vqvf convert_to_relative(rtm::vqvf base, rtm::vqvf transform)

Converts a transform into a transform relative to its base transform (the relative format).

convert_to_additive0

rtm::vqvf convert_to_additive0(rtm::vqvf base, rtm::vqvf transform)

Converts a transform into an additive transform with the additive0 format.

convert_to_additive1

rtm::vqvf convert_to_additive1(rtm::vqvf base, rtm::vqvf transform)

Converts a transform into an additive transform with the additive1 format.