Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.10 KB | None | 0 0
  1. for (int i = 0, biHeight = abs(biOld.biHeight); i < biHeight; i++)
  2.     {
  3.         //Vertical resizing
  4.         RGBTRIPLE line[biNew.biWidth];
  5.         int b = 0;
  6.         // iterate over pixels in scanline
  7.         for (int j = 0; j < biOld.biWidth; j++)
  8.         {
  9.             // temporary storage
  10.             RGBTRIPLE triple;
  11.  
  12.             // read RGB triple from infile
  13.             fread(&triple, sizeof(RGBTRIPLE), 1, inptr);
  14.  
  15.             // write RGB triple to outfile, Horizontal Resizing
  16.             for(int k = 0; k < factor; k++)
  17.             {
  18.              
  19.               line[b] = triple;
  20.               b++;
  21.             }
  22.            
  23.         }
  24.        
  25.         for(int c = 0; c < factor ; c++)
  26.         {
  27.        
  28.         fwrite(&line, sizeof(RGBTRIPLE), biNew.biWidth, outptr);
  29.        
  30.         for (int k = 0; k < newpadding; k++)
  31.         {
  32.             fputc(0x00, outptr);
  33.         }
  34.        
  35.         }
  36.  
  37.         // skip over padding, if any
  38.         fseek(inptr, oldpadding, SEEK_CUR);
  39.  
  40.         // then add it back (to demonstrate how)
  41.        
  42.        
  43.        
  44.    
  45.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement