MCPcopy Create free account
hub / github.com/OpenActionAPI/rust-elgato-streamdeck / write_lcd_fill

Method write_lcd_fill

src/lib.rs:363–419  ·  view source on GitHub ↗

Writes image data to Stream Deck device's lcd strip/screen as full fill You can convert your images into proper image_data like this: ``` use elgato_streamdeck::images::convert_image_with_format; let image_data = convert_image_with_format(device.kind().lcd_image_format(), image).unwrap(); device.write_lcd_fill(&image_data); ```

(&self, image_data: &[u8])

Source from the content-addressed store, hash-verified

361 /// device.write_lcd_fill(&image_data);
362 /// ```
363 pub fn write_lcd_fill(&self, image_data: &[u8]) -> Result<(), StreamDeckError> {
364 match self.kind {
365 Kind::Neo => self.write_image_data_reports(
366 image_data,
367 WriteImageParameters {
368 image_report_length: 1024,
369 image_report_payload_length: 1024 - 8,
370 },
371 |page_number, this_length, last_package| {
372 vec![
373 0x02,
374 0x0b,
375 0,
376 if last_package { 1 } else { 0 },
377 (this_length & 0xff) as u8,
378 (this_length >> 8) as u8,
379 (page_number & 0xff) as u8,
380 (page_number >> 8) as u8,
381 ]
382 },
383 ),
384
385 Kind::Plus | Kind::PlusXl => {
386 let (w, h) = self.kind.lcd_strip_size().unwrap();
387
388 self.write_image_data_reports(
389 image_data,
390 WriteImageParameters {
391 image_report_length: 1024,
392 image_report_payload_length: 1024 - 16,
393 },
394 |page_number, this_length, last_package| {
395 vec![
396 0x02,
397 0x0c,
398 0,
399 0,
400 0,
401 0,
402 (w & 0xff) as u8,
403 (w >> 8) as u8,
404 (h & 0xff) as u8,
405 (h >> 8) as u8,
406 if last_package { 1 } else { 0 },
407 (page_number & 0xff) as u8,
408 (page_number >> 8) as u8,
409 (this_length & 0xff) as u8,
410 (this_length >> 8) as u8,
411 0,
412 ]
413 },
414 )
415 }
416
417 _ => Err(StreamDeckError::UnsupportedOperation),
418 }
419 }
420

Callers 2

mainFunction · 0.45
mainFunction · 0.45

Calls 2

lcd_strip_sizeMethod · 0.80

Tested by

no test coverage detected