+ use std::abs

This commit is contained in:
Artem Pavlenko 2012-06-18 14:29:03 -04:00
parent 465842e0e4
commit 0668fe2958

View file

@ -61,8 +61,8 @@ struct default_color_converter_impl< rgb_t, hsv_t >
bits32f hue, saturation, value; bits32f hue, saturation, value;
bits32f min_color = (std::min)( temp_red, (std::min)( temp_green, temp_blue )); bits32f min_color = std::min(temp_red,std::min(temp_green, temp_blue));
bits32f max_color = (std::max)( temp_red, (std::max)( temp_green, temp_blue )); bits32f max_color = std::max(temp_red,std::max(temp_green, temp_blue));
value = max_color; value = max_color;
@ -85,7 +85,7 @@ struct default_color_converter_impl< rgb_t, hsv_t >
} }
else else
{ {
if( (std::abs)( boost::numeric_cast<int>(temp_red - max_color) ) < 0.0001f ) if( std::abs( boost::numeric_cast<int>(temp_red - max_color) ) < 0.0001f )
{ {
hue = ( temp_green - temp_blue ) hue = ( temp_green - temp_blue )
/ diff; / diff;
@ -129,7 +129,7 @@ struct default_color_converter_impl<hsv_t,rgb_t>
bits32f red, green, blue; bits32f red, green, blue;
//If saturation is 0, the color is a shade of gray //If saturation is 0, the color is a shade of gray
if( abs( get_color( src, saturation_t() )) < 0.0001f ) if( std::abs( get_color( src, saturation_t() )) < 0.0001f )
{ {
// If saturation is 0, the color is a shade of gray // If saturation is 0, the color is a shade of gray
red = get_color( src, value_t() ); red = get_color( src, value_t() );