Skip to main content

Crate nsi_ffi_wrap

Crate nsi_ffi_wrap 

Source

Re-exports§

pub use c_adapter::FfiApiAdapter;
pub use node::*;
pub use argument::*;
pub use context::*;
pub use output::*;output

Modules§

argument
Optional arguments passed to methods of an ɴsɪ context.
attribute
Typed attribute / parameter names — compile-time witnesses for ɴsɪ NSIParam_t identifiers.
c_adapter
C API adapter for Nsi trait implementations.
c_api
C API function generation for [Nsi] trait implementations.
context
An ɴsɪ context.
macros
Macros for defining NSI renderer implementations.
node
Standard ɴsɪ node types — re-exported from nsi-trait.
outputoutput
Output driver callbacks.

Macros§

callback
Create a Callback argument.
color
Create a Color argument.
color_slice
Create a ColorSlice array argument.
define_nsi_c_api
Macro for defining the complete C API for an [Nsi] implementation.
define_nsi_renderer
Generates a complete NSI renderer implementation.
f32
Create a F32 argument.
f64
Create a F64 precision argument.
f32_slice
Create a F32Slice array argument.
f64_slice
Create a F64Slice precision array argument.
i32
Create a I32 argument.
i64
Create a I64 argument.
i32_slice
Create a I32Slice array argument.
i64_slice
Create a I64Slice array argument.
matrix_f32
Create a MatrixF32 row-major, 4×4 transformation matrix argument. The matrix is given as 16 [f32] values.
matrix_f64
Create a MatrixF64 row-major, 4×4 transformation matrix argument. The matrix is given as 16 [f64] values.
matrix_f32_slice
Create a MatrixF32Slice row-major, 4×4 transformation matrices argument. Each matrix is given as 16 [f32] values.
matrix_f64_slice
Create a MatrixF64Slice row-major, 4×4 transformation matrices argument. Each matrix is given as 16 [f64] values.
normal
Create a Normal argument.
normal_slice
Create a NormalSlice array argument.
point
Create a Point argument.
point4_f32_slice
Create a slice-of-4-component-f32-points argument.
point_slice
Create a PointSlice array argument.
reference
Create a Reference argument.
reference_slice
Create a Reference array argument.
reference_stable
Create a Reference argument from data with a stable address.
string
Create a String argument.
string_slice
Create a String array argument.
vector
Create a Vector argument.
vector_slice
Create a VectorSlice array argument.

Structs§

Attribute
Typed name of an ɴsɪ attribute.
FfiParam
C-compatible parameter struct, layout-identical to NSIParam_t.
Flags
Parameter flags matching the C API constants.
Handleustr_handles
A node handle string backed by an interned Ustr.
Tokencstring_tokens
A token string backed by an owned CString.

Enums§

Action
Actions for render control.
NodeType
Node types in the ɴsɪ scene graph.
Type
NSI data type discriminant, binary-compatible with NSIType_t from nsi.h.

Constants§

