Rev 18 | Rev 134 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | toby | 1 | /* |
18 | toby | 2 | This file is part of "Filter Foundry", a filter plugin for Adobe Photoshop |
2 | toby | 3 | Copyright (C) 2003-5 Toby Thain, toby@telegraphics.com.au |
4 | |||
5 | This program is free software; you can redistribute it and/or modify |
||
117 | dmarschall | 6 | it under the terms of the GNU General Public License as published by |
2 | toby | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. |
||
9 | |||
10 | This program is distributed in the hope that it will be useful, |
||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
13 | GNU General Public License for more details. |
||
14 | |||
117 | dmarschall | 15 | You should have received a copy of the GNU General Public License |
2 | toby | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
18 | */ |
||
19 | |||
20 | #include <math.h> |
||
21 | |||
22 | |||
23 | #ifndef M_PI |
||
117 | dmarschall | 24 | #define M_PI 3.14159265358979323846264338327 |
2 | toby | 25 | #endif |
26 | |||
27 | |||
28 | #include "symtab.h" |
||
29 | |||
30 | enum{ COSTABSIZE=1024,TANTABSIZE=512 }; |
||
31 | |||
32 | extern value_type costab[],tantab[]; |
||
33 | |||
34 | #define DEG2RAD(x) ((x)*M_PI/180.) |
||
35 | #define RAD2DEG(x) ((x)*180./M_PI) |
||
36 | |||
37 | /* [trig functions return] an integer between -512 and 512, inclusive (Windows) |
||
38 | or -1024 and 1024, inclusive (Mac OS) */ |
||
39 | #define TRIGAMP 1024 |
||
40 | #define FFANGLE(v) ((v)*M_PI/512.) |
||
41 | #define TO_FFANGLE(v) ((v)*512./M_PI) |
||
42 | |||
43 | #define INITRANDSEED() srand(691204) |
||
44 | |||
45 | value_type ff_src(value_type x,value_type y,value_type z); |
||
46 | value_type ff_rad(value_type d,value_type m,value_type z); |
||
47 | value_type ff_ctl(value_type i); |
||
48 | value_type ff_val(value_type i,value_type a,value_type b); |
||
49 | value_type ff_map(value_type i,value_type n); |
||
50 | value_type ff_min(value_type a,value_type b); |
||
51 | value_type ff_max(value_type a,value_type b); |
||
52 | value_type ff_abs(value_type a); |
||
53 | value_type ff_add(value_type a,value_type b,value_type c); |
||
54 | value_type ff_sub(value_type a,value_type b,value_type c); |
||
55 | value_type ff_dif(value_type a,value_type b); |
||
56 | value_type ff_rnd(value_type a,value_type b); |
||
57 | value_type ff_mix(value_type a,value_type b,value_type n,value_type d); |
||
58 | value_type ff_scl(value_type a,value_type il,value_type ih, |
||
59 | value_type ol,value_type oh); |
||
60 | unsigned long isqrt (unsigned long x); |
||
61 | value_type ff_sqr(value_type x); |
||
62 | value_type ff_sin(value_type x); |
||
63 | value_type ff_cos(value_type x); |
||
64 | value_type ff_tan(value_type x); |
||
65 | value_type ff_r2x(value_type d,value_type m); |
||
66 | value_type ff_r2y(value_type d,value_type m); |
||
67 | value_type ff_c2d(value_type d,value_type m); |
||
68 | value_type ff_c2m(value_type d,value_type m); |
||
69 | value_type ff_get(value_type i); |
||
70 | value_type ff_put(value_type v,value_type i); |
||
71 | value_type ff_cnv(value_type m11,value_type m12,value_type m13, |
||
72 | value_type m21,value_type m22,value_type m23, |
||
73 | value_type m31,value_type m32,value_type m33, |
||
74 | value_type d ); |
||
117 | dmarschall | 75 | value_type ff_rst(value_type seed); |