qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

quantum_painter_rle.md (872B)


      1 # QMK QGF/QFF RLE data schema {#qmk-qp-rle-schema}
      2 
      3 There are two "modes" to the RLE algorithm used in both [QGF](quantum_painter_qgf)/[QFF](quantum_painter_qff):
      4 
      5 * Non-repeating sections of octets, with associated length of up to `128` octets
      6     * `length` = `marker - 128`
      7     * A corresponding `length` number of octets follow directly after the marker octet
      8 * Repeated octet with associated length, with associated length of up to `128`
      9     * `length` = `marker`
     10     * A single octet follows the marker that should be repeated `length` times.
     11 
     12 Decoder pseudocode:
     13 ```
     14 while !EOF
     15     marker = READ_OCTET()
     16 
     17     if marker >= 128
     18         length = marker - 128
     19         for i = 0 ... length-1
     20             c = READ_OCTET()
     21             WRITE_OCTET(c)
     22 
     23     else
     24         length = marker
     25         c = READ_OCTET()
     26         for i = 0 ... length-1
     27             WRITE_OCTET(c)
     28 
     29 ```