Skip to main content

Module attribute

Module attribute 

Source
Expand description

Typed attribute / parameter names — compile-time witnesses for ɴsɪ NSIParam_t identifiers.

On the C side, ɴsɪ uses a single NSIParam_t struct everywhere. On the Rust side that single C concept splits into two semantic roles, both of which boil down to the same underlying type:

  • Attribute<T> — properties set on a node (govern how the scene looks): P, Pw, fov, transformationmatrix, uknot, …
  • Parameter<T> — optional arguments to a function (govern how the call behaves): streamformat, errorhandler, stoppedcallback, …

Parameter<T> is just a type alias for Attribute<T> — the conceptual split exists so the constants and docs read more naturally, but the machinery is identical.

End-users normally don’t write these types out — they just reference the exported consts through the parameter macros:

nsi::point_slice!(POSITION, &points)  // node attribute (was: P)
nsi::string!(STREAM_FORMAT, "nsi")    // function parameter to NSIBegin

Renderer- or app-specific entries are added in downstream crates without touching this one — Attribute::new is const:

pub const MY_RENDERER_THING: Attribute<f32> = Attribute::new("custom_thing");

Structs§

Attribute
Typed name of an ɴsɪ attribute.

Constants§

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.
FIELD_OF_VIEW
field-of-view (currently fov) — perspective camera FOV in degrees.
FILENAME
filename (currently shaderfilename) — OSL shader filename.
MATRIX
matrix (currently transformationmatrix) — 4×4 row-major matrix (f64).
OVERSAMPLING
oversampling — pixel oversampling rate.
POSITION
position (currently P) — Cartesian control points / vertices.
RESOLUTION
resolution — pixel resolution of a screen node, [width, height].
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.
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).
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.

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.
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.