summaryrefslogtreecommitdiffstats
path: root/libdimension/rgba16.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension/rgba16.c')
-rw-r--r--libdimension/rgba16.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/libdimension/rgba16.c b/libdimension/rgba16.c
index 980a2d3..2c7a8d5 100644
--- a/libdimension/rgba16.c
+++ b/libdimension/rgba16.c
@@ -50,14 +50,13 @@ dmnsn_rgba16_optimizer_fn(const dmnsn_canvas *canvas,
dmnsn_canvas_optimizer optimizer, size_t x, size_t y)
{
uint16_t *pixel = (uint16_t *)optimizer.ptr + 4*(y*canvas->width + x);
- dmnsn_color color;
- color = dmnsn_canvas_get_pixel(canvas, x, y);
- color = dmnsn_remove_filter(color);
- color = dmnsn_color_to_sRGB(color);
- color = dmnsn_color_saturate(color);
+ dmnsn_tcolor tcolor = dmnsn_canvas_get_pixel(canvas, x, y);
+ tcolor = dmnsn_tcolor_remove_filter(tcolor);
+ tcolor.c = dmnsn_color_to_sRGB(tcolor.c);
+ tcolor = dmnsn_tcolor_saturate(tcolor);
- pixel[0] = lround(color.R*UINT16_MAX);
- pixel[1] = lround(color.G*UINT16_MAX);
- pixel[2] = lround(color.B*UINT16_MAX);
- pixel[3] = lround(color.trans*UINT16_MAX);
+ pixel[0] = lround(tcolor.c.R*UINT16_MAX);
+ pixel[1] = lround(tcolor.c.G*UINT16_MAX);
+ pixel[2] = lround(tcolor.c.B*UINT16_MAX);
+ pixel[3] = lround(tcolor.T*UINT16_MAX);
}