]> git.wh0rd.org - ICEs.git/blobdiff - bfin-5624/qfontengine.i.3
more ices
[ICEs.git] / bfin-5624 / qfontengine.i.3
diff --git a/bfin-5624/qfontengine.i.3 b/bfin-5624/qfontengine.i.3
new file mode 100644 (file)
index 0000000..0a2095b
--- /dev/null
@@ -0,0 +1,15 @@
+void qt_addBitmapToPath(const unsigned char * image_data, int bpl, int w, int h)
+{
+       unsigned int *grid = new unsigned int[(w + 1) * (h + 1)];
+       for (int y = 0; y <= h; ++y) {
+               for (int x = 0; x <= w; ++x) {
+                       bool topLeft = (x == 0) | (y == 0) ? false :
+                               *(image_data + (y - 1) * bpl + ((x - 1) >> 3)) & (0x80 >> ((x - 1) & 7));
+                       bool bottomLeft = (x == 0) | (y == h) ? false :
+                               *(image_data + (y - 0) * bpl + ((x - 1) >> 3)) & (0x80 >> ((x - 1) & 7));
+
+                       if (!bottomLeft & topLeft)
+                               grid[y * (w + 1) + x] |= 4;
+               }
+       }
+}