crimp_primitive split_rgb {
image_rgb image
} object0 {
Tcl_Obj* list[3];
const crimp_imagetype* grey = crimp_imagetype_find ("crimp::image::grey8");
crimp_image* red;
crimp_image* green;
crimp_image* blue;
int x, y;
red = crimp_new_at (grey, crimp_x (image), crimp_y (image),
crimp_w (image), crimp_h (image));
green = crimp_new_at (grey, crimp_x (image), crimp_y (image),
crimp_w (image), crimp_h (image));
blue = crimp_new_at (grey, crimp_x (image), crimp_y (image),
crimp_w (image), crimp_h (image));
for (y = 0; y < crimp_h (image); y++) {
for (x = 0; x < crimp_w (image); x++) {
/*
* Placing the pixels of each color channel into their own images.
*/
GREY8 (red, x, y) = R (image, x, y);
GREY8 (green, x, y) = G (image, x, y);
GREY8 (blue, x, y) = B (image, x, y);
}
}
list [0] = crimp_new_image_obj (red);
list [1] = crimp_new_image_obj (green);
list [2] = crimp_new_image_obj (blue);
return Tcl_NewListObj (3, list);
}
# - -- --- ----- -------- -------------
# vim: set sts=4 sw=4 tw=80 et ft=tcl:
#
# Local Variables:
# mode: tcl
# fill-column: 78
# End:
#