Blender  V2.93
opensubdiv_evaluator_capi.h
Go to the documentation of this file.
1 // Copyright 2013 Blender Foundation. All rights reserved.
2 //
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software Foundation,
15 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 //
17 // Author: Sergey Sharybin
18 
19 #ifndef OPENSUBDIV_EVALUATOR_CAPI_H_
20 #define OPENSUBDIV_EVALUATOR_CAPI_H_
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 struct OpenSubdiv_EvaluatorInternal;
29 
30 typedef struct OpenSubdiv_Evaluator {
31  // Set coarse positions from a continuous array of coordinates.
32  void (*setCoarsePositions)(struct OpenSubdiv_Evaluator *evaluator,
33  const float *positions,
34  const int start_vertex_index,
35  const int num_vertices);
36  // Set varying data from a continuous array of data.
37  void (*setVaryingData)(struct OpenSubdiv_Evaluator *evaluator,
38  const float *varying_data,
39  const int start_vertex_index,
40  const int num_vertices);
41  // Set face varying data from a continuous array of data.
42  //
43  // TODO(sergey): Find a better name for vertex here. It is not the vertex of
44  // geometry, but a vertex of UV map.
45  void (*setFaceVaryingData)(struct OpenSubdiv_Evaluator *evaluator,
46  const int face_varying_channel,
47  const float *face_varying_data,
48  const int start_vertex_index,
49  const int num_vertices);
50 
51  // Set coarse vertex position from a continuous memory buffer where
52  // first coordinate starts at offset of `start_offset` and there is `stride`
53  // bytes between adjacent vertex coordinates.
55  const void *buffer,
56  const int start_offset,
57  const int stride,
58  const int start_vertex_index,
59  const int num_vertices);
60  // Set varying data from a continuous memory buffer where
61  // first coordinate starts at offset of `start_offset` and there is `stride`
62  // bytes between adjacent vertex coordinates.
64  const void *buffer,
65  const int start_offset,
66  const int stride,
67  const int start_vertex_index,
68  const int num_vertices);
69  // Set face varying data from a continuous memory buffer where
70  // first coordinate starts at offset of `start_offset` and there is `stride`
71  // bytes between adjacent vertex coordinates.
72  //
73  // TODO(sergey): Find a better name for vertex here. It is not the vertex of
74  // geometry, but a vertex of UV map.
76  const int face_varying_channel,
77  const void *buffer,
78  const int start_offset,
79  const int stride,
80  const int start_vertex_index,
81  const int num_vertices);
82 
83  // Refine after coarse positions update.
84  void (*refine)(struct OpenSubdiv_Evaluator *evaluator);
85 
86  // Evaluate given ptex face at given bilinear coordinate.
87  // If derivatives are NULL, they will not be evaluated.
88  void (*evaluateLimit)(struct OpenSubdiv_Evaluator *evaluator,
89  const int ptex_face_index,
90  float face_u,
91  float face_v,
92  float P[3],
93  float dPdu[3],
94  float dPdv[3]);
95 
96  // Evaluate varying data at a given bilinear coordinate of given ptex face.
97  void (*evaluateVarying)(struct OpenSubdiv_Evaluator *evaluator,
98  const int ptex_face_index,
99  float face_u,
100  float face_v,
101  float varying[3]);
102 
103  // Evaluate face-varying data at a given bilinear coordinate of given
104  // ptex face.
105  void (*evaluateFaceVarying)(struct OpenSubdiv_Evaluator *evaluator,
106  const int face_varying_channel,
107  const int ptex_face_index,
108  float face_u,
109  float face_v,
110  float face_varying[2]);
111 
112  // Batched evaluation of multiple input coordinates.
113 
114  // Evaluate limit surface.
115  // If derivatives are NULL, they will not be evaluated.
116  //
117  // NOTE: Output arrays must point to a memory of size float[3]*num_patch_coords.
118  void (*evaluatePatchesLimit)(struct OpenSubdiv_Evaluator *evaluator,
119  const struct OpenSubdiv_PatchCoord *patch_coords,
120  const int num_patch_coords,
121  float *P,
122  float *dPdu,
123  float *dPdv);
124 
125  // Implementation of the evaluator.
128 
130  struct OpenSubdiv_TopologyRefiner *topology_refiner);
131 
133 
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 #endif // OPENSUBDIV_EVALUATOR_CAPI_H_
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei stride
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
static float P(float k)
Definition: math_interp.c:41
struct OpenSubdiv_Evaluator OpenSubdiv_Evaluator
OpenSubdiv_Evaluator * openSubdiv_createEvaluatorFromTopologyRefiner(struct OpenSubdiv_TopologyRefiner *topology_refiner)
void openSubdiv_deleteEvaluator(OpenSubdiv_Evaluator *evaluator)
void(* setVaryingDataFromBuffer)(struct OpenSubdiv_Evaluator *evaluator, const void *buffer, const int start_offset, const int stride, const int start_vertex_index, const int num_vertices)
void(* setVaryingData)(struct OpenSubdiv_Evaluator *evaluator, const float *varying_data, const int start_vertex_index, const int num_vertices)
void(* setCoarsePositionsFromBuffer)(struct OpenSubdiv_Evaluator *evaluator, const void *buffer, const int start_offset, const int stride, const int start_vertex_index, const int num_vertices)
void(* setCoarsePositions)(struct OpenSubdiv_Evaluator *evaluator, const float *positions, const int start_vertex_index, const int num_vertices)
void(* evaluateLimit)(struct OpenSubdiv_Evaluator *evaluator, const int ptex_face_index, float face_u, float face_v, float P[3], float dPdu[3], float dPdv[3])
void(* setFaceVaryingDataFromBuffer)(struct OpenSubdiv_Evaluator *evaluator, const int face_varying_channel, const void *buffer, const int start_offset, const int stride, const int start_vertex_index, const int num_vertices)
void(* setFaceVaryingData)(struct OpenSubdiv_Evaluator *evaluator, const int face_varying_channel, const float *face_varying_data, const int start_vertex_index, const int num_vertices)
struct OpenSubdiv_EvaluatorImpl * impl
void(* evaluateFaceVarying)(struct OpenSubdiv_Evaluator *evaluator, const int face_varying_channel, const int ptex_face_index, float face_u, float face_v, float face_varying[2])
void(* evaluateVarying)(struct OpenSubdiv_Evaluator *evaluator, const int ptex_face_index, float face_u, float face_v, float varying[3])
void(* evaluatePatchesLimit)(struct OpenSubdiv_Evaluator *evaluator, const struct OpenSubdiv_PatchCoord *patch_coords, const int num_patch_coords, float *P, float *dPdu, float *dPdv)
void(* refine)(struct OpenSubdiv_Evaluator *evaluator)