Writes image data to Stream Deck device's lcd strip/screen as region. Only Stream Deck Plus supports writing LCD regions, for Stream Deck Neo use write_lcd_fill
(&self, x: u16, y: u16, rect: &ImageRect)
| 318 | /// Writes image data to Stream Deck device's lcd strip/screen as region. |
| 319 | /// Only Stream Deck Plus supports writing LCD regions, for Stream Deck Neo use write_lcd_fill |
| 320 | pub fn write_lcd(&self, x: u16, y: u16, rect: &ImageRect) -> Result<(), StreamDeckError> { |
| 321 | match self.kind { |
| 322 | Kind::Plus | Kind::PlusXl => (), |
| 323 | _ => return Err(StreamDeckError::UnsupportedOperation), |
| 324 | } |
| 325 | |
| 326 | self.write_image_data_reports( |
| 327 | rect.data.as_slice(), |
| 328 | WriteImageParameters { |
| 329 | image_report_length: 1024, |
| 330 | image_report_payload_length: 1024 - 16, |
| 331 | }, |
| 332 | |page_number, this_length, last_package| { |
| 333 | vec![ |
| 334 | 0x02, |
| 335 | 0x0c, |
| 336 | (x & 0xff) as u8, |
| 337 | (x >> 8) as u8, |
| 338 | (y & 0xff) as u8, |
| 339 | (y >> 8) as u8, |
| 340 | (rect.w & 0xff) as u8, |
| 341 | (rect.w >> 8) as u8, |
| 342 | (rect.h & 0xff) as u8, |
| 343 | (rect.h >> 8) as u8, |
| 344 | if last_package { 1 } else { 0 }, |
| 345 | (page_number & 0xff) as u8, |
| 346 | (page_number >> 8) as u8, |
| 347 | (this_length & 0xff) as u8, |
| 348 | (this_length >> 8) as u8, |
| 349 | 0, |
| 350 | ] |
| 351 | }, |
| 352 | ) |
| 353 | } |
| 354 | |
| 355 | /// Writes image data to Stream Deck device's lcd strip/screen as full fill |
| 356 | /// |
no test coverage detected