summaryrefslogtreecommitdiff
path: root/boost/gil/premultiply.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/gil/premultiply.hpp')
-rw-r--r--boost/gil/premultiply.hpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/boost/gil/premultiply.hpp b/boost/gil/premultiply.hpp
index e7fb315c65..e9efa65fcb 100644
--- a/boost/gil/premultiply.hpp
+++ b/boost/gil/premultiply.hpp
@@ -24,11 +24,11 @@ struct channel_premultiply
{}
template <typename Channel>
- void operator()(Channel c) const
+ void operator()(Channel /* channel */) const
{
- // FIXME: Is c input paramater not used intentionally? Add comment on relation between src_ vs c.
+ // TODO: Explain why 'channel' input paramater is not used, or used as tag only.
- // @todo: need to do a “channel_convert” too, in case the channel types aren't the same?
+ // @todo: need to do a "channel_convert" too, in case the channel types aren't the same?
get_color(dst_, Channel()) = channel_multiply(get_color(src_,Channel()), alpha_or_max(src_));
}
SrcP const & src_;
@@ -57,11 +57,11 @@ struct premultiply
template <typename SrcP, typename DstP>
void operator()(const SrcP& src, DstP& dst) const
{
- typedef typename color_space_type<SrcP>::type src_colour_space_t;
- typedef typename color_space_type<DstP>::type dst_colour_space_t;
- typedef typename mpl::remove <src_colour_space_t, alpha_t>::type src_colour_channels;
+ using src_colour_space_t = typename color_space_type<SrcP>::type;
+ using dst_colour_space_t = typename color_space_type<DstP>::type;
+ using src_colour_channels = typename mpl::remove <src_colour_space_t, alpha_t>::type;
- typedef mpl::bool_<mpl::contains<dst_colour_space_t, alpha_t>::value> has_alpha_t;
+ using has_alpha_t = mpl::bool_<mpl::contains<dst_colour_space_t, alpha_t>::value>;
mpl::for_each<src_colour_channels>(channel_premultiply<SrcP, DstP>(src, dst));
detail::assign_alpha_if(has_alpha_t(), src, dst);
}
@@ -72,13 +72,13 @@ template <typename SrcConstRefP, // const reference to the source pixel
class premultiply_deref_fn
{
public:
- typedef premultiply_deref_fn const_t;
- typedef DstP value_type;
- typedef value_type reference; // read-only dereferencing
- typedef const value_type& const_reference;
- typedef SrcConstRefP argument_type;
- typedef reference result_type;
- BOOST_STATIC_CONSTANT(bool, is_mutable=false);
+ using const_t = premultiply_deref_fn<SrcConstRefP, DstP>;
+ using value_type = DstP;
+ using reference = value_type; // read-only dereferencing
+ using const_reference = const value_type &;
+ using argument_type = SrcConstRefP;
+ using result_type = reference;
+ static constexpr bool is_mutable = false;
result_type operator()(argument_type srcP) const
{
@@ -92,11 +92,11 @@ template <typename SrcView, typename DstP>
struct premultiplied_view_type
{
private:
- typedef typename SrcView::const_t::reference src_pix_ref; // const reference to pixel in SrcView
- typedef premultiply_deref_fn<src_pix_ref, DstP> deref_t; // the dereference adaptor that performs color conversion
- typedef typename SrcView::template add_deref<deref_t> add_ref_t;
+ using src_pix_ref = typename SrcView::const_t::reference; // const reference to pixel in SrcView
+ using deref_t = premultiply_deref_fn<src_pix_ref, DstP>; // the dereference adaptor that performs color conversion
+ using add_ref_t = typename SrcView::template add_deref<deref_t>;
public:
- typedef typename add_ref_t::type type; // the color converted view type
+ using type = typename add_ref_t::type; // the color converted view type
static type make(const SrcView& sv) { return add_ref_t::make(sv, deref_t()); }
};