You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
879 B

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