thermal
thermal copied to clipboard
Implement Page Mode
I don't have permission to push on feat/page_mode but I found some problems in the ESC W regarding some operations, causing "attempt to subtract with overflow".
changed it to
let adjusted_width =
if context.graphics.x as u16 >= horizontal_logical_origin {
context.graphics.x as u16 - horizontal_logical_origin
} else {
0
};
let adjusted_height =
if context.graphics.y as u16 >= vertical_logical_origin {
context.graphics.y as u16 - vertical_logical_origin
} else {
0
};
Currently, the provided code is just printing some unformatted metadata.
The branch is completely untested. I haven't figured out how to give you access to a repo yet. In the meantime you can maybe pull it down and create pull requests on it.
I was able to see the other images, except by the barcode, changing the col_encoded to true.
pub fn new() -> Command {
Command::new(
"Bit Image Column Format",
vec![ESC, '*' as u8],
CommandType::Graphics,
DataType::Custom,
Box::new(Handler {
width: 0,
height: 0,
capacity: 0,
col_encoded: true,
size: 0,
accept_data: false,
stretch: (1, 1),
}),
)
}
result:
Cool!!!
It looks pretty good so far. If you take the direction and feed it to the thermal image, I think you will have it. You would need to create a property in there called direction that will insert pixels from the x and y in the right direction. (I can also take a stab if you make a pull request to the page mode branch).
Page mode is hard. I will get to it when I get a chunk of time where I can finish it.
Page mode is done
That's great newsssss! Thanks a lot for that! It will be really, really useful.
That's great newsssss! Thanks a lot for that! It will be really, really useful.
Let me know if you have any issues or want to add any test files to the repo. Ideally test files are in the .thermal format.