@@ -38,9 +38,18 @@ OPENVDB_API void uninitialize();
3838
3939// //////////////////////////////////////
4040
41+ // / @brief Controls which operations a codec exposes.
42+ // /
43+ // / Passed to codec registration to restrict how the codec may be used at
44+ // / runtime. A @c ReadOnly codec can still be used to read existing files but
45+ // / will not be selected as the write codec for new grids.
4146enum class CodecMode {
42- ReadWrite, // Both read and write enabled (default)
43- ReadOnly // Only read methods enabled
47+ // / Both @c readTopology()/@c readBuffers() and
48+ // / @c writeTopology()/@c writeBuffers() are enabled. This is the default.
49+ ReadWrite,
50+ // / Only @c readTopology() and @c readBuffers() are enabled; the codec
51+ // / will not be offered as a write target.
52+ ReadOnly
4453};
4554
4655// / @brief Controls how grid data is read.
@@ -54,9 +63,20 @@ enum class ReadMode {
5463 // / behaviour and produces a fully populated grid identical to the one
5564 // / that was written.
5665 Original,
57- Half, // Read data as half precision
58- Bool, // Read data as boolean
59- Mask, // Read data as mask
66+ // / Deserialize topology and value buffers, converting each voxel value
67+ // / to half-precision floating point on the fly. Codecs that do not
68+ // / support native half conversion should fall back to @c Original and
69+ // / record a @c ReadDiagnostic warning.
70+ Half,
71+ // / Deserialize topology and value buffers, converting each voxel value
72+ // / to @c bool (non-zero to @c true, zero to @c false). Produces a
73+ // / @c BoolGrid whose active set matches the source grid's active set.
74+ Bool,
75+ // / Deserialize topology only and promote the result to a mask grid,
76+ // / discarding all value data. Equivalent to reading @c TopologyOnly and
77+ // / then constructing a @c MaskGrid from the active-voxel set, but may
78+ // / be performed more efficiently inside the codec.
79+ Mask,
6080 // / Deserialize topology only; value buffers are skipped. The resulting
6181 // / grid has a valid tree structure (active/inactive state, node
6282 // / hierarchy) but leaf buffer data is left at its default (background)
@@ -117,8 +137,11 @@ struct OPENVDB_API ReadTypedOptions
117137// / bounding box. An empty bbox (the default) means no clipping is applied.
118138// /
119139// / @par Read mode
120- // / @c readMode controls the granularity of deserialization. The default,
121- // / @c ReadMode::Original, loads both topology and value buffers.
140+ // / @c readMode controls the granularity and on-the-fly conversion applied
141+ // / during deserialization. The default, @c ReadMode::Original, loads both
142+ // / topology and value buffers without modification.
143+ // / @c ReadMode::Half, @c ReadMode::Bool, and @c ReadMode::Mask request
144+ // / in-place type conversion as data is read.
122145// / @c ReadMode::TopologyOnly skips value buffers entirely, which can be
123146// / significantly faster when only the active-voxel mask is needed.
124147// /
0 commit comments