rasterRowsBase64 function
Die Rasterzeilen eines Logos als Base64 (1 Bit je Punkt, links das höchste
Bit, Zeilen auf ganze Bytes aufgefüllt), Zwilling von rasterRowsBase64.
Implementation
String rasterRowsBase64(PrintLogo logo) {
final r = logo.raster;
final jeZeile = (r.width + 7) >> 3;
final bytes = Uint8List(jeZeile * r.height);
for (var y = 0; y < r.height; y++) {
for (var x = 0; x < r.width; x++) {
if (r.dots[y * r.width + x] != 1) continue;
bytes[y * jeZeile + (x >> 3)] |= 0x80 >> (x & 7);
}
}
return base64Encode(bytes);
}