You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

70 lines
1.7 KiB

  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$
  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. #ifndef __CUCUL_INTERNALS_H__
  14. #define __CUCUL_INTERNALS_H__
  15. #if defined(HAVE_INTTYPES_H) && !defined(__KERNEL__)
  16. # include <inttypes.h>
  17. #endif
  18. struct cucul_canvas
  19. {
  20. /* Canvas size */
  21. unsigned int width, height;
  22. /* Shortcut to the active frame */
  23. uint32_t *chars;
  24. uint32_t *attrs;
  25. /* Frame information */
  26. unsigned int frame, framecount;
  27. uint32_t **allchars;
  28. uint32_t **allattrs;
  29. /* Painting context */
  30. uint32_t curattr;
  31. unsigned int refcount;
  32. };
  33. struct cucul_buffer
  34. {
  35. unsigned long int size;
  36. char *data;
  37. int user_data;
  38. };
  39. /* Bitmap functions */
  40. extern int _cucul_init_dither(void);
  41. extern int _cucul_end_dither(void);
  42. /* Canvas functions */
  43. extern int _cucul_set_canvas_size(cucul_canvas_t *, unsigned int, unsigned int);
  44. /* Charset functions */
  45. extern unsigned int _cucul_strlen_utf8(char const *);
  46. extern char const *_cucul_skip_utf8(char const *, unsigned int);
  47. /* Colour functions */
  48. uint8_t _cucul_attr_to_ansi8(uint32_t);
  49. uint8_t _cucul_attr_to_ansi4fg(uint32_t);
  50. uint8_t _cucul_attr_to_ansi4bg(uint32_t);
  51. uint16_t _cucul_attr_to_rgb12fg(uint32_t);
  52. uint16_t _cucul_attr_to_rgb12bg(uint32_t);
  53. uint32_t _cucul_attr_to_rgb24fg(uint32_t);
  54. uint32_t _cucul_attr_to_rgb24bg(uint32_t);
  55. void _cucul_attr_to_argb4(uint32_t, uint8_t[8]);
  56. #endif /* __CUCUL_INTERNALS_H__ */