Guest User

Untitled

a guest
Feb 28th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.98 KB | None | 0 0
  1.         int process_image(void *img, int width, int height , int n )
  2.         {                                                          
  3.                 int x, y;                                            
  4.                                                                    
  5.                 for (y = 0; y < height; y++) {                      
  6.                         for (x = 0; x < width; x++) {                
  7.                                 if      (n == 0) foo(img, x, y);    
  8.                                 else if (n == 1) bar(img, x, y);    
  9.                                 else             baz(img, x, y);    
  10.                         }                                            
  11.                 }                                                    
  12.                 return 0 ;
  13.         }
  14.  
  15.        #define process_image_foo( i , w , h ) process_image( i , w , h , 0 )
  16.        #define process_image_bar( i , w , h ) process_image( i , w , h , 1 )
  17.        #define process_image_baz( i , w , h ) process_image( i , w , h , 2 )
Advertisement
Add Comment
Please, Sign In to add comment