git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@3164 92316355-f0b4-4df1-b90c-862c8a59935fmaster
@@ -78,6 +78,7 @@ static function_entry pipi_functions[] = { | |||||
PHP_FE(pipi_tile, NULL) | PHP_FE(pipi_tile, NULL) | ||||
PHP_FE(pipi_flood_fill, NULL) | PHP_FE(pipi_flood_fill, NULL) | ||||
PHP_FE(pipi_draw_line, NULL) | PHP_FE(pipi_draw_line, NULL) | ||||
PHP_FE(pipi_draw_rectangle, NULL) | |||||
PHP_FE(pipi_draw_polyline, NULL) | PHP_FE(pipi_draw_polyline, NULL) | ||||
PHP_FE(pipi_draw_bezier4, NULL) | PHP_FE(pipi_draw_bezier4, NULL) | ||||
PHP_FE(pipi_reduce, NULL) | PHP_FE(pipi_reduce, NULL) | ||||
@@ -691,6 +692,9 @@ PHP_FUNCTION(pipi_flood_fill) { | |||||
PHP_FUNCTION(pipi_draw_line) { | PHP_FUNCTION(pipi_draw_line) { | ||||
} | } | ||||
PHP_FUNCTION(pipi_draw_rectangle) { | |||||
} | |||||
PHP_FUNCTION(pipi_draw_polyline) { | PHP_FUNCTION(pipi_draw_polyline) { | ||||
} | } | ||||
@@ -90,6 +90,7 @@ PHP_FUNCTION(pipi_order); | |||||
PHP_FUNCTION(pipi_tile); | PHP_FUNCTION(pipi_tile); | ||||
PHP_FUNCTION(pipi_flood_fill); | PHP_FUNCTION(pipi_flood_fill); | ||||
PHP_FUNCTION(pipi_draw_line); | PHP_FUNCTION(pipi_draw_line); | ||||
PHP_FUNCTION(pipi_draw_rectangle); | |||||
PHP_FUNCTION(pipi_draw_polyline); | PHP_FUNCTION(pipi_draw_polyline); | ||||
PHP_FUNCTION(pipi_draw_bezier4); | PHP_FUNCTION(pipi_draw_bezier4); | ||||
PHP_FUNCTION(pipi_reduce); | PHP_FUNCTION(pipi_reduce); | ||||
@@ -111,6 +111,23 @@ int pipi_draw_line(pipi_image_t *img , int xa, int ya, int xb, int yb, uint32_t | |||||
return 0; | return 0; | ||||
} | } | ||||
int pipi_draw_rectangle(pipi_image_t *img , int xa, int ya, int xb, int yb, uint32_t c, int aa) | |||||
{ | |||||
while(ya < yb) | |||||
{ | |||||
pipi_draw_line(img, xa, ya, xb, ya, c, aa); | |||||
ya++; | |||||
} | |||||
while(ya > yb) | |||||
{ | |||||
pipi_draw_line(img, xa, ya, xb, ya, c, aa); | |||||
ya--; | |||||
} | |||||
return pipi_draw_line(img, xa, yb, xb, yb, c, aa); | |||||
} | |||||
int pipi_draw_polyline(pipi_image_t *img, int const x[], int const y[], | int pipi_draw_polyline(pipi_image_t *img, int const x[], int const y[], | ||||
int n, uint32_t c, int aa) | int n, uint32_t c, int aa) | ||||
{ | { | ||||
@@ -194,6 +194,7 @@ __extern pipi_image_t *pipi_tile(pipi_image_t *, int, int); | |||||
__extern int pipi_flood_fill(pipi_image_t *, | __extern int pipi_flood_fill(pipi_image_t *, | ||||
int, int, float, float, float, float); | int, int, float, float, float, float); | ||||
__extern int pipi_draw_line(pipi_image_t *, int, int, int, int, uint32_t, int); | __extern int pipi_draw_line(pipi_image_t *, int, int, int, int, uint32_t, int); | ||||
__extern int pipi_draw_rectangle(pipi_image_t *, int, int, int, int, uint32_t, int); | |||||
__extern int pipi_draw_polyline(pipi_image_t *, int const[], int const[], | __extern int pipi_draw_polyline(pipi_image_t *, int const[], int const[], | ||||
int , uint32_t, int); | int , uint32_t, int); | ||||
__extern int pipi_draw_bezier4(pipi_image_t *,int, int, int, int, int, int, int, int, uint32_t, int, int); | __extern int pipi_draw_bezier4(pipi_image_t *,int, int, int, int, int, int, int, int, uint32_t, int, int); | ||||