Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. void sepia(int height, int width, RGBTRIPLE image[height][width])
  2.  
  3. {
  4.  
  5.  
  6. for ( int i=0; (i<height-1); i++)
  7. {
  8.  
  9.  
  10. for ( int j=0; j <(width-1); j++)
  11. {
  12.  
  13. if( image[i][j].rgbtRed > 255)
  14. {
  15. image[i][j].rgbtRed = 255;
  16. }
  17.  
  18. image[i][j].rgbtRed = round((.393* image[i][j].rgbtRed) + (.769 * image[i][j].rgbtGreen) +(.189 * image[i][j].rgbtBlue));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement