Changeset 3164


Ignore:
Timestamp:
Oct 31, 2008, 4:16:53 PM (12 years ago)
Author:
Sam Hocevar
Message:

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

Location:
libpipi/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/pipi-php/php_pipi.c

    r3090 r3164  
    7979        PHP_FE(pipi_flood_fill, NULL)
    8080        PHP_FE(pipi_draw_line, NULL)
     81        PHP_FE(pipi_draw_rectangle, NULL)
    8182        PHP_FE(pipi_draw_polyline, NULL)
    8283        PHP_FE(pipi_draw_bezier4, NULL)
     
    692693}
    693694
     695PHP_FUNCTION(pipi_draw_rectangle) {
     696}
     697
    694698PHP_FUNCTION(pipi_draw_polyline) {
    695699}
  • libpipi/trunk/pipi-php/php_pipi.h

    r3069 r3164  
    9191PHP_FUNCTION(pipi_flood_fill);
    9292PHP_FUNCTION(pipi_draw_line);
     93PHP_FUNCTION(pipi_draw_rectangle);
    9394PHP_FUNCTION(pipi_draw_polyline);
    9495PHP_FUNCTION(pipi_draw_bezier4);
  • libpipi/trunk/pipi/paint/line.c

    r2904 r3164  
    110110    clip_line(img, &s);
    111111    return 0;
     112}
     113
     114int pipi_draw_rectangle(pipi_image_t *img , int xa, int ya, int xb, int yb, uint32_t c, int aa)
     115{
     116    while(ya < yb)
     117    {
     118        pipi_draw_line(img, xa, ya, xb, ya, c, aa);
     119        ya++;
     120    }
     121
     122    while(ya > yb)
     123    {
     124        pipi_draw_line(img, xa, ya, xb, ya, c, aa);
     125        ya--;
     126    }
     127
     128    return pipi_draw_line(img, xa, yb, xb, yb, c, aa);
    112129}
    113130
  • libpipi/trunk/pipi/pipi.h

    r2914 r3164  
    195195                           int, int, float, float, float, float);
    196196__extern int pipi_draw_line(pipi_image_t *, int, int, int, int, uint32_t, int);
     197__extern int pipi_draw_rectangle(pipi_image_t *, int, int, int, int, uint32_t, int);
    197198__extern int pipi_draw_polyline(pipi_image_t *, int const[], int const[],
    198199                              int , uint32_t, int);
Note: See TracChangeset for help on using the changeset viewer.