Rev 8796 | Rev 9558 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8796 | Rev 9552 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #ifndef KOLIBRI_BUF2D_H |
1 | #ifndef KOLIBRI_BUF2D_H |
2 | #define KOLIBRI_BUF2D_H |
2 | #define KOLIBRI_BUF2D_H |
Line 3... | Line 3... | ||
3 | 3 | ||
4 | #include |
- | |
5 | /*ToDo |
4 | #include |
6 | * voxel function |
- | |
7 | */ |
- | |
8 | 5 | #include |
|
Line 9... | Line 6... | ||
9 | extern int kolibri_buf2d_init(void); |
6 | #include |
10 | 7 | ||
11 | typedef struct { |
8 | typedef struct { |
12 | unsigned int *buf_pointer; |
9 | unsigned int *buf_pointer; |
Line 31... | Line 28... | ||
31 | BUF2D_OPT_CROP_LEFT = 2, |
28 | BUF2D_OPT_CROP_LEFT = 2, |
32 | BUF2D_OPT_CROP_BOTTOM = 4, |
29 | BUF2D_OPT_CROP_BOTTOM = 4, |
33 | BUF2D_OPT_CROP_RIGHT = 8 |
30 | BUF2D_OPT_CROP_RIGHT = 8 |
34 | }; |
31 | }; |
Line 35... | Line 32... | ||
35 | 32 | ||
36 | extern void (*buf2d_create_asm __attribute__((__stdcall__)))(buf2d_struct *); |
33 | extern void __stdcall (*buf2d_create_asm)(buf2d_struct *); |
Line 37... | Line 34... | ||
37 | extern void (*buf2d_curve_bezier_asm __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); |
34 | extern void __stdcall (*buf2d_curve_bezier_asm)(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); |
38 | 35 | ||
39 | buf2d_struct* buf2d_create(uint16_t tlx, uint16_t tly, unsigned int sizex, unsigned int sizey, unsigned int font_bgcolor, uint8_t color_bit) |
36 | buf2d_struct* buf2d_create(uint16_t tlx, uint16_t tly, unsigned int sizex, unsigned int sizey, unsigned int font_bgcolor, uint8_t color_bit) |
40 | { |
37 | { |
41 | buf2d_struct *new_buf2d_struct = (buf2d_struct *)malloc(sizeof(buf2d_struct)); |
38 | buf2d_struct *new_buf2d_struct = (buf2d_struct *)_ksys_alloc(sizeof(buf2d_struct)); |
42 | new_buf2d_struct -> left = tlx; |
39 | new_buf2d_struct -> left = tlx; |
43 | new_buf2d_struct -> top = tly; |
40 | new_buf2d_struct -> top = tly; |
44 | new_buf2d_struct -> width = sizex; |
41 | new_buf2d_struct -> width = sizex; |
Line 52... | Line 49... | ||
52 | void buf2d_curve_bezier(buf2d_struct *buf, unsigned int p0_x, unsigned int p0_y, unsigned int p1_x, unsigned int p1_y, unsigned int p2_x, unsigned int p2_y, unsigned int color) |
49 | void buf2d_curve_bezier(buf2d_struct *buf, unsigned int p0_x, unsigned int p0_y, unsigned int p1_x, unsigned int p1_y, unsigned int p2_x, unsigned int p2_y, unsigned int color) |
53 | { |
50 | { |
54 | buf2d_curve_bezier_asm(buf, (p0_x<<16)+p0_y, (p1_x<<16)+p1_y, (p2_x<<16)+p2_y, color); |
51 | buf2d_curve_bezier_asm(buf, (p0_x<<16)+p0_y, (p1_x<<16)+p1_y, (p2_x<<16)+p2_y, color); |
55 | } |
52 | } |
Line 56... | Line 53... | ||
56 | 53 | ||
57 | extern void (*buf2d_draw __attribute__((__stdcall__)))(buf2d_struct *); |
54 | extern void __stdcall (*buf2d_draw)(buf2d_struct *); |
58 | extern void (*buf2d_clear __attribute__((__stdcall__)))(buf2d_struct *, unsigned int); |
55 | extern void __stdcall (*buf2d_clear)(buf2d_struct *, unsigned int); |
59 | extern void (*buf2d_delete __attribute__((__stdcall__)))(buf2d_struct *); |
56 | extern void __stdcall (*buf2d_delete)(buf2d_struct *); |
60 | extern void (*buf2d_rotate __attribute__((__stdcall__)))(buf2d_struct *, unsigned int); |
57 | extern void __stdcall (*buf2d_rotate)(buf2d_struct *, unsigned int); |
61 | extern void (*buf2d_resize __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int); |
58 | extern void __stdcall (*buf2d_resize)(buf2d_struct *, unsigned int, unsigned int, unsigned int); |
62 | extern void (*buf2d_line __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); |
59 | extern void __stdcall (*buf2d_line)(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); |
63 | extern void (*buf2d_line_sm __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); |
60 | extern void __stdcall (*buf2d_line_sm)(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); |
64 | extern void (*buf2d_rect_by_size __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); |
61 | extern void __stdcall (*buf2d_rect_by_size)(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); |
65 | extern void (*buf2d_filled_rect_by_size __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); |
62 | extern void __stdcall (*buf2d_filled_rect_by_size)(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); |
66 | extern void (*buf2d_circle __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); |
63 | extern void __stdcall (*buf2d_circle)(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); |
67 | extern void (*buf2d_img_hdiv2 __attribute__((__stdcall__)))(buf2d_struct *); |
64 | extern void __stdcall (*buf2d_img_hdiv2)(buf2d_struct *); |
68 | extern void (*buf2d_img_wdiv2 __attribute__((__stdcall__)))(buf2d_struct *); |
65 | extern void __stdcall (*buf2d_img_wdiv2)(buf2d_struct *); |
69 | extern void (*buf2d_conv_24_to_8 __attribute__((__stdcall__)))(buf2d_struct *, unsigned int); |
66 | extern void __stdcall (*buf2d_conv_24_to_8)(buf2d_struct *, unsigned int); |
70 | extern void (*buf2d_conv_24_to_32 __attribute__((__stdcall__)))(buf2d_struct *, unsigned int); |
67 | extern void __stdcall (*buf2d_conv_24_to_32)(buf2d_struct *, unsigned int); |
71 | extern void (*buf2d_bit_blt_transp __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, buf2d_struct *); |
68 | extern void __stdcall (*buf2d_bit_blt_transp)(buf2d_struct *, unsigned int, unsigned int, buf2d_struct *); |
72 | extern void (*buf2d_bit_blt_alpha __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, buf2d_struct *); |
69 | extern void __stdcall (*buf2d_bit_blt_alpha)(buf2d_struct *, unsigned int, unsigned int, buf2d_struct *); |
73 | extern void (*buf2d_convert_text_matrix __attribute__((__stdcall__)))(buf2d_struct *); |
70 | extern void __stdcall (*buf2d_convert_text_matrix)(buf2d_struct *); |
74 | extern void (*buf2d_draw_text __attribute__((__stdcall__)))(buf2d_struct *, buf2d_struct *, const char *, unsigned int, unsigned int); |
71 | extern void __stdcall (*buf2d_draw_text)(buf2d_struct *, buf2d_struct *, const char *, unsigned int, unsigned int); |
75 | extern void (*buf2d_crop_color __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int); |
72 | extern void __stdcall (*buf2d_crop_color)(buf2d_struct *, unsigned int, unsigned int); |
76 | extern void (*buf2d_offset_h __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int); |
73 | extern void __stdcall (*buf2d_offset_h)(buf2d_struct *, unsigned int, unsigned int, unsigned int); |
77 | extern void (*buf2d_flood_fill __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); |
74 | extern void __stdcall (*buf2d_flood_fill)(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); |
78 | extern void (*buf2d_set_pixel __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int); |
75 | extern void __stdcall (*buf2d_set_pixel)(buf2d_struct *, unsigned int, unsigned int, unsigned int); |
79 | extern unsigned int (*buf2d_get_pixel __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int); |
76 | extern unsigned __stdcall (*buf2d_get_pixel)(buf2d_struct *, unsigned int, unsigned int); |
80 | extern void (*buf2d_flip_h __attribute__((__stdcall__)))(buf2d_struct *); |
77 | extern void __stdcall (*buf2d_flip_h)(buf2d_struct *); |
81 | extern void (*buf2d_flip_v __attribute__((__stdcall__)))(buf2d_struct *); |
78 | extern void __stdcall (*buf2d_flip_v)(buf2d_struct *); |
- | 79 | extern void __stdcall (*buf2d_filter_dither)(buf2d_struct *, unsigned int); |
|
82 | extern void (*buf2d_filter_dither __attribute__((__stdcall__)))(buf2d_struct *, unsigned int); |
80 |