X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=ETL%2Ftrunk%2FETL%2F_curve_func.h;h=b2898aaf201fa772c5dd83febe3e14b77ec5e0bf;hb=f500396480342bc90ba9083830bcce12725c188e;hp=fc33402c6f4cac2137b6a2b6074872226e74c773;hpb=36d01e1527fda602a9aed07d209eb34e6770bca8;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)) );