Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define PROCESS_IMAGE( type , n ) \
- int process_image_##type(void *img, int width, int height ) \
- { \
- int x, y; \
- \
- for (y = 0; y < height; y++) { \
- for (x = 0; x < width; x++) { \
- if (n == 0) foo(img, x, y); \
- else if (n == 1) bar(img, x, y); \
- else baz(img, x, y); \
- } \
- } \
- return 0 ; \
- }
- PROCESS_IMAGE( foo , 0 )
- PROCESS_IMAGE( bar , 1 )
- PROCESS_IMAGE( baz , 2 )
Advertisement
Add Comment
Please, Sign In to add comment