- fn init(&mut self, in_fmt: &ScaleInfo, dest_fmt: &ScaleInfo) -> ScaleResult<NABufferType> {
- self.ncomps = in_fmt.fmt.components as usize;
+ fn init(&mut self, in_fmt: &ScaleInfo, dest_fmt: &ScaleInfo, options: &[(String, String)]) -> ScaleResult<NABufferType> {
+ let mut debug = false;
+ for (name, value) in options.iter() {
+ match (name.as_str(), value.as_str()) {
+ ("debug", "") => { debug = true; },
+ ("debug", "true") => { debug = true; },
+ _ => {},
+ }
+ }
+
+ self.ncomps = in_fmt.fmt.components.min(dest_fmt.fmt.components) as usize;