pub struct Config { /* private fields */ }Expand description
The encoder configuration: connectivity method, per-attribute encoding
options, geometry type, and metadata toggle. Built with the with_*
builder methods, or deserialized from TOML.
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_normals(self, enc: NormalEncoding) -> Self
pub fn with_normals(self, enc: NormalEncoding) -> Self
Sets how normal attributes are compressed.
NormalEncoding::PredictedOnly makes normal compression effectively
zero-CPU: the encoder ignores the input normal values (using only their
seam topology) and emits an all-zero correction stream, so the decoder
reconstructs exactly the normals it predicts from the geometry.
use draco_oxide::encode::{Config, NormalEncoding};
let cfg = Config::default().with_normals(NormalEncoding::PredictedOnly);Sourcepub fn with_attribute(self, ty: AttributeType, cfg: AttributeConfig) -> Self
pub fn with_attribute(self, ty: AttributeType, cfg: AttributeConfig) -> Self
Overrides the per-type encoding for ty (prediction scheme, transform,
quantization, and the normal encoding mode for normals). Absent knobs
fall back to the built-in default for that attribute type.
Sourcepub fn with_connectivity(self, cfg: ConnectivityConfig) -> Self
pub fn with_connectivity(self, cfg: ConnectivityConfig) -> Self
Selects the connectivity compression method and its configuration.
Sourcepub fn with_edgebreaker(self, cfg: EdgebreakerConfig) -> Self
pub fn with_edgebreaker(self, cfg: EdgebreakerConfig) -> Self
Selects edgebreaker connectivity compression with the given config.
Sourcepub fn with_sequential(self, cfg: SequentialConfig) -> Self
pub fn with_sequential(self, cfg: SequentialConfig) -> Self
Selects sequential connectivity compression with the given config.
Sourcepub fn with_metadata(self, metadata: bool) -> Self
pub fn with_metadata(self, metadata: bool) -> Self
Enables or disables metadata encoding.
Sourcepub fn attribute_config(&self, ty: AttributeType) -> AttributeConfig
pub fn attribute_config(&self, ty: AttributeType) -> AttributeConfig
The current per-type attribute override for ty (empty default if none),
for read-modify-write layering of overrides (e.g. a CLI flag patching a
single knob on top of a file-loaded config).
Sourcepub fn connectivity(&self) -> &ConnectivityConfig
pub fn connectivity(&self) -> &ConnectivityConfig
The selected connectivity configuration.
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
Validates the configuration for internal consistency, rejecting combinations that would produce an undecodable or nonsensical stream (a texture predictor on a normal attribute, a coordinate max-error on an octahedral normal, an unimplemented traversal, out-of-range bits, …). Called automatically by every encode entry point.