Rev 9811 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8796 | turbocat | 1 | #ifndef KOLIBRI_BUF2D_H |
2 | #define KOLIBRI_BUF2D_H |
||
3 | |||
9766 | turbocat | 4 | #include |
8796 | turbocat | 5 | #include |
9620 | turbocat | 6 | #include |
8796 | turbocat | 7 | |
8 | typedef struct { |
||
9766 | turbocat | 9 | unsigned int* buf_pointer; |
10 | uint16_t left; |
||
11 | uint16_t top; |
||
12 | unsigned int width; |
||
13 | unsigned int height; |
||
14 | unsigned int bgcolor; |
||
15 | uint8_t color_bit; |
||
16 | } __attribute__((__packed__)) buf2d_struct; |
||
8796 | turbocat | 17 | |
18 | enum BUF2D_ALGORITM_FILTR { |
||
9766 | turbocat | 19 | SIERRA_LITE, |
20 | FLOYD_STEINBERG, |
||
21 | BURKERS, |
||
22 | HEAVYIRON_MOD, |
||
23 | ATKINSON |
||
8796 | turbocat | 24 | }; |
25 | |||
26 | enum BUF2D_OPT_CROP { |
||
9766 | turbocat | 27 | BUF2D_OPT_CROP_TOP = 1, |
28 | BUF2D_OPT_CROP_LEFT = 2, |
||
29 | BUF2D_OPT_CROP_BOTTOM = 4, |
||
30 | BUF2D_OPT_CROP_RIGHT = 8 |
||
8796 | turbocat | 31 | }; |
32 | |||
9812 | Coldy | 33 | DLLAPI void __stdcall buf2d_create_asm(buf2d_struct*); |
34 | DLLAPI void __stdcall buf2d_curve_bezier_asm(buf2d_struct*, unsigned int, unsigned int, unsigned int, unsigned int); |
||
8796 | turbocat | 35 | |
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) |
||
37 | { |
||
9766 | turbocat | 38 | buf2d_struct* new_buf2d_struct = (buf2d_struct*)_ksys_alloc(sizeof(buf2d_struct)); |
39 | new_buf2d_struct->left = tlx; |
||
40 | new_buf2d_struct->top = tly; |
||
41 | new_buf2d_struct->width = sizex; |
||
42 | new_buf2d_struct->height = sizey; |
||
43 | new_buf2d_struct->bgcolor = font_bgcolor; |
||
44 | new_buf2d_struct->color_bit = color_bit; |
||
45 | buf2d_create_asm(new_buf2d_struct); |
||
8796 | turbocat | 46 | return new_buf2d_struct; |
47 | } |
||
48 | |||
9766 | turbocat | 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) |
8796 | turbocat | 50 | { |
9766 | turbocat | 51 | buf2d_curve_bezier_asm(buf, (p0_x << 16) + p0_y, (p1_x << 16) + p1_y, (p2_x << 16) + p2_y, color); |
8796 | turbocat | 52 | } |
53 | |||
9812 | Coldy | 54 | DLLAPI void __stdcall buf2d_draw(buf2d_struct*); |
55 | DLLAPI void __stdcall buf2d_clear(buf2d_struct*, unsigned int); |
||
56 | DLLAPI void __stdcall buf2d_delete(buf2d_struct*); |
||
57 | DLLAPI void __stdcall buf2d_rotate(buf2d_struct*, unsigned int); |
||
58 | DLLAPI void __stdcall buf2d_resize(buf2d_struct*, unsigned int, unsigned int, unsigned int); |
||
59 | DLLAPI void __stdcall buf2d_line(buf2d_struct*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); |
||
60 | DLLAPI void __stdcall buf2d_line_sm(buf2d_struct*, unsigned int, unsigned int, unsigned int, unsigned int); |
||
61 | DLLAPI void __stdcall buf2d_rect_by_size(buf2d_struct*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); |
||
62 | DLLAPI void __stdcall buf2d_filled_rect_by_size(buf2d_struct*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); |
||
63 | DLLAPI void __stdcall buf2d_circle(buf2d_struct*, unsigned int, unsigned int, unsigned int, unsigned int); |
||
64 | DLLAPI void __stdcall buf2d_img_hdiv2(buf2d_struct*); |
||
65 | DLLAPI void __stdcall buf2d_img_wdiv2(buf2d_struct*); |
||
66 | DLLAPI void __stdcall buf2d_conv_24_to_8(buf2d_struct*, unsigned int); |
||
67 | DLLAPI void __stdcall buf2d_conv_24_to_32(buf2d_struct*, unsigned int); |
||
68 | DLLAPI void __stdcall buf2d_bit_blt_transp(buf2d_struct*, unsigned int, unsigned int, buf2d_struct*); |
||
69 | DLLAPI void __stdcall buf2d_bit_blt_alpha(buf2d_struct*, unsigned int, unsigned int, buf2d_struct*); |
||
70 | DLLAPI void __stdcall buf2d_convert_text_matrix(buf2d_struct*); |
||
71 | DLLAPI void __stdcall buf2d_draw_text(buf2d_struct*, buf2d_struct*, const char*, unsigned int, unsigned int); |
||
72 | DLLAPI void __stdcall buf2d_crop_color(buf2d_struct*, unsigned int, unsigned int); |
||
73 | DLLAPI void __stdcall buf2d_offset_h(buf2d_struct*, unsigned int, unsigned int, unsigned int); |
||
74 | DLLAPI void __stdcall buf2d_flood_fill(buf2d_struct*, unsigned int, unsigned int, unsigned int, unsigned int); |
||
75 | DLLAPI void __stdcall buf2d_set_pixel(buf2d_struct*, unsigned int, unsigned int, unsigned int); |
||
76 | DLLAPI unsigned __stdcall buf2d_get_pixel(buf2d_struct*, unsigned int, unsigned int); |
||
77 | DLLAPI void __stdcall buf2d_flip_h(buf2d_struct*); |
||
78 | DLLAPI void __stdcall buf2d_flip_v(buf2d_struct*); |
||
79 | DLLAPI void __stdcall buf2d_filter_dither(buf2d_struct*, unsigned int); |
||
9620 | turbocat | 80 | |
8796 | turbocat | 81 | #endif /* KOLIBRI_BUF2D_H */><>><>><> |