You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
911 B

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