-
Notifications
You must be signed in to change notification settings - Fork 60
Line encoding packets
kjy00302 edited this page May 29, 2023
·
4 revisions
Niimbot uses three types of packet to print image.
All three packet type has repeat count. So, repetition of same data can be reduced to one packet.
Currently niimprint's encoder only uses line packet without optimization.
(Common packet fields are omitted for clarity.)
Blank packet (packet type 0x84) encodes blank line.
|5555|84|03|0000|0a|8d|aaaa|
│ └ Repeat count
└───── Line count
This packet will print 10 blank lines.
line packet (packet type 0x85) encodes line as bitmap.
|5555|85|12|000a|00|01|0f|02|0000000000000001fffe0000|91|aaaa
│ │ │ │ │ └ Bitmap data
│ │ │ │ └─── Repeat count
│ │ │ └────── Pixel count (right) (bit count of 0x00000000)
│ │ └───────── Pixel count (middle) (bit count of 0x00000001)
│ └──────────── Pixel count (left) (bit count of 0xfffe0000)
└───────────────── Line count
This packet will print 2 bitmap lines.
points packet (packet type 0x83) encodes line as array of 1D points.
5555|83|0e|000c|00|01|03|07|003f0040004d004e|f8|aaaa|
│ │ │ │ │ └ Point data (0x003f, 0x0040, 0x004d, 0x004e)
│ │ │ │ └─── Repeat count
│ │ │ └────── Pixel count (right)
│ │ └───────── Pixel count (middle)
│ └──────────── Pixel count (left)
└───────────────── Line count
This packet will print 7 lines with points.
How does B21 encodes more then 96 pixels?