1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
20 #pragma once
21 
22 /** \file
23  * \ingroup bli
24  */
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 /** Find the index number of a voxel, given x/y/z integer coords and resolution vector. */
31 
32 #define BLI_VOXEL_INDEX(x, y, z, res) \
33   ((int64_t)(x) + (int64_t)(y) * (int64_t)(res)[0] + \
34    (int64_t)(z) * (int64_t)(res)[0] * (int64_t)(res)[1])
35 
36 /* all input coordinates must be in bounding box 0.0 - 1.0 */
37 float BLI_voxel_sample_nearest(const float *data, const int res[3], const float co[3]);
38 float BLI_voxel_sample_trilinear(const float *data, const int res[3], const float co[3]);
39 float BLI_voxel_sample_triquadratic(const float *data, const int res[3], const float co[3]);
40 float BLI_voxel_sample_tricubic(const float *data,
41                                 const int res[3],
42                                 const float co[3],
43                                 int bspline);
44 
45 #ifdef __cplusplus
46 }
47 #endif
48