-
Notifications
You must be signed in to change notification settings - Fork 165
Code Samples
Christian Henning edited this page Mar 22, 2018
·
19 revisions
Gil strength is its expressiveness by using concepts and plenty of meta-programming. This makes gil hard to learn and worse hard to extend without creating a mess.
This wiki will show some of the power of gil.
// Always assume
using namespace std;
using namespace boost::gil;
How to get the color space type from an image/view
typedef rgb8_image_t image_t;
typedef typename color_space_type<image_t::view_t::value_type>::type colour_space_t;
There are rgb8_pixel_t, bgr8_pixel_t, and any other number of combinations. So how do you get the red channel value
auto get_red(pixel_t p)
{
return get_color(p, red_t());
}