pconvert_rust/blending/params.rs
1//! Blend algorithms and PConvert API optional parameter types (`BlendAlgorithmParams` and `Options`, respectively).
2//! Low level layer for the composition system.
3
4use std::collections::HashMap;
5
6/// Map of blending algorithm properties and corresponding values.
7pub type BlendAlgorithmParams = HashMap<String, Value>;
8
9/// Map of API options and corresponding values.
10#[cfg(not(target_arch = "wasm32"))]
11pub type Options = HashMap<String, Value>;
12
13/// Abstract data type that can assume multiple primitive types.
14/// The data structure is going to be used in the passing of parameters
15/// between heterogenous type systems (eg: different VMs).
16#[derive(Clone, Debug)]
17pub enum Value {
18 Bool(bool),
19 Long(i64),
20 Float(f64),
21 Str(String),
22 UInt(usize),
23
24 #[cfg(not(feature = "wasm-extension"))]
25 Int(i32),
26
27 #[cfg(feature = "wasm-extension")]
28 Invalid,
29}