summaryrefslogtreecommitdiffstats
path: root/libdimension/png.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2014-06-19 16:58:14 -0400
committerTavian Barnes <tavianator@tavianator.com>2014-06-19 16:58:40 -0400
commite39f2e09698556e7895b084b7addb88d3e7ea58d (patch)
treea5f9f989203d0750328a220ffb4ea9f24f82fae1 /libdimension/png.c
parent4a28a6ac23f92f5d1ce13e369b27be22815aec6c (diff)
downloaddimension-e39f2e09698556e7895b084b7addb88d3e7ea58d.tar.xz
canvas: Kill optimizers' ->ptr field.
Diffstat (limited to 'libdimension/png.c')
-rw-r--r--libdimension/png.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libdimension/png.c b/libdimension/png.c
index 24f8afa..faca080 100644
--- a/libdimension/png.c
+++ b/libdimension/png.c
@@ -31,9 +31,9 @@
#include <stdint.h>
int
-dmnsn_png_optimize_canvas(dmnsn_canvas *canvas)
+dmnsn_png_optimize_canvas(dmnsn_pool *pool, dmnsn_canvas *canvas)
{
- dmnsn_rgba16_optimize_canvas(canvas);
+ dmnsn_rgba16_optimize_canvas(pool, canvas);
return 0;
}
@@ -171,12 +171,11 @@ dmnsn_png_write_canvas_thread(void *ptr)
}
// Check if we can optimize this
- dmnsn_canvas_optimizer *optimizer =
- dmnsn_canvas_find_optimizer(payload->canvas, dmnsn_rgba16_optimizer_fn);
- if (optimizer) {
+ dmnsn_rgba16_optimizer *rgba16 = (dmnsn_rgba16_optimizer *)dmnsn_canvas_find_optimizer(payload->canvas, dmnsn_rgba16_optimizer_fn);
+ if (rgba16) {
for (size_t y = 0; y < height; ++y) {
// Invert the rows. PNG coordinates are fourth quadrant.
- uint16_t *row_opt = (uint16_t *)optimizer->ptr + 4*(height - y - 1)*width;
+ uint16_t *row_opt = rgba16->data + 4*(height - y - 1)*width;
png_write_row(png_ptr, (png_bytep)row_opt);
dmnsn_future_increment(payload->future);
}