void increase_colour_saturation(cv::Mat &image, uchar inc) { cv::Mat hsv; cvtColor(image, hsv, CV_BGR2HSV); for_each_pixel(hsv, [&inc](uchar * const pixel, int /*channels*/) { if (pixel[1] <= 255-inc) pixel[1] += inc; else pixel[1] = 255; }); cvtColor(hsv, image, CV_HSV2BGR); }
rectangle<ptrdiff_t> operator()(In const& in, Out const& out) { auto const area = spatial_(in, out); typedef typename In::value_type InPixel; typedef typename Out::value_type OutPixel; BOOST_MPL_ASSERT_RELATION( boost::gil::size<OutPixel>::value,==,boost::gil::size<OutPixel>::value ); for_each_pixel( subimage_view(out, area), adjust_brightness_contrast<3>(chromatic_) ); return area; }
void unpremult_alpha( const RGBAView& dst) { for_each_pixel( dst, detail::alpha_unpremult_t());}