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

Method for_key

src/lib.rs:525–545  ·  view source on GitHub ↗
(kind: Kind, image_data_len: usize)

Source from the content-addressed store, hash-verified

523
524impl WriteImageParameters {
525 pub fn for_key(kind: Kind, image_data_len: usize) -> Self {
526 let image_report_length = match kind {
527 Kind::Original => 8191,
528 _ => 1024,
529 };
530
531 let image_report_header_length = match kind {
532 Kind::Original | Kind::Mini | Kind::MiniMk2 | Kind::MiniDiscord | Kind::MiniMk2Module => 16,
533 _ => 8,
534 };
535
536 let image_report_payload_length = match kind {
537 Kind::Original => image_data_len / 2,
538 _ => image_report_length - image_report_header_length,
539 };
540
541 Self {
542 image_report_length,
543 image_report_payload_length,
544 }
545 }
546}
547
548/// Errors that can occur while working with Stream Decks

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected