mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-08 22:40:59 +00:00
feat(core): introduce new toif functions
[no changelog]
This commit is contained in:
parent
254de49a62
commit
474484d249
@ -271,6 +271,14 @@ impl<'i> Toif<'i> {
|
|||||||
Offset::new(self.width(), self.height())
|
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] {
|
pub fn zdata(&self) -> &'i [u8] {
|
||||||
&self.data[TOIF_HEADER_LENGTH..]
|
&self.data[TOIF_HEADER_LENGTH..]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user