Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Image::invertcolors(){
- int width = this->width();
- int height = this->height();
- for (int y = 0; y < height; y++){
- for (int x = 0; x < width; x++){
- (*this)(x,y)->red = 255-(*this)(x,y)->red;
- (*this)(x,y)->green = 255-(*this)(x,y)->green;
- (*this)(x,y)->blue = 255-(*this)(x,y)->blue;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement