Skip to content

Commit

Permalink
Removing unnecessary cast in hsv.cpp (#530)
Browse files Browse the repository at this point in the history
Both temp_red and max_color are float32_t so the result of the subraction already has the right type.
This should also remove the only dependency on Boost.NumericConversion
  • Loading branch information
Mike-Devel authored Nov 22, 2020
1 parent 8b1c2d3 commit 6fc7d75
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions include/boost/gil/extension/toolbox/color_spaces/hsv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_HSV_HPP
#define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_HSV_HPP

#include <boost/numeric/conversion/cast.hpp>

#include <boost/gil/color_convert.hpp>
#include <boost/gil/typedefs.hpp>
#include <boost/gil/detail/mp11.hpp>
Expand Down Expand Up @@ -86,7 +84,7 @@ struct default_color_converter_impl< rgb_t, hsv_t >
}
else
{
if( (std::abs)( boost::numeric_cast<float32_t>(temp_red - max_color) ) < 0.0001f )
if( (std::abs)( temp_red - max_color ) < 0.0001f )
{
hue = ( temp_green - temp_blue )
/ diff;
Expand Down

0 comments on commit 6fc7d75

Please sign in to comment.