summaryrefslogtreecommitdiffstats
path: root/libdimension/png.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-10-19 13:59:24 -0400
committerTavian Barnes <tavianator@gmail.com>2011-10-30 18:11:22 -0400
commit8e3a7158ecae541692826e7b5998c8ffc810173a (patch)
treebeda4f9f8604f77d0513d5fb02b7ddf53d203d09 /libdimension/png.c
parente9810a7b1aae15320e58371b657a2f963562834d (diff)
downloaddimension-8e3a7158ecae541692826e7b5998c8ffc810173a.tar.xz
Make API more consistent.
Object methods should be dmnsn_<object>_<fn>().
Diffstat (limited to 'libdimension/png.c')
-rw-r--r--libdimension/png.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libdimension/png.c b/libdimension/png.c
index d633abb..8fc2c1f 100644
--- a/libdimension/png.c
+++ b/libdimension/png.c
@@ -52,7 +52,7 @@ dmnsn_png_optimize_canvas(dmnsn_canvas *canvas)
optimizer.ptr = dmnsn_malloc(4*canvas->width*canvas->height*sizeof(uint16_t));
- dmnsn_optimize_canvas(canvas, optimizer);
+ dmnsn_canvas_optimize(canvas, optimizer);
return 0;
}
@@ -64,7 +64,7 @@ dmnsn_png_optimizer_fn(const dmnsn_canvas *canvas,
dmnsn_color color;
uint16_t *pixel = (uint16_t *)optimizer.ptr + 4*(y*canvas->width + x);
- color = dmnsn_get_pixel(canvas, x, y);
+ color = dmnsn_canvas_get_pixel(canvas, x, y);
color = dmnsn_remove_filter(color);
color = dmnsn_color_to_sRGB(color);
color = dmnsn_color_saturate(color);
@@ -238,7 +238,8 @@ dmnsn_png_write_canvas_thread(void *ptr)
for (size_t y = 0; y < height; ++y) {
for (size_t x = 0; x < width; ++x) {
/* Invert the rows. PNG coordinates are fourth quadrant. */
- dmnsn_color color = dmnsn_get_pixel(payload->canvas, x, height - y - 1);
+ dmnsn_color color = dmnsn_canvas_get_pixel(payload->canvas,
+ x, height - y - 1);
color = dmnsn_remove_filter(color);
color = dmnsn_color_to_sRGB(color);
color = dmnsn_color_saturate(color);
@@ -420,7 +421,7 @@ dmnsn_png_read_canvas_thread(void *ptr)
}
color = dmnsn_color_from_sRGB(color);
- dmnsn_set_pixel(*payload->canvas, x, height - y - 1, color);
+ dmnsn_canvas_set_pixel(*payload->canvas, x, height - y - 1, color);
}
dmnsn_future_increment(payload->future);