thermal icon indicating copy to clipboard operation
thermal copied to clipboard

Implement Page Mode

Open zachzurn opened this issue 1 year ago • 4 comments

zachzurn avatar Mar 01 '24 19:03 zachzurn

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.

image

kewynakshlley avatar Mar 05 '24 18:03 kewynakshlley

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.

zachzurn avatar Mar 05 '24 21:03 zachzurn

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:

image

kewynakshlley avatar Mar 11 '24 11:03 kewynakshlley

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).

zachzurn avatar Mar 13 '24 02:03 zachzurn

Page mode is hard. I will get to it when I get a chunk of time where I can finish it.

zachzurn avatar Sep 29 '24 06:09 zachzurn

Page mode is done

zachzurn avatar Oct 13 '24 02:10 zachzurn

That's great newsssss! Thanks a lot for that! It will be really, really useful.

kewynakshlley avatar Oct 15 '24 11:10 kewynakshlley

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.

zachzurn avatar Oct 15 '24 17:10 zachzurn