您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "config.h"
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include <pipi.h>
  6. double kern[] =
  7. {
  8. 0., -.0625, -.125, -.0625, 0.,
  9. -.0625, -.125, -.25, -.125, -.0625,
  10. -.125, -.25, 3.5, -.25, -.125,
  11. -.0625, -.125, -.25, -.125, -.0625,
  12. 0., -.0625, -.125, -.0625, 0.,
  13. };
  14. int main(int argc, char *argv[])
  15. {
  16. char *srcname = NULL, *dstname = NULL;
  17. pipi_image_t *img, *newimg;
  18. if(argc < 3)
  19. {
  20. fprintf(stderr, "%s: too few arguments\n", argv[0]);
  21. fprintf(stderr, "Usage: %s <src> <dest>\n", argv[0]);
  22. return EXIT_FAILURE;
  23. }
  24. srcname = argv[1];
  25. dstname = argv[2];
  26. img = pipi_load(srcname);
  27. newimg = pipi_convolution(img, 5, 5, kern);
  28. pipi_free(img);
  29. pipi_save(newimg, dstname);
  30. pipi_free(newimg);
  31. return 0;
  32. }