fast image operations
-rw-r--r--Cargo.toml2
-rw-r--r--src/dyn/mod.rs2
-rw-r--r--src/lib.rs4
-rw-r--r--src/uninit.rs3
4 files changed, 5 insertions, 6 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 35692a0..4c3e2bc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "fimg"
-version = "0.4.50"
+version = "0.4.51"
authors = ["bend-n <[email protected]>"]
license = "MIT"
edition = "2024"
diff --git a/src/dyn/mod.rs b/src/dyn/mod.rs
index 2688160..f3817d3 100644
--- a/src/dyn/mod.rs
+++ b/src/dyn/mod.rs
@@ -4,7 +4,7 @@ mod convert;
#[cfg(feature = "scale")]
mod scale;
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Hash)]
/// Dynamic image.
/// Can be any of {`Y8`, `YA8`, `RGB8`, `RGB16`}.
pub enum DynImage<T> {
diff --git a/src/lib.rs b/src/lib.rs
index fdc7150..3784f64 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -52,7 +52,6 @@
#![cfg_attr(all(feature = "term", windows), windows_subsystem = "console")]
#![feature(
type_changing_struct_update,
- maybe_uninit_write_slice,
custom_inner_attributes,
slice_swap_unchecked,
generic_const_exprs,
@@ -62,7 +61,6 @@
core_intrinsics,
rustc_private,
portable_simd,
- array_windows,
const_convert,
try_blocks,
doc_cfg,
@@ -214,7 +212,7 @@ impl<T: AsRef<[u8]>> Image<T, 3> {
}
/// A image with a variable number of channels, and a nonzero size.
-#[derive(Debug, PartialEq, Eq)]
+#[derive(Debug, PartialEq, Eq, Hash)]
#[repr(C)]
pub struct Image<T, const CHANNELS: usize> {
/// column order 2d slice/vec
diff --git a/src/uninit.rs b/src/uninit.rs
index 788f0fd..220b137 100644
--- a/src/uninit.rs
+++ b/src/uninit.rs
@@ -1,10 +1,11 @@
//! the houser of uninitialized memory. €$@!0В𴬔!℡
//!
//! contains [`Image`], an uninitialized image.
-use crate::{span::Span, CopyWithinUnchecked};
+use crate::{CopyWithinUnchecked, span::Span};
use std::{hint::assert_unchecked, mem::MaybeUninit, num::NonZeroU32, ops::Index};
/// A uninitialized image. Be sure to initialize it!
+#[derive(Hash)]
pub struct Image<T: Copy, const CHANNELS: usize> {
/// Has capacity w * h * c
buffer: Vec<T>,