X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=ETL%2Ftrunk%2FETL%2F_curve_func.h;h=b2898aaf201fa772c5dd83febe3e14b77ec5e0bf;hb=b0d82d28d294043cd7bf90f89ac802bf2b2f71fe;hp=b1be012dd436f3d80624af07d42294629302aa99;hpb=117425a5858bb094f2e54af5d018499ab703b227;p=synfig.git diff --git a/ETL/trunk/ETL/_curve_func.h b/ETL/trunk/ETL/_curve_func.h index b1be012..b2898aa 100644 --- a/ETL/trunk/ETL/_curve_func.h +++ b/ETL/trunk/ETL/_curve_func.h @@ -1,7 +1,7 @@ /*! ======================================================================== ** Extended Template and Library ** Utility Curve Template Class Implementations -** $Id: _curve_func.h,v 1.1.1.1 2005/01/04 01:31:47 darco Exp $ +** $Id$ ** ** Copyright (c) 2002 Robert B. Quattlebaum Jr. ** @@ -36,15 +36,17 @@ 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)) ); - } + } }; template @@ -55,10 +57,10 @@ struct distance_func : public std::binary_function T delta=b-a; return static_cast(delta*delta); } - + K cook(const K &x)const { return x*x; } K uncook(const K &x)const { return sqrt(x); } - + }; /* -- E N D ----------------------------------------------------------------- */