From db8cbc0c12570d79f05123d9b519085128fe5814 Mon Sep 17 00:00:00 2001 From: Radzivon Bartoshyk Date: Tue, 5 Nov 2024 21:10:37 +0000 Subject: [PATCH] Improvements --- src/y_to_rgb.rs | 10 +++++----- src/y_with_alpha_to_rgb.rs | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/y_to_rgb.rs b/src/y_to_rgb.rs index 7d23950..10e60bb 100644 --- a/src/y_to_rgb.rs +++ b/src/y_to_rgb.rs @@ -49,7 +49,7 @@ use rayon::prelude::{ParallelSlice, ParallelSliceMut}; // Chroma subsampling always assumed as 400 fn y_to_rgbx( - gray_image: YuvGrayImage, + gray_image: &YuvGrayImage, rgba: &mut [u8], rgba_stride: u32, range: YuvRange, @@ -192,7 +192,7 @@ fn y_to_rgbx( /// on the specified width, height, and strides, or if invalid YUV range or matrix is provided. /// pub fn yuv400_to_rgb( - gray_image: YuvGrayImage, + gray_image: &YuvGrayImage, rgb: &mut [u8], rgb_stride: u32, range: YuvRange, @@ -219,7 +219,7 @@ pub fn yuv400_to_rgb( /// on the specified width, height, and strides, or if invalid YUV range or matrix is provided. /// pub fn yuv400_to_bgr( - gray_image: YuvGrayImage, + gray_image: &YuvGrayImage, bgr: &mut [u8], bgr_stride: u32, range: YuvRange, @@ -246,7 +246,7 @@ pub fn yuv400_to_bgr( /// on the specified width, height, and strides, or if invalid YUV range or matrix is provided. /// pub fn yuv400_to_rgba( - gray_image: YuvGrayImage, + gray_image: &YuvGrayImage, rgba: &mut [u8], rgba_stride: u32, range: YuvRange, @@ -273,7 +273,7 @@ pub fn yuv400_to_rgba( /// on the specified width, height, and strides, or if invalid YUV range or matrix is provided. /// pub fn yuv400_to_bgra( - gray_image: YuvGrayImage, + gray_image: &YuvGrayImage, bgra: &mut [u8], bgra_stride: u32, range: YuvRange, diff --git a/src/y_with_alpha_to_rgb.rs b/src/y_with_alpha_to_rgb.rs index 39c111a..e91ed95 100644 --- a/src/y_with_alpha_to_rgb.rs +++ b/src/y_with_alpha_to_rgb.rs @@ -44,7 +44,7 @@ fn y_with_alpha_to_rgbx< const DESTINATION_CHANNELS: u8, const BIT_DEPTH: usize, >( - gray_alpha_image: YuvGrayAlphaImage, + gray_alpha_image: &YuvGrayAlphaImage, rgba: &mut [V], rgba_stride: u32, range: YuvRange, @@ -159,7 +159,7 @@ where /// on the specified width, height, and strides, or if invalid YUV range or matrix is provided. /// pub fn yuv400_with_alpha_to_rgba( - gray_alpha_image: YuvGrayAlphaImage, + gray_alpha_image: &YuvGrayAlphaImage, rgba: &mut [u8], rgba_stride: u32, range: YuvRange, @@ -193,7 +193,7 @@ pub fn yuv400_with_alpha_to_rgba( /// on the specified width, height, and strides, or if invalid YUV range or matrix is provided. /// pub fn yuv400_with_alpha_to_bgra( - gray_alpha_image: YuvGrayAlphaImage, + gray_alpha_image: &YuvGrayAlphaImage, bgra: &mut [u8], bgra_stride: u32, range: YuvRange,