Fixed doc-strings and dependencies.

This commit is contained in:
Kirill Kuzminykh
2024-05-13 22:49:13 +03:00
parent a138db35c5
commit 14cca8b8db
4 changed files with 9 additions and 6 deletions
+5 -4
View File
@@ -23,16 +23,17 @@ exclude = ["/data"]
cfg-if = "1.0"
num-traits = "0.2.19"
thiserror = "1.0"
bytemuck = "1.15"
document-features = "0.2.8"
image = { version = "0.25.1", optional = true }
bytemuck = { version = "1.16", optional = true }
[features]
## Enable this feature to implement traits [IntoImageView](crate::IntoImageView) and
## [IntoImageViewMut](crate::IntoImageViewMut) for the
## [DynamicImage](https://docs.rs/image/latest/image/enum.DynamicImage.html)
## type from the `image` crate.
image = { version = "0.25.1", optional = true }
[features]
image = ["dep:image", "dep:bytemuck"]
for_test = ["image"]
only_u8x4 = [] # This can be used to experiment with the crate's code.
+2
View File
@@ -44,6 +44,8 @@ pub mod testing;
#[cfg(target_arch = "wasm32")]
mod wasm32_utils;
/// A trait implemented by all pixel types from the crate.
///
/// This trait must be used in your code instead of [InnerPixel](pixels::InnerPixel).
#[allow(private_bounds)]
pub trait PixelTrait: Convolution + AlphaMulDiv {}
+1 -1
View File
@@ -5,7 +5,7 @@ edition = "2021"
[dependencies]
fast_image_resize = { path = ".." }
fast_image_resize = { path = "..", features = ["image"] }
image = "0.25.1"
+1 -1
View File
@@ -11,7 +11,7 @@ pub fn nonzero(v: u32) -> NonZeroU32 {
NonZeroU32::new(v).unwrap()
}
pub fn image_checksum<P: InnerPixel, const N: usize>(image: &Image) -> [u64; N] {
pub fn image_checksum<P: PixelTrait, const N: usize>(image: &Image) -> [u64; N] {
let buffer = image.buffer();
let mut res = [0u64; N];
let component_size = P::size() / P::count_of_components();