19#ifndef __ANTILOGTAPERDELEGATE_H
20#define __ANTILOGTAPERDELEGATE_H
22#include "AAX_ITaperDelegate.h"
23#include "AAX_UtilsNative.h"
30template <
typename T,
int32_t RealPrecision=1000>
54 T GetMinimumValue()
const {
return mMinValue; }
55 T GetMaximumValue()
const {
return mMaxValue; }
56 T ConstrainRealValue(T value)
const;
57 T NormalizedToReal(
double normalizedValue)
const;
58 double RealToNormalized(T realValue)
const;
61 T Round(
double iValue)
const;
65 inline double calcAntiLogParameter(
double fNormalizedParam)
const
67 if(fNormalizedParam <= 0.0)
return 0.0;
68 if(fNormalizedParam >= 1.0)
return 1.0;
76 inline double calcAntiLogPluginValue(
double fPluginValue)
const
78 if(fPluginValue <= 0.0)
return 0.0;
79 if(fPluginValue >= 1.0)
return 1.0;
83 if(transformed >= 1.0) transformed = 1.0;
92template <
typename T,
int32_t RealPrecision>
95 double precision = RealPrecision;
97 return static_cast<T
>(floor(iValue * precision + 0.5) / precision);
98 return static_cast<T
>(iValue);
101template <
typename T,
int32_t RealPrecision>
109template <
typename T,
int32_t RealPrecision>
115template <
typename T,
int32_t RealPrecision>
119 value = Round(value);
121 if (value > mMaxValue)
123 if (value < mMinValue)
128template <
typename T,
int32_t RealPrecision>
131 normalizedValue = calcAntiLogPluginValue(normalizedValue);
132 double doubleRealValue = normalizedValue*(mMaxValue - mMinValue) + mMinValue;
134 T realValue = (T) doubleRealValue;
136 return ConstrainRealValue(realValue);
139template <
typename T,
int32_t RealPrecision>
142 double normValue = (realValue - mMinValue)/(mMaxValue - mMinValue);
143 return calcAntiLogParameter(normValue);
The AntiLogTaperDelegate object encapsulates an anti-log parameter. Note that the standard log potent...
Definition: AntiLogTaperDelegate.h:48
const double kCTCorrFactorAntiLogScale
concave/convex transform scaling factor
Definition: guiconstants.h:177
const double kCTCoefficient
concave and/or convex transform correction factor
Definition: guiconstants.h:135
const double kCTCorrFactorAntiUnity
inverse concave/convex transform correction factor at x = 1
Definition: guiconstants.h:163
const double kCTCorrFactorAntiLog
concave/convex transform correction factor
Definition: guiconstants.h:170
const double kCTCorrFactorZero
concave/convex transform correction factor at x = 0
Definition: guiconstants.h:142
globally utilized constants and enumerations