| Revision 2789,
911 bytes
checked in by jylam, 5 years ago
(diff) |
- Added bezier files, lolz.
|
| Line | |
|---|
| 1 | #include "config.h" |
|---|
| 2 | #include "common.h" |
|---|
| 3 | |
|---|
| 4 | #include <stdio.h> |
|---|
| 5 | #include <stdlib.h> |
|---|
| 6 | #include <string.h> |
|---|
| 7 | |
|---|
| 8 | #include <pipi.h> |
|---|
| 9 | |
|---|
| 10 | int main(int argc, char *argv[]) |
|---|
| 11 | { |
|---|
| 12 | char *srcname = NULL, *dstname = NULL; |
|---|
| 13 | pipi_image_t *img, *newimg; |
|---|
| 14 | int ret = 0; |
|---|
| 15 | if(argc < 2) |
|---|
| 16 | { |
|---|
| 17 | fprintf(stderr, "%s: too few arguments\n", argv[0]); |
|---|
| 18 | fprintf(stderr, "Usage: %s <src> <dest>\n", argv[0]); |
|---|
| 19 | return EXIT_FAILURE; |
|---|
| 20 | } |
|---|
| 21 | |
|---|
| 22 | srcname = argv[1]; |
|---|
| 23 | dstname = argv[2]; |
|---|
| 24 | |
|---|
| 25 | img = pipi_load(srcname); |
|---|
| 26 | |
|---|
| 27 | if(!img) { |
|---|
| 28 | fprintf(stderr, "Can't open %s for reading\n", srcname); |
|---|
| 29 | return -1; |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | newimg = pipi_copy(img); |
|---|
| 33 | pipi_free(img); |
|---|
| 34 | |
|---|
| 35 | int w = pipi_get_image_width(newimg); |
|---|
| 36 | int h = pipi_get_image_height(newimg); |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | pipi_draw_bezier4(newimg , 1, 1, w-1, 1, w-1, h-1, 1, h-1 , 0x00FF0000, 20, 1); |
|---|
| 40 | |
|---|
| 41 | pipi_save(newimg, dstname); |
|---|
| 42 | |
|---|
| 43 | pipi_free(newimg); |
|---|
| 44 | |
|---|
| 45 | return ret; |
|---|
| 46 | } |
|---|
| 47 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.