2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2015 Blender Foundation.
19 * All rights reserved.
21 * Contributor(s): Kevin Dietrich
23 * ***** END GPL LICENSE BLOCK *****
26 #ifndef __OPENVDB_CAPI_H__
27 #define __OPENVDB_CAPI_H__
35 struct OpenVDBFloatGrid;
36 struct OpenVDBIntGrid;
37 struct OpenVDBVectorGrid;
39 int OpenVDB_getVersionHex(void);
44 VEC_COVARIANT_NORMALIZE = 2,
45 VEC_CONTRAVARIANT_RELATIVE = 3,
46 VEC_CONTRAVARIANT_ABSOLUTE = 4,
49 struct OpenVDBFloatGrid *OpenVDB_export_grid_fl(
50 struct OpenVDBWriter *writer,
51 const char *name, float *data,
52 const int res[3], float matrix[4][4],
53 struct OpenVDBFloatGrid *mask);
55 struct OpenVDBIntGrid *OpenVDB_export_grid_ch(
56 struct OpenVDBWriter *writer,
57 const char *name, unsigned char *data,
58 const int res[3], float matrix[4][4],
59 struct OpenVDBFloatGrid *mask);
61 struct OpenVDBVectorGrid *OpenVDB_export_grid_vec(
62 struct OpenVDBWriter *writer,
64 const float *data_x, const float *data_y, const float *data_z,
65 const int res[3], float matrix[4][4], short vec_type,
67 struct OpenVDBFloatGrid *mask);
69 void OpenVDB_import_grid_fl(
70 struct OpenVDBReader *reader,
71 const char *name, float **data,
74 void OpenVDB_import_grid_ch(
75 struct OpenVDBReader *reader,
76 const char *name, unsigned char **data,
79 void OpenVDB_import_grid_vec(
80 struct OpenVDBReader *reader,
82 float **data_x, float **data_y, float **data_z,
85 struct OpenVDBWriter *OpenVDBWriter_create(void);
86 void OpenVDBWriter_free(struct OpenVDBWriter *writer);
87 void OpenVDBWriter_set_flags(struct OpenVDBWriter *writer, const int flag, const bool half);
88 void OpenVDBWriter_add_meta_fl(struct OpenVDBWriter *writer, const char *name, const float value);
89 void OpenVDBWriter_add_meta_int(struct OpenVDBWriter *writer, const char *name, const int value);
90 void OpenVDBWriter_add_meta_v3(struct OpenVDBWriter *writer, const char *name, const float value[3]);
91 void OpenVDBWriter_add_meta_v3_int(struct OpenVDBWriter *writer, const char *name, const int value[3]);
92 void OpenVDBWriter_add_meta_mat4(struct OpenVDBWriter *writer, const char *name, float value[4][4]);
93 void OpenVDBWriter_write(struct OpenVDBWriter *writer, const char *filename);
95 struct OpenVDBReader *OpenVDBReader_create(void);
96 void OpenVDBReader_free(struct OpenVDBReader *reader);
97 void OpenVDBReader_open(struct OpenVDBReader *reader, const char *filename);
98 void OpenVDBReader_get_meta_fl(struct OpenVDBReader *reader, const char *name, float *value);
99 void OpenVDBReader_get_meta_int(struct OpenVDBReader *reader, const char *name, int *value);
100 void OpenVDBReader_get_meta_v3(struct OpenVDBReader *reader, const char *name, float value[3]);
101 void OpenVDBReader_get_meta_v3_int(struct OpenVDBReader *reader, const char *name, int value[3]);
102 void OpenVDBReader_get_meta_mat4(struct OpenVDBReader *reader, const char *name, float value[4][4]);
108 #endif /* __OPENVDB_CAPI_H__ */