Memoize hashing (#1876)

* Implement memoization wrapper for hashing

* Fix pattern matching errors

* Revert proper point modification hash calculiton

* Remove unused hashing code

* Code review and bug fixes

* Improve pattern matching

* Fix tests

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Dennis Kobert
2024-08-01 13:42:15 +02:00
committed by GitHub
parent 44ffb635e9
commit a6af5d4831
19 changed files with 224 additions and 466 deletions

View File

@@ -830,9 +830,9 @@ impl Color {
/// ```
/// use graphene_core::raster::color::Color;
/// let color1 = Color::from_rgba8_srgb(0x52, 0x67, 0xFA, 0x61).to_gamma_srgb();
/// assert_eq!("3240a261", color1.rgb_optional_a_hex())
/// let color2 = Color::from_rgba8_srgb(0x52, 0x67, 0xFA, 0x61).to_gamma_srgb();
/// assert_eq!("3240a2", color2.rgb_optional_a_hex())
/// assert_eq!("3240a261", color1.rgb_optional_a_hex());
/// let color2 = Color::from_rgba8_srgb(0x52, 0x67, 0xFA, 0xFF).to_gamma_srgb();
/// assert_eq!("5267fa", color2.rgb_optional_a_hex());
/// ```
#[cfg(feature = "std")]
pub fn rgb_optional_a_hex(&self) -> String {