Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void grayScale(){
- S_RGBA color;
- int x;
- int y;
- unsigned char gs;
- for(x=0; x<width; x++){
- for(y=0; y<height; y++){
- color = getPixel(x,y);
- gs = ROUND(color.red * 0.299 + color.green * 0.587 + color.blue * 0.114);
- color.red = gs;
- color.blue = gs;
- color.green = gs;
- putPixel(x,y,color);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement