summaryrefslogtreecommitdiff
path: root/test/plottest.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/plottest.c')
-rw-r--r--test/plottest.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/test/plottest.c b/test/plottest.c
index 992fdd9..f2008fa 100644
--- a/test/plottest.c
+++ b/test/plottest.c
@@ -14,6 +14,56 @@ extern const struct {
unsigned char pixel_data[132 * 135 * 4 + 1];
} nsglobe;
+const struct {
+ unsigned int w;
+ unsigned int h;
+ unsigned char data[16];
+} Mglyph1 = {
+ 8, 16, {
+ 0x00, /* 00000000 */
+ 0x00, /* 00000000 */
+ 0xc6, /* 11000110 */
+ 0xee, /* 11101110 */
+ 0xfe, /* 11111110 */
+ 0xfe, /* 11111110 */
+ 0xd6, /* 11010110 */
+ 0xc6, /* 11000110 */
+ 0xc6, /* 11000110 */
+ 0xc6, /* 11000110 */
+ 0xc6, /* 11000110 */
+ 0xc6, /* 11000110 */
+ 0x00, /* 00000000 */
+ 0x00, /* 00000000 */
+ 0x00, /* 00000000 */
+ 0x00, /* 00000000 */
+ }
+};
+
+const struct {
+ unsigned int w;
+ unsigned int h;
+ unsigned char data[16 * 8];
+} Mglyph8 = {
+ 8, 16, {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000000 */
+ 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, /* 00000000 */
+ 0xaa, 0xff, 0x00, 0x00, 0x00, 0xff, 0xaa, 0x00, /* 11000110 */
+ 0xaa, 0xff, 0xff, 0x00, 0xff, 0xff, 0xaa, 0x00, /* 11101110 */
+ 0xaa, 0xff, 0xff, 0xff, 0xff, 0xff, 0xaa, 0x00, /* 11111110 */
+ 0xaa, 0xff, 0xff, 0xff, 0xff, 0xff, 0xaa, 0x00, /* 11111110 */
+ 0xaa, 0xff, 0x00, 0x00, 0x00, 0xff, 0xaa, 0x00, /* 11010110 */
+ 0xaa, 0xff, 0x00, 0x00, 0x00, 0xff, 0xaa, 0x00, /* 11000110 */
+ 0xaa, 0xff, 0x00, 0x00, 0x00, 0xff, 0xaa, 0x00, /* 11000110 */
+ 0xaa, 0xff, 0x00, 0x00, 0x00, 0xff, 0xaa, 0x00, /* 11000110 */
+ 0xaa, 0xff, 0x00, 0x00, 0x00, 0xff, 0xaa, 0x00, /* 11000110 */
+ 0xaa, 0xff, 0x00, 0x00, 0x00, 0xff, 0xaa, 0x00, /* 11000110 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000000 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000000 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000000 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000000 */
+ }
+};
+
int main(int argc, char **argv)
{
nsfb_t *nsfb;
@@ -147,6 +197,26 @@ int main(int argc, char **argv)
nsfb_plot_bitmap(nsfb, &box3, (nsfb_colour_t *)nsglobe.pixel_data, nsglobe.width, nsglobe.height, nsglobe.width, true);
+ /* test glyph plotting */
+ for (loop = 100; loop < 200; loop+= Mglyph1.w) {
+ box3.x0 = loop;
+ box3.y0 = 20;
+ box3.x1 = box3.x0 + Mglyph8.w;
+ box3.y1 = box3.y0 + Mglyph8.h;
+
+ nsfb_plot_glyph1(nsfb, &box3, Mglyph1.data, Mglyph1.w, 0xff000000);
+ }
+
+ /* test glyph plotting */
+ for (loop = 100; loop < 200; loop+= Mglyph8.w) {
+ box3.x0 = loop;
+ box3.y0 = 50;
+ box3.x1 = box3.x0 + Mglyph8.w;
+ box3.y1 = box3.y0 + Mglyph8.h;
+
+ nsfb_plot_glyph8(nsfb, &box3, Mglyph8.data, Mglyph8.w, 0xff000000);
+ }
+
nsfb_release(nsfb, &box);
/* random rectangles in clipped area*/