1 #ifndef DRAW_H_HEADER_INCLUDED 2 #define DRAW_H_HEADER_INCLUDED 3 4 typedef struct ASDrawTool 5 { 6 int width; 7 int height; 8 int center_x, center_y ; 9 CARD32 *matrix ; 10 }ASDrawTool; 11 12 typedef struct ASDrawContext 13 { 14 #define ASDrawCTX_UsingScratch (0x01<<0) 15 #define ASDrawCTX_CanvasIsARGB (0x01<<1) 16 #define ASDrawCTX_ToolIsARGB (0x01<<2) 17 ASFlagType flags ; 18 19 ASDrawTool *tool ; 20 21 int canvas_width, canvas_height ; 22 CARD32 *canvas ; 23 CARD32 *scratch_canvas ; 24 25 int curr_x, curr_y ; 26 27 void (*apply_tool_func)( struct ASDrawContext *ctx, int curr_x, int curr_y, CARD32 ratio ); 28 void (*fill_hline_func)( struct ASDrawContext *ctx, int x_from, int y, int x_to, CARD32 ratio ); 29 }ASDrawContext; 30 31 #define AS_DRAW_BRUSHES 3 32 33 ASDrawContext *create_asdraw_context( unsigned int width, unsigned int height ); 34 Bool apply_asdraw_context( ASImage *im, ASDrawContext *ctx, ASFlagType filter ); 35 void destroy_asdraw_context( ASDrawContext *ctx ); 36 37 Bool asim_set_brush( ASDrawContext *ctx, int brush ); 38 Bool asim_set_custom_brush( ASDrawContext *ctx, ASDrawTool *brush); 39 Bool asim_set_custom_brush_colored( ASDrawContext *ctx, ASDrawTool *brush); 40 41 Bool asim_start_path( ASDrawContext *ctx ); 42 Bool asim_apply_path( ASDrawContext *ctx, int start_x, int start_y, Bool fill, int fill_start_x, int fill_start_y, CARD8 fill_threshold ); 43 44 void asim_move_to( ASDrawContext *ctx, int dst_x, int dst_y ); 45 void asim_line_to( ASDrawContext *ctx, int dst_x, int dst_y ); 46 void asim_line_to_aa( ASDrawContext *ctx, int dst_x, int dst_y ); 47 void asim_cube_bezier( ASDrawContext *ctx, int x1, int y1, int x2, int y2, int x3, int y3 ); 48 49 void asim_straight_ellips( ASDrawContext *ctx, int x, int y, int rx, int ry, Bool fill ); 50 void asim_circle( ASDrawContext *ctx, int x, int y, int r, Bool fill ); 51 void asim_ellips( ASDrawContext *ctx, int x, int y, int rx, int ry, int angle, Bool fill ); 52 void asim_ellips2( ASDrawContext *ctx, int x, int y, int rx, int ry, int angle, Bool fill ); 53 void asim_rectangle( ASDrawContext *ctx, int x, int y, int width, int height ); 54 55 void asim_flood_fill( ASDrawContext *ctx, int x, int y, CARD32 min_val, CARD32 max_val ); 56 57 #endif /* DRAW_H_HEADER_INCLUDED */ 58