#ifndef LINE_H #define LINE_H #include #include typedef struct line { object_t obj; rect_t r; } line_t; line_t * line_new( void ); void line_free( line_t *line ); char * line_str( line_t *line ); void __line_draw( line_t *line, surface_t *surface ); void line_draw( line_t *line, surface_t *surface ); void line_draw_horizontal( const uint16_t x_min, uint16_t x_max, const uint16_t y, const surface_t *surface, const color_t color, const float transp ); void line_draw_vertical( const uint16_t x, const uint16_t y_min, uint16_t y_max, const surface_t *surface, const color_t color, const float transp ); /* * You may want to experiment with line drawing algorithms changing this * function pointers. */ extern void (*line_draw_aliased)( uint16_t, uint16_t, uint16_t, uint16_t, surface_t *, color_t, float ); extern void (*line_draw_antialiased)( uint16_t, uint16_t, uint16_t, uint16_t, surface_t *, color_t, float ); void line_draw_trivial( uint16_t x0, uint16_t x1, uint16_t y0, uint16_t y1, surface_t *surface, color_t color, float transp ); void line_draw_bresenham( uint16_t x0, uint16_t x1, uint16_t y0, uint16_t y1, surface_t *surface, color_t color, float transp ); void line_draw_trivial_antialias( uint16_t x0, uint16_t x1, uint16_t y0, uint16_t y1, surface_t *surface, color_t color, float transp ); #endif /* LINE_H */