X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fswfc-interpolation.h;fp=src%2Fswfc-interpolation.h;h=173ae9b26ff2e1b1967683490baac9d2414421b3;hb=3ef17c4cee41231e1eed731c08381d3ddf0c8d1a;hp=0000000000000000000000000000000000000000;hpb=d1920e49f268abad90e5aabed8b65f6ea048a681;p=swftools.git diff --git a/src/swfc-interpolation.h b/src/swfc-interpolation.h new file mode 100644 index 0000000..173ae9b --- /dev/null +++ b/src/swfc-interpolation.h @@ -0,0 +1,116 @@ +/* swfc- Compiles swf code (.sc) files into .swf files. + + Part of the swftools package. + + Copyright (c) 2007 Huub Schaeks + Copyright (c) 2007 Matthias Kramm + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef __EASE_H +#define __EASE_H + +typedef struct _interpolation { + int function; + float speed, amplitude, growth, damping; + int bounces; +} interpolation_t; + +enum { + IF_LINEAR = 1, + IF_QUAD_IN = 2, + IF_QUAD_OUT = 3, + IF_QUAD_IN_OUT = 4, + IF_CUBIC_IN = 5, + IF_CUBIC_OUT = 6, + IF_CUBIC_IN_OUT = 7, + IF_QUART_IN = 8, + IF_QUART_OUT = 9, + IF_QUART_IN_OUT = 10, + IF_QUINT_IN = 11, + IF_QUINT_OUT = 12, + IF_QUINT_IN_OUT = 13, + IF_CIRCLE_IN = 14, + IF_CIRCLE_OUT = 15, + IF_CIRCLE_IN_OUT = 16, + IF_EXPONENTIAL_IN = 17, + IF_EXPONENTIAL_OUT = 18, + IF_EXPONENTIAL_IN_OUT = 19, + IF_SINE_IN = 20, + IF_SINE_OUT = 21, + IF_SINE_IN_OUT = 22, + IF_ELASTIC_IN = 23, + IF_ELASTIC_OUT = 24, + IF_ELASTIC_IN_OUT = 25, + IF_BACK_IN = 26, + IF_BACK_OUT = 27, + IF_BACK_IN_OUT = 28, + IF_BOUNCE_IN = 29, + IF_BOUNCE_OUT = 30, + IF_BOUNCE_IN_OUT = 31, + IF_FAST_BOUNCE_IN = 32, + IF_FAST_BOUNCE_OUT = 33, + IF_FAST_BOUNCE_IN_OUT = 34 +}; + +#define PI 3.14159265358979 + +float linear(float fraction, float start, float delta); + +float quadIn(float fraction, float start, float delta); +float quadOut(float fraction, float start, float delta); +float quadInOut(float fraction, float start, float delta); + +float cubicIn(float fraction, float start, float delta); +float cubicOut(float fraction, float start, float delta); +float cubicInOut(float fraction, float start, float delta); + +float quartIn(float fraction, float start, float delta); +float quartOut(float fraction, float start, float delta); +float quartInOut(float fraction, float start, float delta); + +float quintIn(float fraction, float start, float delta); +float quintOut(float fraction, float start, float delta); +float quintInOut(float fraction, float start, float delta); + +float circleIn(float fraction, float start, float delta); +float circleOut(float fraction, float start, float delta); +float circleInOut(float fraction, float start, float delta); + +float exponentialIn(float fraction, float start, float delta); +float exponentialOut(float fraction, float start, float delta); +float exponentialInOut(float fraction, float start, float delta); + +float sineIn(float fraction, float start, float delta); +float sineOut(float fraction, float start, float delta); +float sineInOut(float fraction, float start, float delta); + +float elasticIn(float fraction, float start, float delta, float amplitude, int bounces, float damping); +float elasticOut(float fraction, float start, float delta, float amplitude, int bounces, float damping); +float elasticInOut(float fraction, float start, float delta, float amplitude, int bounces, float damping); + +float backIn(float fraction, float start, float delta, float speed); +float backOut(float fraction, float start, float delta, float speed); +float backInOut(float fraction, float start, float delta, float speed); + +float bounceIn(float fraction, float start, float delta, int bounces, float growth, float damping); +float bounceOut(float fraction, float start, float delta, int bounces, float growth, float damping); +float bounceInOut(float fraction, float start, float delta, int bounces, float growth, float damping); + +float fastBounceIn(float fraction, float start, float delta, int bounces, float growth, float damping); +float fastBounceOut(float fraction, float start, float delta, int bounces, float growth, float damping); +float fastBounceInOut(float fraction, float start, float delta, int bounces, float growth, float damping); + +#endif