diff --git a/crates/processing_core/src/constants.rs b/crates/processing_core/src/constants.rs index 0cd5866a..382f00fd 100644 --- a/crates/processing_core/src/constants.rs +++ b/crates/processing_core/src/constants.rs @@ -1,6 +1,7 @@ pub const CORNER: &str = "corner"; pub const CORNERS: &str = "corners"; pub const RADIUS: &str = "radius"; +pub const DIAMETER: &str = CENTER; // ellipse_mode alias for CENTER pub const CENTER: &str = "center"; // also the middle mouse button pub const ROUND: &str = "round"; // caps and joins @@ -46,8 +47,10 @@ pub const MIRROR: &str = "mirror"; pub const SRGB: &str = "srgb"; pub const LINEAR: &str = "linear"; // also the Sampler filter +pub const RGB: &str = SRGB; // color_mode alias pub const HSL: &str = "hsl"; pub const HSV: &str = "hsv"; +pub const HSB: &str = HSV; // color_mode alias pub const HWB: &str = "hwb"; pub const OKLAB: &str = "oklab"; pub const OKLCH: &str = "oklch"; @@ -144,10 +147,17 @@ pub const PI: f32 = std::f32::consts::PI; pub const TWO_PI: f32 = std::f32::consts::TAU; pub const HALF_PI: f32 = std::f32::consts::FRAC_PI_2; pub const QUARTER_PI: f32 = std::f32::consts::FRAC_PI_4; +pub const THIRD_PI: f32 = std::f32::consts::FRAC_PI_3; pub const TAU: f32 = std::f32::consts::TAU; pub const DEG_TO_RAD: f32 = std::f32::consts::PI / 180.0; pub const RAD_TO_DEG: f32 = 180.0 / std::f32::consts::PI; +pub const EPSILON: f32 = 0.0001; +pub const MAX_FLOAT: f32 = f32::MAX; +pub const MIN_FLOAT: f32 = -f32::MAX; +pub const MAX_INT: i32 = i32::MAX; +pub const MIN_INT: i32 = i32::MIN; + // Key codes are GLFW values, mapped to Bevy `KeyCode`s by `processing_input::keys`. pub const KEY_A: u32 = 65; @@ -202,7 +212,9 @@ pub const BRACKET_RIGHT: u32 = 93; pub const BACKQUOTE: u32 = 96; pub const ESCAPE: u32 = 256; +pub const ESC: u32 = ESCAPE; pub const ENTER: u32 = 257; +pub const RETURN: u32 = ENTER; pub const TAB: u32 = 258; pub const BACKSPACE: u32 = 259; pub const INSERT: u32 = 260; diff --git a/crates/processing_pyo3/src/constants.rs b/crates/processing_pyo3/src/constants.rs index a29bbff6..d79e97ec 100644 --- a/crates/processing_pyo3/src/constants.rs +++ b/crates/processing_pyo3/src/constants.rs @@ -25,7 +25,7 @@ pub fn register(m: &Bound<'_, PyModule>) -> PyResult<()> { QUAD_STRIP, LINE_STRIP ); - add!(m, CORNER, CORNERS, CENTER, RADIUS); + add!(m, CORNER, CORNERS, CENTER, RADIUS, DIAMETER); add!(m, OPEN, CHORD, PIE, CLOSE); m.add("INVERT", crate::filter::INVERT_U8)?; @@ -43,8 +43,9 @@ pub fn register(m: &Bound<'_, PyModule>) -> PyResult<()> { add!(m, NORMAL, ITALIC, BOLD, BOLD_ITALIC); add!(m, WORD, CHAR); add!(m, NEAREST, CLAMP, REPEAT, MIRROR); - add!(m, SRGB, LINEAR, HSL, HSV, HWB, OKLAB, OKLCH, LAB, LCH, XYZ); - add!(m, RGB, HSB); + add!( + m, SRGB, RGB, LINEAR, HSL, HSV, HSB, HWB, OKLAB, OKLCH, LAB, LCH, XYZ + ); add!(m, ARROW, CROSS, HAND, MOVE, TEXT, WAIT); add!( m, @@ -58,8 +59,9 @@ pub fn register(m: &Bound<'_, PyModule>) -> PyResult<()> { SOMEWHAT_BORING_DISPLAY_TRANSFORM ); add!( - m, PI, TWO_PI, HALF_PI, QUARTER_PI, TAU, DEG_TO_RAD, RAD_TO_DEG + m, PI, TWO_PI, HALF_PI, QUARTER_PI, THIRD_PI, TAU, DEG_TO_RAD, RAD_TO_DEG ); + add!(m, EPSILON, MAX_FLOAT, MIN_FLOAT, MAX_INT, MIN_INT); add!( m, MAP, COMBINE, MIX, LOOKUP, REDUCE, EXTRACT, PACK, GENERATE @@ -123,7 +125,9 @@ pub fn register(m: &Bound<'_, PyModule>) -> PyResult<()> { add!( m, ESCAPE, + ESC, ENTER, + RETURN, TAB, BACKSPACE, INSERT,