DragonOsman

Vertical Resize

Nov 2nd, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.87 KB | None | 0 0
  1. // rewind cursor to return previous byte in scanline
  2.         fseek(inptr, -padding, SEEK_CUR);
  3.        
  4.         // iterate over images' widths and heights to resize vertically
  5.         for (int l = 0; l < biHeight; l++)
  6.         {
  7.             // storage for the triples data
  8.             RGBTRIPLE triple;
  9.  
  10.             for (int m = 0; m < img_width; m++)
  11.             {
  12.                 for (int iii = 0; iii < n - 1; iii++)
  13.                 {
  14.                     // read from the infile and store in triple
  15.                     fread(&triple, sizeof(RGBTRIPLE), 1, inptr);
  16.                    
  17.                     for (int index = 0; index <= n - 1; index++)
  18.                     {
  19.                         fwrite(&triple, sizeof(RGBTRIPLE), 1, outptr);
  20.                     }
  21.                     fseek(inptr, -padding, SEEK_CUR);
  22.                 }
  23.             }
  24.         }
Advertisement
Add Comment
Please, Sign In to add comment