Stepdance Software Library
Loading...
Searching...
No Matches
ScalingFilter2D Class Reference

Generates two output signals, each in proportion to an input signal. More...

#include <filters.hpp>

Inheritance diagram for ScalingFilter2D:

Public Member Functions

void begin (uint8_t mode=INCREMENTAL)
 Initializes the ScalingFilter2D with the specified mode. Must be called to set up the filter.
void set_ratio (ControlParameter ratio)
 Sets the scaling ratio between output and input.
void set_ratio (ControlParameter output_distance, ControlParameter input_distance)
 Sets the scaling ratio using output and input distances.

Public Attributes

ControlParameter ratio = 1.0
 ControlParameter scaling output relative to input (output/input). Can be set by calling set_ratio().
BlockPort input_1
 First input BlockPort. Map upstream components to this input.
BlockPort input_2
 Second input BlockPort. Map upstream components to this input.
BlockPort output_1
 First output BlockPort corresponding to the scaled input_1. Map downstream components to this output.
BlockPort output_2
 Second output BlockPort corresponding to the scaled input_2. Map downstream components to this output.

Protected Member Functions

void run ()

Detailed Description

Generates two output signals, each in proportion to an input signal.

The ScalingFilter2D class scales two input signals by a specified ratio to produce two output signals. This is useful for scaling a motion trajectory in two dimensions.

Member Function Documentation

◆ begin()

void ScalingFilter2D::begin ( uint8_t mode = INCREMENTAL)

Initializes the ScalingFilter2D with the specified mode. Must be called to set up the filter.

Parameters
modeMode of operation: INCREMENTAL or ABSOLUTE. Default is INCREMENTAL.

◆ set_ratio() [1/2]

void ScalingFilter2D::set_ratio ( ControlParameter output_distance,
ControlParameter input_distance )
inline

Sets the scaling ratio using output and input distances.

Parameters
output_distanceDistance in world units for the output.
input_distanceDistance in world units for the input.

◆ set_ratio() [2/2]

void ScalingFilter2D::set_ratio ( ControlParameter ratio)

Sets the scaling ratio between output and input.

Parameters
ratioScaling ratio (output / input).

The documentation for this class was generated from the following file: