Boost Users :
Subject: [Boost-users] [GIL] Why doesn't pixel assignment color-convert?
From: Stonewall Ballard (sb.list_at_[hidden])
Date: 2016-02-16 11:42:06
I've just started using boost.gil, though I've been looking at it for a
It seems odd to me that assignment doesn't do an implicit
color_convert() when the pixels are of different types. Instead, it just
copies matching channels.
That's the wrong thing to do when assigning an rgba pixel to an rgb
pixel, since the former is straight and the latter is premultiplied.
It also seems wrong that you can assign an rgba pixel to an rgb pixel,
but not vice-versa. It looks like this is caused by
pixels_are_compatible in gil_concept.hpp, where it fails to check that
both pixels have the same number of channels. Instead, it matches
channels of the output pixel against the input pixel, ignoring any extra
input pixel channels. It also ignores scoped_channel_value usage.
This seems like an error waiting to happen.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net