Guest User

Untitled

a guest
Feb 28th, 2015
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. static inline int process_image(void *img, int width, int height, void (*f)(void *, int, int))
  2. {
  3. int x, y;
  4.  
  5. for (y = 0; y < height; y++)
  6. for (x = 0; x < width; x++)
  7. f(img, x, y);
  8. }
  9.  
  10. int process_image_foo(void *img, int width, int height)
  11. {
  12. return process_image(img, width, height, foo);
  13. }
  14.  
  15. int process_image_bar(void *img, int width, int height)
  16. {
  17. return process_image(img, width, height, bar);
  18. }
  19.  
  20. int process_image_baz(void *img, int width, int height)
  21. {
  22. return process_image(img, width, height, baz);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment