diff --git a/core/embed/rust/src/ui/display/toif.rs b/core/embed/rust/src/ui/display/toif.rs index b39dd94eed..1f2bcff8d6 100644 --- a/core/embed/rust/src/ui/display/toif.rs +++ b/core/embed/rust/src/ui/display/toif.rs @@ -271,6 +271,14 @@ impl<'i> Toif<'i> { Offset::new(self.width(), self.height()) } + pub fn stride(&self) -> usize { + if self.is_grayscale() { + (self.width() + 1) as usize / 2 + } else { + self.width() as usize * 2 + } + } + pub fn zdata(&self) -> &'i [u8] { &self.data[TOIF_HEADER_LENGTH..] }