pub struct EncoderOptions { /* private fields */ }encoder only.Expand description
Integer option bag used to configure Draco encoding.
Options mirror the C++ Draco encoder style: global options apply to the whole geometry, while attribute options override a value for one attribute id and fall back to the global value when unset.
Common keys include quantization_bits (per-attribute precision),
encoding_speed/decoding_speed, encoding_method, and
prediction_scheme. Keys without an explicit setter are read and written
with get_global_int /
set_global_int.
§Examples
use draco_core::EncoderOptions;
let mut options = EncoderOptions::new();
options.set_global_int("quantization_bits", 14); // default for all attributes
options.set_attribute_int(0, "quantization_bits", 10); // override attribute 0
assert_eq!(options.get_attribute_int(0, "quantization_bits", 0), 10);
// Attribute 1 has no override, so it falls back to the global value.
assert_eq!(options.get_attribute_int(1, "quantization_bits", 0), 14);Implementations§
Source§impl EncoderOptions
impl EncoderOptions
Sourcepub fn get_encoding_speed(&self) -> i32
pub fn get_encoding_speed(&self) -> i32
Returns the configured encoding speed, defaulting to 5.
Sourcepub fn get_decoding_speed(&self) -> i32
pub fn get_decoding_speed(&self) -> i32
Returns the configured decoding speed target, defaulting to 5.
Sourcepub fn get_speed(&self) -> i32
pub fn get_speed(&self) -> i32
Returns the maximum speed for both encoding/decoding. Matches C++ ExpertEncoder::GetSpeed() behavior.
Sourcepub fn get_prediction_scheme(&self) -> i32
pub fn get_prediction_scheme(&self) -> i32
Returns the forced prediction scheme, or -1 for the encoder default.
Sourcepub fn set_prediction_scheme(&mut self, value: i32)
pub fn set_prediction_scheme(&mut self, value: i32)
Forces a prediction scheme by numeric Draco method id.
Sourcepub fn get_encoding_method(&self) -> Option<i32>
pub fn get_encoding_method(&self) -> Option<i32>
Returns the forced encoding method, if one was set.
Sourcepub fn set_encoding_method(&mut self, value: i32)
pub fn set_encoding_method(&mut self, value: i32)
Forces an encoding method by numeric Draco method id.
Sourcepub fn set_version(&mut self, major: u8, minor: u8)
pub fn set_version(&mut self, major: u8, minor: u8)
Sets the target Draco bitstream version.
Sourcepub fn get_version(&self) -> (u8, u8)
pub fn get_version(&self) -> (u8, u8)
Returns the target Draco bitstream version, or (0, 0) for default.
Sourcepub fn set_global_int(&mut self, key: &str, value: i32)
pub fn set_global_int(&mut self, key: &str, value: i32)
Sets a global integer option.
Sourcepub fn get_global_int(&self, key: &str, default_val: i32) -> i32
pub fn get_global_int(&self, key: &str, default_val: i32) -> i32
Returns a global integer option or the supplied default.
Sourcepub fn set_attribute_int(&mut self, att_id: i32, key: &str, value: i32)
pub fn set_attribute_int(&mut self, att_id: i32, key: &str, value: i32)
Sets an integer option for one attribute id.
Trait Implementations§
Source§impl Clone for EncoderOptions
impl Clone for EncoderOptions
Source§fn clone(&self) -> EncoderOptions
fn clone(&self) -> EncoderOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more