From cd110bcc5db993ae329d85674590f9a453014f8c Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Thu, 7 Oct 2021 22:31:13 +0200 Subject: Remove deprecated functions --- src/render.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/render.rs b/src/render.rs index fa8e1df..af5d2b2 100644 --- a/src/render.rs +++ b/src/render.rs @@ -210,7 +210,7 @@ impl<'r> Renderer<'r> { let major_img = if !chosen { with_mask(&major_img.grayscale(), &major_img) } else { - major_img.to_rgba() + major_img.to_rgba8() }; let major_img = with_mask(&major_img, &self.major_mask); let (x, y) = self.grid.pos(vertical_pos as u32, 2 * (major.tier - 1) + 1); @@ -278,7 +278,7 @@ impl<'r> Renderer<'r> { self.options.traitline_height, imageops::FilterType::CatmullRom, ) - .to_rgba(); + .to_rgba8(); if self.options.traitline_use_gradient { buffer = brighten_gradient( @@ -414,6 +414,16 @@ where }) } +fn clamp(value: T , lower: T, upper: T) -> T { + if value < lower { + lower + } else if value > upper { + upper + } else { + value + } +} + fn brighten_gradient( image: &I, start_x: u32, @@ -425,7 +435,6 @@ where P: Pixel + 'static, S: Primitive + 'static, { - use image::math::utils::clamp; let (width, height) = image.dimensions(); let mut out = ImageBuffer::new(width, height); -- cgit v1.2.3