1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use crate::macros::wrap;
use servicepoint::{
BinaryOperation, BitVecCommand, CompressionCode, DisplayBitVec, Offset,
};
use std::ptr::NonNull;
wrap!(
BitVecCommand {
derives: crate::commands::derive_command[BitVec];
properties:
prop bitvec: DisplayBitVec { get mut; set move; };
prop offset: Offset { get; set; };
prop operation: BinaryOperation { get; set; };
prop compression: CompressionCode { get; set; };
functions:
/// Set pixel data starting at the pixel offset on screen.
///
/// The screen will continuously overwrite more pixel data without regarding the offset, meaning
/// once the starting row is full, overwriting will continue on column 0.
///
/// The [`BinaryOperation`] will be applied on the display comparing old and sent bit.
///
/// `new_bit = old_bit op sent_bit`
///
/// For example, [`BinaryOperation::Or`] can be used to turn on some pixels without affecting other pixels.
///
/// The contained [`DisplayBitVec`] is always uncompressed.
fn new(
bitvec: move NonNull<DisplayBitVec>,
offset: val usize,
operation: val BinaryOperation,
compression: val CompressionCode,
) -> move NonNull<BitVecCommand> {
BitVecCommand {
bitvec,
offset,
operation,
compression,
}
};
}
);