Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. void Image::invertcolors(){
  2.     int width = this->width();
  3.     int height = this->height();
  4.     for (int y = 0; y < height; y++){
  5.         for (int x = 0; x < width; x++){
  6.             (*this)(x,y)->red = 255-(*this)(x,y)->red;
  7.             (*this)(x,y)->green = 255-(*this)(x,y)->green;
  8.             (*this)(x,y)->blue = 255-(*this)(x,y)->blue;       
  9.         }
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement