1 | /* |
---|
2 | * libcucul Canvas for ultrafast compositing of Unicode letters |
---|
3 | * Copyright (c) 2002-2006 Sam Hocevar <sam@zoy.org> |
---|
4 | * All Rights Reserved |
---|
5 | * |
---|
6 | * $Id: cucul_internals.h 962 2006-05-19 04:53:48Z sam $ |
---|
7 | * |
---|
8 | * This library is free software; you can redistribute it and/or |
---|
9 | * modify it under the terms of the Do What The Fuck You Want To |
---|
10 | * Public License, Version 2, as published by Sam Hocevar. See |
---|
11 | * http://sam.zoy.org/wtfpl/COPYING for more details. |
---|
12 | */ |
---|
13 | |
---|
14 | #ifndef __CUCUL_INTERNALS_H__ |
---|
15 | #define __CUCUL_INTERNALS_H__ |
---|
16 | |
---|
17 | #if defined(HAVE_INTTYPES_H) && !defined(__KERNEL__) |
---|
18 | # include <inttypes.h> |
---|
19 | #endif |
---|
20 | |
---|
21 | struct cucul_canvas |
---|
22 | { |
---|
23 | /* Canvas size */ |
---|
24 | unsigned int width, height; |
---|
25 | |
---|
26 | /* Shortcut to the active frame */ |
---|
27 | uint32_t *chars; |
---|
28 | uint32_t *attr; |
---|
29 | |
---|
30 | /* Frame information */ |
---|
31 | unsigned int frame, framecount; |
---|
32 | uint32_t **allchars; |
---|
33 | uint32_t **allattr; |
---|
34 | |
---|
35 | /* Painting context */ |
---|
36 | uint16_t fgcolor; |
---|
37 | uint16_t bgcolor; |
---|
38 | |
---|
39 | unsigned int refcount; |
---|
40 | }; |
---|
41 | |
---|
42 | struct cucul_buffer |
---|
43 | { |
---|
44 | unsigned long int size; |
---|
45 | char *data; |
---|
46 | int user_data; |
---|
47 | }; |
---|
48 | |
---|
49 | /* Bitmap functions */ |
---|
50 | extern int _cucul_init_dither(void); |
---|
51 | extern int _cucul_end_dither(void); |
---|
52 | |
---|
53 | /* Canvas functions */ |
---|
54 | extern int _cucul_set_canvas_size(cucul_canvas_t *, unsigned int, unsigned int); |
---|
55 | |
---|
56 | /* Charset functions */ |
---|
57 | extern unsigned int _cucul_strlen_utf8(char const *); |
---|
58 | extern char const *_cucul_skip_utf8(char const *, unsigned int); |
---|
59 | |
---|
60 | /* Colour functions */ |
---|
61 | uint8_t _cucul_argb32_to_ansi8(uint32_t); |
---|
62 | uint8_t _cucul_argb32_to_ansi4fg(uint32_t); |
---|
63 | uint8_t _cucul_argb32_to_ansi4bg(uint32_t); |
---|
64 | uint16_t _cucul_argb32_to_rgb12fg(uint32_t); |
---|
65 | uint16_t _cucul_argb32_to_rgb12bg(uint32_t); |
---|
66 | uint32_t _cucul_argb32_to_rgb24fg(uint32_t); |
---|
67 | uint32_t _cucul_argb32_to_rgb24bg(uint32_t); |
---|
68 | void _cucul_argb32_to_argb4(uint32_t, uint8_t[8]); |
---|
69 | |
---|
70 | #endif /* __CUCUL_INTERNALS_H__ */ |
---|