MCPcopy Create free account
hub / github.com/GreycLab/CImg / main

Function main

examples/use_RGBclass.cpp:57–72  ·  view source on GitHub ↗

Main procedure ----------------

Source from the content-addressed store, hash-verified

55// Main procedure
56//----------------
57int main() {
58
59 // Load images.
60 CImg<short> img1(cimg_imagepath "milla.bmp");
61 const CImg<float> img2 = CImg<float>(cimg_imagepath "parrot.ppm").resize(img1,3);
62 const float default_color[] = { 30,30,80 };
63
64 // Modify 'img1' using the RGB pixel accessor.
65 cimg_forXY(img1,x,y)
66 if (!((x*y)%31)) img1.RGB_at(x,y) = default_color;
67 else if ((x+y)%2) img1.RGB_at(x,y) = img2.RGB_at(x,y);
68 img1.display();
69
70 // Quit.
71 return 0;
72}
73
74#else
75

Callers

nothing calls this directly

Calls 1

cimg_forXYFunction · 0.70

Tested by

no test coverage detected