Debian Codegraph @

libs/image/3rdparty/einspline/bspline_base.h

raw symbols SCIP
1 /////////////////////////////////////////////////////////////////////////////
2 // einspline: a library for creating and evaluating B-splines //
3 // Copyright (C) 2007 Kenneth P. Esler, Jr. //
4 // //
5 // This program is free software; you can redistribute it and/or modify //
6 // it under the terms of the GNU General Public License as published by //
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 // //
15 // You should have received a copy of the GNU General Public License //
16 // along with this program; if not, write to the Free Software //
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, //
18 // Boston, MA 02110-1301 USA //
19 /////////////////////////////////////////////////////////////////////////////
20
21 #ifndef BSPLINE_BASE_H
22 #define BSPLINE_BASE_H
23
24 //#include "config.h"
25 #include "local_definitions.h"
26
27 #ifdef __cplusplus
28 #include <complex>
29 typedef std::complex<float> complex_float;
30 typedef std::complex<double> complex_double;
31 #else
32 #include <complex.h>
33 typedef complex float complex_float;
34 typedef complex double complex_double;
35 #endif
36
37 // Conventions:
38 // Postfixes:
39 // s: single precision real
40 // d: double precision real
41 // c: single precision complex
42 // z: double precision complex
43
44 ////////////////////////////////////////////////////////////
45 ////////////////////////////////////////////////////////////
46 //// Basic type declarations ////
47 ////////////////////////////////////////////////////////////
48 ////////////////////////////////////////////////////////////
49
50 typedef enum { PERIODIC, DERIV1, DERIV2, FLAT, NATURAL, ANTIPERIODIC } bc_code;
51 typedef enum { U1D , U2D , U3D ,
52 NU1D , NU2D , NU3D ,
53 MULTI_U1D , MULTI_U2D , MULTI_U3D,
54 MULTI_NU1D, MULTI_NU2D, MULTI_NU3D } spline_code;
55 typedef enum { SINGLE_REAL, DOUBLE_REAL, SINGLE_COMPLEX, DOUBLE_COMPLEX }
56 type_code;
57
58 typedef struct
59 {
60 bc_code lCode, rCode;
61 float lVal, rVal;
62 } BCtype_s;
63
64 typedef struct
65 {
66 bc_code lCode, rCode;
67 double lVal, rVal;
68 } BCtype_d;
69
70 typedef struct
71 {
72 bc_code lCode, rCode;
73 float lVal_r, lVal_i, rVal_r, rVal_i;
74 } BCtype_c;
75
76 typedef struct
77 {
78 bc_code lCode, rCode;
79 double lVal_r, lVal_i, rVal_r, rVal_i;
80 } BCtype_z;
81
82
83 typedef struct
84 {
85 double start, end;
86 int num;
87
88 // private
89 double delta, delta_inv;
90 } Ugrid;
91
92 typedef struct
93 {
94 spline_code sp_code;
95 type_code t_code;
96 void *restrict coefs;
97 } Bspline;
98
99 #ifdef __cplusplus
100 extern "C"
101 #endif
102 void
103 destroy_Bspline (void *spline);
104
105 #endif