diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-04-10 05:23:51 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-04-10 05:23:51 +0000 |
commit | 56de602a6dbe942c95071be2fc845b5d4bf6aeb5 (patch) | |
tree | 9f1905fbaa043eac3ce5395bf5171ae3e0fea3a6 /tests | |
parent | 6d9e4e83989b1e7d5b69c30018246554112581c2 (diff) | |
download | dimension-56de602a6dbe942c95071be2fc845b5d4bf6aeb5.tar.xz |
Use dmnsn_set_pixel in png test.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/png.c | 19 |
1 files 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); } } |