|
Boost : |
From: Simon Buchan (simon_at_[hidden])
Date: 2005-09-26 01:21:18
Adam Badura wrote:
> As I rewrite some parts of code for color library I noticed silent
> assumption I made. Namely I assumed that all color components are the same
> type. But must it be this way?
> Does anyone use types like:
>
> struct rgb {
> float r;
> unsigned char b;
> signed char g;
> };
<snip>
> So? Allow diffrent types or not?
Although it wouldn't be terribly useful for RGB, other representations
may (will?) benifit from this, as a simple example, L*a*b* is
represented as an /unsigned/ Lightness, and two /signed/ components, a
and b. Someone may wish to represent (or is forced to represent) HSV
values with floating Hue, but integral Saturation and Value. Perhaps a
specialised graphics application would wish to use (custom?) fixed point
types and floating point types in the same value (If consistancy of
calculations for Saturation and Value are needed, but accuracy is more
important for Hue, for example)
In short, I say yea!
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk