void operator()(const P1& src, P2& dst) const { typedef typename channel_type<P1>::type T1; default_color_converter_impl<cmyk_t,C2>()( pixel<T1,cmyk_layout_t>(channel_multiply(get_color(src,cyan_t()), get_color(src,alpha_t())), channel_multiply(get_color(src,magenta_t()),get_color(src,alpha_t())), channel_multiply(get_color(src,yellow_t()), get_color(src,alpha_t())), channel_multiply(get_color(src,black_t()), get_color(src,alpha_t()))) ,dst); }
typename PixelRef::value_type operator()( const PixelRef& p) { typename PixelRef::value_type r; get_color( r, red_t()) = channel_multiply( get_color( p, red_t()), get_color( p, alpha_t())); get_color( r, green_t()) = channel_multiply( get_color( p, green_t()), get_color( p, alpha_t())); get_color( r, blue_t()) = channel_multiply( get_color( p, blue_t()), get_color( p, alpha_t())); get_color( r, alpha_t()) = get_color( p, alpha_t()); return r; }
void operator()(const P1& src, P2& dst) const { get_color(dst,red_t()) = channel_convert<typename color_element_type<P2, red_t>::type>( channel_multiply(get_color(src,gray_color_t()),get_color(src,alpha_t()) ) ); get_color(dst,green_t()) = channel_convert<typename color_element_type<P2, green_t>::type>( channel_multiply(get_color(src,gray_color_t()),get_color(src,alpha_t()) ) ); get_color(dst,blue_t()) = channel_convert<typename color_element_type<P2, blue_t>::type>( channel_multiply(get_color(src,gray_color_t()),get_color(src,alpha_t()) ) ); }
void operator () (Channel c) const { // @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_)); }