import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.B9AX-CPi.js"; const __pageData = JSON.parse('{"title":"QMK QGF/QFF RLE data schema","description":"","frontmatter":{},"headers":[],"relativePath":"quantum_painter_rle.md","filePath":"quantum_painter_rle.md"}'); const _sfc_main = { name: "quantum_painter_rle.md" }; const _hoisted_1 = /* @__PURE__ */ createStaticVNode('
There are two "modes" to the RLE algorithm used in both QGF/QFF:
128
octets length
= marker - 128
length
number of octets follow directly after the marker octet128
length
= marker
length
times.Decoder pseudocode:
while !EOF\n marker = READ_OCTET()\n\n if marker >= 128\n length = marker - 128\n for i = 0 ... length-1\n c = READ_OCTET()\n WRITE_OCTET(c)\n\n else\n length = marker\n c = READ_OCTET()\n for i = 0 ... length-1\n WRITE_OCTET(c)