~ruther/qmk_firmware

ref: 0fb3aaec8e80a0277e50af74d9abb8680c979ed9 qmk_firmware/docs/quantum_painter_rle.md -rw-r--r-- 879 bytes
0fb3aaec — 猫咪恐慌 [Doc]: Correct Markdown syntax errors. (#22511) 1 year, 5 months ago

#QMK QGF/QFF RLE data schema :id=qmk-qp-rle-schema

There are two "modes" to the RLE algorithm used in both QGF/QFF:

  • Non-repeating sections of octets, with associated length of up to 128 octets
    • length = marker - 128
    • A corresponding length number of octets follow directly after the marker octet
  • Repeated octet with associated length, with associated length of up to 128
    • length = marker
    • A single octet follows the marker that should be repeated length times.

Decoder pseudocode:

while !EOF
    marker = READ_OCTET()

    if marker >= 128
        length = marker - 128
        for i = 0 ... length-1
            c = READ_OCTET()
            WRITE_OCTET(c)

    else
        length = marker
        c = READ_OCTET()
        for i = 0 ... length-1
            WRITE_OCTET(c)

Do not follow this link