浏览代码

Quick and dirty implementation of pipi_draw_rectangle() to save zMoo.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@3164 92316355-f0b4-4df1-b90c-862c8a59935f
master
sam 16 年前
父节点
当前提交
e10e51eaba
共有 4 个文件被更改,包括 23 次插入0 次删除
  1. +4
    -0
      pipi-php/php_pipi.c
  2. +1
    -0
      pipi-php/php_pipi.h
  3. +17
    -0
      pipi/paint/line.c
  4. +1
    -0
      pipi/pipi.h

+ 4
- 0
pipi-php/php_pipi.c 查看文件

@@ -78,6 +78,7 @@ static function_entry pipi_functions[] = {
PHP_FE(pipi_tile, NULL)
PHP_FE(pipi_flood_fill, NULL)
PHP_FE(pipi_draw_line, NULL)
PHP_FE(pipi_draw_rectangle, NULL)
PHP_FE(pipi_draw_polyline, NULL)
PHP_FE(pipi_draw_bezier4, NULL)
PHP_FE(pipi_reduce, NULL)
@@ -691,6 +692,9 @@ PHP_FUNCTION(pipi_flood_fill) {
PHP_FUNCTION(pipi_draw_line) {
}

PHP_FUNCTION(pipi_draw_rectangle) {
}

PHP_FUNCTION(pipi_draw_polyline) {
}



+ 1
- 0
pipi-php/php_pipi.h 查看文件

@@ -90,6 +90,7 @@ PHP_FUNCTION(pipi_order);
PHP_FUNCTION(pipi_tile);
PHP_FUNCTION(pipi_flood_fill);
PHP_FUNCTION(pipi_draw_line);
PHP_FUNCTION(pipi_draw_rectangle);
PHP_FUNCTION(pipi_draw_polyline);
PHP_FUNCTION(pipi_draw_bezier4);
PHP_FUNCTION(pipi_reduce);


+ 17
- 0
pipi/paint/line.c 查看文件

@@ -111,6 +111,23 @@ int pipi_draw_line(pipi_image_t *img , int xa, int ya, int xb, int yb, uint32_t
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 n, uint32_t c, int aa)
{


+ 1
- 0
pipi/pipi.h 查看文件

@@ -194,6 +194,7 @@ __extern pipi_image_t *pipi_tile(pipi_image_t *, int, int);
__extern int pipi_flood_fill(pipi_image_t *,
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_rectangle(pipi_image_t *, int, int, int, int, uint32_t, int);
__extern int pipi_draw_polyline(pipi_image_t *, int const[], int const[],
int , uint32_t, int);
__extern int pipi_draw_bezier4(pipi_image_t *,int, int, int, int, int, int, int, int, uint32_t, int, int);


正在加载...
取消
保存