diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-07-05 19:18:24 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-07-05 19:18:24 +0000 |
commit | f0caa7d190e51af9ba4a487dc371b56174d56f31 (patch) | |
tree | df7126c72187056d36478c43e878137303b3d156 /libdimension/dimension | |
parent | 32216655e1d8e523cf3e1239000442b2a30da193 (diff) | |
download | dimension-f0caa7d190e51af9ba4a487dc371b56174d56f31.tar.xz |
Make optimizer registration fail if a canvas has already been written
to.
Diffstat (limited to 'libdimension/dimension')
-rw-r--r-- | libdimension/dimension/canvas.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libdimension/dimension/canvas.h b/libdimension/dimension/canvas.h index a14333d..aaf728b 100644 --- a/libdimension/dimension/canvas.h +++ b/libdimension/dimension/canvas.h @@ -29,14 +29,15 @@ typedef struct { /* width, height */ unsigned int x, y; + /* An array of dmnsn_canvas_optimizer's */ + dmnsn_array *optimizers; + int too_late; /* Is it too late to add optimizers? */ + /* * Stored in first-quadrant representation (origin is bottom-left). The pixel * at (a,b) is accessible as pixels[b*x + a]. */ dmnsn_color *pixels; - - /* An array of dmnsn_canvas_optimizer's */ - dmnsn_array *optimizers; } dmnsn_canvas; typedef struct dmnsn_canvas_optimizer dmnsn_canvas_optimizer; @@ -59,8 +60,8 @@ dmnsn_canvas *dmnsn_new_canvas(unsigned int x, unsigned int y); void dmnsn_delete_canvas(dmnsn_canvas *canvas); /* Set a canvas optimizer */ -void dmnsn_optimize_canvas(dmnsn_canvas *canvas, - dmnsn_canvas_optimizer optimizer); +int dmnsn_optimize_canvas(dmnsn_canvas *canvas, + dmnsn_canvas_optimizer optimizer); /* Pixel accessors */ |