X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=ETL%2Ftrunk%2FETL%2F_curve_func.h;h=b2898aaf201fa772c5dd83febe3e14b77ec5e0bf;hb=b0d82d28d294043cd7bf90f89ac802bf2b2f71fe;hp=fc33402c6f4cac2137b6a2b6074872226e74c773;hpb=337c51f149144c0844874ed20f71d780785c4127;p=synfig.git diff --git a/ETL/trunk/ETL/_curve_func.h b/ETL/trunk/ETL/_curve_func.h index fc33402..b2898aa 100644 --- a/ETL/trunk/ETL/_curve_func.h +++ b/ETL/trunk/ETL/_curve_func.h @@ -36,11 +36,13 @@ template struct affine_combo { + // from (a) to (x) : x = a(1-t) + b(t) T operator()(const T &a,const T &b,const K &t)const { return T( (b-a)*t+a ); } + // from (x) to (a) : a = (x-b(t)) / (1-t) T reverse(const T &x, const T &b, const K &t)const { return T( (x-t*b)*(static_cast(1)/(static_cast(1)-t)) );