aboutsummaryrefslogtreecommitdiff
path: root/src/render.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2021-10-07 22:31:13 +0200
committerDaniel Schadt <kingdread@gmx.de>2021-10-07 22:31:13 +0200
commitcd110bcc5db993ae329d85674590f9a453014f8c (patch)
tree499d289cac6b4baca80748a460a2ff8c37e769f5 /src/render.rs
parent048e05b9d46bb33b45f8a31b9ec079aae7dd1cf1 (diff)
downloadkondou-cd110bcc5db993ae329d85674590f9a453014f8c.tar.gz
kondou-cd110bcc5db993ae329d85674590f9a453014f8c.tar.bz2
kondou-cd110bcc5db993ae329d85674590f9a453014f8c.zip
Remove deprecated functions
Diffstat (limited to 'src/render.rs')
-rw-r--r--src/render.rs15
1 files changed, 12 insertions, 3 deletions
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<T: PartialOrd>(value: T , lower: T, upper: T) -> T {
+ if value < lower {
+ lower
+ } else if value > upper {
+ upper
+ } else {
+ value
+ }
+}
+
fn brighten_gradient<I, P, S>(
image: &I,
start_x: u32,
@@ -425,7 +435,6 @@ where
P: Pixel<Subpixel = S> + 'static,
S: Primitive + 'static,
{
- use image::math::utils::clamp;
let (width, height) = image.dimensions();
let mut out = ImageBuffer::new(width, height);