From 56de602a6dbe942c95071be2fc845b5d4bf6aeb5 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 10 Apr 2009 05:23:51 +0000 Subject: Use dmnsn_set_pixel in png test. --- tests/png.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/png.c b/tests/png.c index 070617a..f34fc3a 100644 --- a/tests/png.c +++ b/tests/png.c @@ -27,6 +27,7 @@ int main() { dmnsn_canvas *canvas; dmnsn_sRGB sRGB; + dmnsn_color color; FILE *ofile, *ifile; unsigned int x, y; @@ -48,29 +49,29 @@ int main() { sRGB.R = 1.0; sRGB.G = 0.0; sRGB.B = 0.0; - canvas->pixels[y*canvas->x + x] = dmnsn_color_from_sRGB(sRGB); } else if (x < 2*canvas->x/3) { sRGB.R = 0.0; sRGB.G = 1.0; sRGB.B = 0.0; - canvas->pixels[y*canvas->x + x] = dmnsn_color_from_sRGB(sRGB); } else { sRGB.R = 0.0; sRGB.G = 0.0; sRGB.B = 1.0; - canvas->pixels[y*canvas->x + x] = dmnsn_color_from_sRGB(sRGB); } + color = dmnsn_color_from_sRGB(sRGB); if (y < canvas->y/3) { - canvas->pixels[y*canvas->x + x].filter = 0.0; - canvas->pixels[y*canvas->x + x].trans = 0.0; + color.filter = 0.0; + color.trans = 0.0; } else if (y < 2*canvas->y/3) { - canvas->pixels[y*canvas->x + x].filter = 1.0/3.0; - canvas->pixels[y*canvas->x + x].trans = 0.0; + color.filter = 1.0/3.0; + color.trans = 0.0; } else { - canvas->pixels[y*canvas->x + x].filter = 1.0/3.0; - canvas->pixels[y*canvas->x + x].trans = 1.0/3.0; + color.filter = 1.0/3.0; + color.trans = 1.0/3.0; } + + dmnsn_set_pixel(canvas, color, x, y); } } -- cgit v1.2.3