diff --git a/CHANGELOG b/CHANGELOG index dcf0d349..753903b0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ === 1.0.17 === * Implemented sqr1, sqr2, ssqr1 and ssqr2 functions. +* Implemented axis_apply_lin1 function. === 1.0.16 === * Fixed improper AVX-512 detection which causes crash for several functions. diff --git a/include/lsp-plug.in/dsp/common/graphics.h b/include/lsp-plug.in/dsp/common/graphics.h index 5bea1b98..9ca15fa0 100644 --- a/include/lsp-plug.in/dsp/common/graphics.h +++ b/include/lsp-plug.in/dsp/common/graphics.h @@ -53,6 +53,16 @@ typedef struct LSP_DSP_LIB_TYPE(hsla_light_eff_t) LSP_DSP_LIB_END_NAMESPACE +/** Do linear vector apply for 1D-schema: + * x[i] = x[i] + norm_x * (v[i] + zero) + * + * @param x destination vector for X coordinate + * @param v delta vector to apply + * @param zero graphics zero point shift + * @param norm_x X norming factor + */ +LSP_DSP_LIB_SYMBOL(void, axis_apply_lin1, float *x, const float *v, float zero, float norm_x, size_t count); + /** Do logarithmic vector apply for 1D-schema: * x[i] = x[i] + norm_x * logf(absf(v[i]*zero)) * diff --git a/include/private/dsp/arch/generic/graphics.h b/include/private/dsp/arch/generic/graphics.h index 198ecf61..f38d3e16 100644 --- a/include/private/dsp/arch/generic/graphics.h +++ b/include/private/dsp/arch/generic/graphics.h @@ -32,6 +32,15 @@ namespace lsp { namespace generic { + void axis_apply_lin1(float *x, const float *v, float zero, float norm_x, size_t count) + { + for (size_t i=0; i