Boost logo

Boost :

Subject: Re: [boost] [GIL] default_color_converter from float to integer should clamp
From: Olaf van der Spek (ml_at_[hidden])
Date: 2012-10-15 04:15:27


On Sun, Oct 14, 2012 at 1:33 PM, Fabien Castan <fabcastan_at_[hidden]> wrote:
> + const bits32f clampedValue = std::min(
> + (bits32f)channel_traits<DstChannelV>::max_value(),
> + std::max(
> (bits32f)channel_traits<DstChannelV>::min_value(), convertedValue ) );
> +
> + return DstChannelV( static_cast< dst_integer_t >(clampedValue) );
> }
> };

Is a clamp function not available?
boost::algorithm has one

-- 
Olaf

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