(kind: Kind, image_data_len: usize)
| 523 | |
| 524 | impl 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 |
nothing calls this directly
no outgoing calls
no test coverage detected