From 4947eff4d14593b30bcae6434cc7090be8ecf1a0 Mon Sep 17 00:00:00 2001 From: chyyran Date: Wed, 8 Feb 2023 00:04:46 -0500 Subject: [PATCH] doc(rt): doc scaling --- librashader-runtime/src/scaling.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/librashader-runtime/src/scaling.rs b/librashader-runtime/src/scaling.rs index 6bf79c2..bf35a16 100644 --- a/librashader-runtime/src/scaling.rs +++ b/librashader-runtime/src/scaling.rs @@ -5,6 +5,7 @@ use librashader_presets::{Scale2D, ScaleFactor, ScaleType, Scaling}; use num_traits::AsPrimitive; use std::ops::Mul; +/// Trait for size scaling relative to the viewport. pub trait ViewportSize where T: Mul + Copy + 'static, @@ -28,10 +29,12 @@ where } } +/// Trait for size scaling relating to mipmap generation. pub trait MipmapSize { /// Calculate the number of mipmap levels for a given size. fn calculate_miplevels(self) -> T; + /// Scale the size according to the given mipmap level. fn scale_mipmap(self, miplevel: T) -> Size; }