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.
 
 
 
 
 
 

74 rivejä
2.0 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 *attr;
  25. /* Frame information */
  26. unsigned int frame, framecount;
  27. uint32_t **allchars;
  28. uint32_t **allattr;
  29. /* Painting context */
  30. uint16_t fgcolor;
  31. uint16_t bgcolor;
  32. unsigned int refcount;
  33. };
  34. struct cucul_buffer
  35. {
  36. unsigned long int size;
  37. char *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. extern void _cucul_putchar32(cucul_canvas_t *, int, int, uint32_t);
  45. /* Charset functions */
  46. extern unsigned int _cucul_strlen_utf8(char const *);
  47. extern char const *_cucul_skip_utf8(char const *, unsigned int);
  48. extern uint32_t _cucul_utf8_to_utf32(char const *);
  49. extern uint8_t _cucul_utf32_to_cp437(uint32_t);
  50. extern uint32_t _cucul_cp437_to_utf32(uint8_t);
  51. /* Colour functions */
  52. uint8_t _cucul_argb32_to_ansi8(uint32_t);
  53. uint8_t _cucul_argb32_to_ansi4fg(uint32_t);
  54. uint8_t _cucul_argb32_to_ansi4bg(uint32_t);
  55. uint16_t _cucul_argb32_to_rgb12fg(uint32_t);
  56. uint16_t _cucul_argb32_to_rgb12bg(uint32_t);
  57. uint32_t _cucul_argb32_to_rgb24fg(uint32_t);
  58. uint32_t _cucul_argb32_to_rgb24bg(uint32_t);
  59. void _cucul_argb32_to_argb4(uint32_t, uint8_t[8]);
  60. #endif /* __CUCUL_INTERNALS_H__ */