feat: Added stuff
Some checks failed
build / checks-build (push) Has been cancelled
build / checks-matrix (push) Has been cancelled
build / codecov (push) Has been cancelled
docs / docs (push) Has been cancelled

This commit is contained in:
uttarayan21
2025-08-18 22:10:29 +05:30
parent 7fc958b299
commit 783320131a
12 changed files with 73 additions and 464 deletions

View File

@@ -59,7 +59,9 @@ mod rgba8 {
mod gray8 {
use super::Result;
pub(super) fn image_as_ndarray(image: &image::GrayImage) -> Result<ndarray::ArrayView2<u8>> {
pub(super) fn image_as_ndarray(
image: &image::GrayImage,
) -> Result<ndarray::ArrayView2<'_, u8>> {
let (width, height) = image.dimensions();
let data = image.as_raw();
ndarray::ArrayView2::from_shape((height as usize, width as usize), data)
@@ -112,7 +114,7 @@ mod gray_alpha8 {
mod dynamic_image {
use super::*;
pub fn image_as_ndarray(image: &image::DynamicImage) -> Result<ndarray::ArrayViewD<u8>> {
pub fn image_as_ndarray(image: &image::DynamicImage) -> Result<ndarray::ArrayViewD<'_, u8>> {
Ok(match image {
image::DynamicImage::ImageRgb8(img) => rgb8::image_as_ndarray(img)?.into_dyn(),
image::DynamicImage::ImageRgba8(img) => rgba8::image_as_ndarray(img)?.into_dyn(),