Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. if (!img.Ok()) return;
  2.     wxBusyCursor wait;
  3.  
  4.     CImg<unsigned char> img1(this->img.GetWidth(),this->img.GetHeight(),1,3);
  5.     CImg<float> msk(this->img.GetWidth(),this->img.GetHeight(),1,3);
  6.     cimg_forXY(img1,x,y)
  7.     {
  8.       img1(x,y,0) = img.GetRed(x,y);  
  9.       img1(x,y,1) = img.GetGreen(x,y);  
  10.       img1(x,y,2) = img.GetBlue(x,y);  
  11.     }
  12.  
  13.     msk.draw_gaussian(this->img.GetWidth()/2.,this->img.GetHeight()/2., 10, CImg<>::vector(255).data);
  14.  
  15.    
  16.    
  17.     cimg_forXY(img1,x,y)
  18.     {
  19.           //msk(x,y,0,3);  
  20.          //this->img.SetRGB(x,y,int(img1(x,y,0)), int(img1(x,y,1)), int(img1(x,y,2)));
  21.         this->img.SetRGB(x,y,int(img1(x,y,0) * msk(x,y,0)), int(img1(x,y,1) * msk(x,y,1)) ,int(img1(x,y,2) * msk(x,y,2)) );
  22.     }
  23.     Refresh();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement