Guest User

Untitled

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