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; }