ALL
Wildcard node that references all existing nodes at once (.all).
ATTRIBUTES
Container for generic attributes (e.g. visibility). Documentation.
BUCKET_ORDER
bucket-order (currently bucketorder) — bucket traversal pattern ("horizontal", "spiral", …).
CALLBACK_ERROR
callback.error (currently errorhandler) — error-handler callback registered through NSIBegin.
CALLBACK_STOP
callback.stop (currently stoppedcallback) — callback fired when an interactive render stops.
CURVES
Linear, b-spline and Catmull-Rom curves. Documentation.
CYLINDRICAL_CAMERA
A cylindrical camera. Documentation.
ENVIRONMENT
Geometry type to define environment lighting. Documentation.
FACE_SET
Assign attributes to part of a mesh, curves or particles. Documentation.
FIELD_OF_VIEW
field-of-view (currently fov) — perspective camera FOV in degrees.
FILENAME
filename (currently shaderfilename) — OSL shader filename.
FISHEYE_CAMERA
A fisheye camera. Documentation.
GLOBAL
Global settings node (.global). Documentation.
INSTANCES
Specifies instances of other nodes. Documentation.
MATRIX
matrix (currently transformationmatrix) — 4×4 row-major matrix (f64).
MESH
Polygonal mesh or subdivision surface. Documentation.
NURBS
NURBS surface with optional trim curves.
ORTHOGRAPHIC_CAMERA
An orthographic camera. Documentation.
OUTPUT_DRIVER
A target where to output rendered pixels. Documentation.
OUTPUT_LAYER
Describes one render layer to be connected to an outputdriver node. Documentation.
OVERSAMPLING
oversampling — pixel oversampling rate.
PARTICLES
Collection of particles. Documentation.
PERSPECTIVE_CAMERA
A perspective camera. Documentation.
PLANE
An infinite plane. Documentation.
POSITION
position (currently P) — Cartesian control points / vertices.
PROCEDURAL
Geometry to be loaded or generated in delayed fashion. Documentation.
RESOLUTION
resolution — pixel resolution of a screen node, [width, height].
ROOT
The scene’s root (.root). Documentation.
SCREEN
Describes how the view from a camera node will be rasterized into an outputlayer node. Documentation.
SET
Expresses relationships of groups of nodes. Documentation.
SHADER
OSL shader or layer in a shader group. Documentation.
SPHERICAL_CAMERA
A spherical camera. Documentation.
STREAM_FILENAME
stream.filename (currently streamfilename) — output file path when NSIBegin is invoked in stream-to-file mode.
STREAM_FORMAT
stream.format (currently streamformat) — output stream format for NSIBegin ("nsi", "binarynsi", "autonsi").
STREAM_PATH_REPLACEMENT
stream.path-replacement (currently streampathreplace) — substitution pairs applied to paths in the output stream.
TRANSFORM
Transformation to place objects in the scene. Documentation.
TRIM_CURVES_CURVE_COUNT
trim-curves.curve-count (currently trimcurves.ncurves) — curves per loop.
TRIM_CURVES_CV_COUNT
trim-curves.cv-count (currently trimcurves.n) — control-point count per trim curve.
TRIM_CURVES_KNOT
trim-curves.knot — concatenated knots; total length = Σ(n[i] + order[i]).
TRIM_CURVES_LOOP_COUNT
trim-curves.loop-count (currently trimcurves.nloops) — number of trim loops on a NURBS surface.
TRIM_CURVES_MAX
trim-curves.max — parametric end per trim curve.
TRIM_CURVES_MIN
trim-curves.min — parametric start per trim curve.
TRIM_CURVES_ORDER
trim-curves.order — order per trim curve (degree + 1).
TRIM_CURVES_SENSE
trim-curves.sense — one per loop. 0 = keep inside, 1 = keep outside (hole).
TRIM_CURVES_U
trim-curves.u — concatenated u control values; length = Σn[i].
TRIM_CURVES_V
trim-curves.v — concatenated v control values; length = Σn[i].
TRIM_CURVES_W
trim-curves.w — concatenated weights; length = Σn[i].
U_COUNT
u.count (currently nu) — control-point count along u.
U_KNOT
u.knot (currently uknot) — knot vector along u; length = nu + uorder.
U_ORDER
u.order (currently uorder) — order along u (degree + 1, ≥ 2).
VOLUME
A volume loaded from an OpenVDB file. Documentation.
V_COUNT
v.count (currently nv) — control-point count along v.
V_KNOT
v.knot (currently vknot) — knot vector along v; length = nv + vorder.
V_ORDER
v.order (currently vorder) — order along v (degree + 1, ≥ 2).
WEIGHTED_POSITION
weighted-position (currently Pw) — rational (weighted homogeneous) control points: xyzw.

Traits§

FfiApi
Trait abstracting the NSI C API functions.
Nsi
Core ɴsɪ interface trait.
ParamValue
A single ɴsɪ parameter (name + typed data).

Functions§

register_output_driversoutput
Helper function to register output drivers for an API implementation.

Type Aliases§

Color3F32
RGB color with f32 components.
Color4F32
RGBA color with f32 components.
Matrix3F32
3×3 matrix with f32 components.
Matrix4F32
4×4 matrix with f32 components.
Matrix4F64
4×4 matrix with f64 components.
NameNon-ustr
Plain String when the ustr feature is not enabled.
Normal3F32
3D normal with f32 components.
Parameter
Typed name of an ɴsɪ function-parameter — alias of Attribute<T>.
Point2F32
2D point with f32 components — typically a parametric (u, v) coordinate.
Point3F32
3D point with f32 components — Cartesian position.
Point4F32
4D point with f32 components — rational/weighted homogeneous (xyzw).
Vector2F32
2D vector with f32 components.
Vector3F32
3D vector with f32 components.