Boost logo

Boost :

From: Lubomir Bourdev (lbourdev_at_[hidden])
Date: 2007-09-03 14:33:57


Andreas Pokorny wrote:
>I try to write a generic floyd steinberg implementation using
boost.gil.
...

Andreas,

The bug is not in the implementation but in the name of the function.
It really should be called "convert_from_unsigned" instead of
"convert_to_signed" because it takes the _destination_ type as its
parameter.

I will also move it in gil::detail because its behavior is much attuned
to what GIL needs there (it operates on integral channels only and
assumes the two channels are of the same bit size). It really shouldn't
be used as a general purpose metafunction.

In your case you should write your own metafunctions.
Metafunctions like is_integral_scalar, is_signed, add_sign and
remove_sign should be added to Boost.TypeTraits in my opinion.

Lubomir


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk