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

42 行
795 B

  1. #include "config.h"
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include <pipi.h>
  6. int main(int argc, char *argv[])
  7. {
  8. char *srcname = NULL, *dstname = NULL;
  9. pipi_image_t *img, *newimg;
  10. int ret = 0;
  11. if(argc < 4)
  12. {
  13. fprintf(stderr, "%s: too few arguments\n", argv[0]);
  14. fprintf(stderr, "Usage: %s <src> <x> <y> <dest>\n", argv[0]);
  15. return EXIT_FAILURE;
  16. }
  17. srcname = argv[1];
  18. dstname = argv[4];
  19. img = pipi_load(srcname);
  20. if(!img) {
  21. fprintf(stderr, "Can't open %s for reading\n", srcname);
  22. }
  23. newimg = pipi_copy(img);
  24. pipi_free(img);
  25. ret = pipi_flood_fill(newimg, atoi(argv[2]), atoi(argv[3]), 1, 0, 0, 1);
  26. if(!ret) pipi_save(newimg, dstname);
  27. pipi_free(newimg);
  28. return ret;
  29. }