IndexedGradientKnot< T_Float, T_Int > Struct Template Reference

#include <gradientmath.h>

Detailed Description

template<typename T_Float, typename T_Int>
struct maxon::IndexedGradientKnot< T_Float, T_Int >

This class is a data container for gradient knots. Each knot is defined by an index and a position in a 1D range.

Template Parameters
T_FloatThe type of real-valued position, recommended are Float, Float32 and Float64.
T_IntThe type of index, recommended are Int, Int32 and Int64. We recommend to match the bitdepth of index and position.

Public Member Functions

 IndexedGradientKnot (T_Int index, T_Float value)
 
Bool operator< (const IndexedGradientKnot &other) const
 

Public Attributes

T_Int _index
 
T_Float _position
 

Constructor & Destructor Documentation

◆ IndexedGradientKnot()

IndexedGradientKnot ( T_Int  index,
T_Float  value 
)

Constructs a gradient knot.

Parameters
[in]indexThe index of the knot.
[in]valueThe position of the knot.

Member Function Documentation

◆ operator<()

Bool operator< ( const IndexedGradientKnot< T_Float, T_Int > &  other) const

Lesser comparison of two knots. First criterion is the position of the knots. If the knot positions match ordinal comparison of the indices is done.

Parameters
[in]otherThe knot to compare with.
Returns
True if the knot is smaller, false otherwise.

Member Data Documentation

◆ _index

T_Int _index

◆ _position

T_Float _position