Krita Source Code Documentation
Loading...
Searching...
No Matches
nugrid.h
Go to the documentation of this file.
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 //
20
21
#ifndef NUGRID_H
22
#define NUGRID_H
23
24
#include "
local_definitions.h
"
25
26
typedef
enum
{
LINEAR
,
GENERAL
,
CENTER
,
LOG
}
grid_type
;
27
28
// Nonuniform grid base structure
29
typedef
struct
30
{
31
// public data
32
grid_type
code
;
33
double
start,
end
;
34
double
*
restrict
points
;
35
int
num_points
;
36
int (*reverse_map)(
void
*grid,
double
x);
37
}
NUgrid
;
38
39
#ifdef __cplusplus
40
extern
"C"
41
#endif
42
43
44
typedef
struct
45
{
46
// public data
47
grid_type
code
;
48
double
start,
end
;
49
double
*
restrict
points
;
50
int
num_points
;
51
int (*reverse_map)(
void
*grid,
double
x);
52
53
// private data
54
double
a
, aInv, b, bInv, center, even_half;
55
int
half_points
, odd_one;
56
bool
odd
;
57
}
center_grid
;
58
59
60
typedef
struct
61
{
62
// public data
63
grid_type
code
;
64
double
start,
end
;
65
double
*
restrict
points
;
66
int
num_points
;
67
int (*reverse_map)(
void
*grid,
double
x);
68
69
// private data
70
double
a
, ainv, startinv;
71
}
log_grid
;
72
73
74
#ifdef __cplusplus
75
extern
"C"
{
76
#endif
77
78
NUgrid
*
79
create_center_grid
(
double
start,
double
end,
double
ratio,
80
int
num_points);
81
82
NUgrid
*
83
create_log_grid
(
double
start,
double
end,
int
num_points);
84
85
NUgrid
*
86
create_general_grid
(
double
*points,
int
num_points);
87
88
void
89
destroy_grid
(
NUgrid
*grid);
90
91
#ifdef __cplusplus
92
}
93
#endif
94
#endif
local_definitions.h
restrict
#define restrict
Definition
local_definitions.h:4
create_log_grid
NUgrid * create_log_grid(double start, double end, int num_points)
Definition
nugrid.cpp:135
create_center_grid
NUgrid * create_center_grid(double start, double end, double ratio, int num_points)
Definition
nugrid.cpp:83
grid_type
grid_type
Definition
nugrid.h:26
CENTER
@ CENTER
Definition
nugrid.h:26
GENERAL
@ GENERAL
Definition
nugrid.h:26
LOG
@ LOG
Definition
nugrid.h:26
LINEAR
@ LINEAR
Definition
nugrid.h:26
destroy_grid
void destroy_grid(NUgrid *grid)
Definition
nugrid.cpp:173
create_general_grid
NUgrid * create_general_grid(double *points, int num_points)
Definition
nugrid.cpp:155
NUgrid
Definition
nugrid.h:30
NUgrid::num_points
int num_points
Definition
nugrid.h:35
NUgrid::end
double end
Definition
nugrid.h:33
NUgrid::code
grid_type code
Definition
nugrid.h:32
NUgrid::points
double *restrict points
Definition
nugrid.h:34
center_grid
Definition
nugrid.h:45
center_grid::end
double end
Definition
nugrid.h:48
center_grid::code
grid_type code
Definition
nugrid.h:47
center_grid::a
double a
Definition
nugrid.h:54
center_grid::points
double *restrict points
Definition
nugrid.h:49
center_grid::num_points
int num_points
Definition
nugrid.h:50
center_grid::half_points
int half_points
Definition
nugrid.h:55
center_grid::odd
bool odd
Definition
nugrid.h:56
log_grid
Definition
nugrid.h:61
log_grid::a
double a
Definition
nugrid.h:70
log_grid::code
grid_type code
Definition
nugrid.h:63
log_grid::num_points
int num_points
Definition
nugrid.h:66
log_grid::points
double *restrict points
Definition
nugrid.h:65
log_grid::end
double end
Definition
nugrid.h:64
libs
image
3rdparty
einspline
nugrid.h
Generated at
2025-11-04 02:30:02+01:00
from
Krita
branch
master
, commit
c9dde2e79561a8aea4a7e8d9ac99c98a7bac9e52