Skip to content

Commit 20788a0

Browse files
authored
Merge pull request #1 from steadfastnz/master
implemented IntoRawBytes for Rgb666
2 parents 733ac89 + 2812c16 commit 20788a0

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/raw_framebuf.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ impl IntoRawBytes for embedded_graphics::pixelcolor::Rgb565 {
8686
}
8787
}
8888

89+
impl IntoRawBytes for embedded_graphics::pixelcolor::Rgb666 {
90+
const BYTES_PER_PIXEL: usize = 3;
91+
type Raw = [u8; 3];
92+
93+
//scale up by 8bits/ 6bits = 256/64 = 4
94+
fn into_raw_bytes(self) -> <Self as IntoRawBytes>::Raw {
95+
[self.r()* 4, self.g() *4, self.b()*4]
96+
}
97+
}
98+
99+
89100
impl IntoRawBytes for embedded_graphics::pixelcolor::Rgb888 {
90101
const BYTES_PER_PIXEL: usize = 3;
91102
type Raw = [u8; 3];

0 commit comments

Comments
 (0)