Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

76 rader
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. int user_data;
  39. };
  40. /* Bitmap functions */
  41. extern int _cucul_init_dither(void);
  42. extern int _cucul_end_dither(void);
  43. /* Canvas functions */
  44. extern int _cucul_set_canvas_size(cucul_canvas_t *, unsigned int, unsigned int);
  45. extern void _cucul_putchar32(cucul_canvas_t *, int, int, uint32_t);
  46. /* Charset functions */
  47. extern unsigned int _cucul_strlen_utf8(char const *);
  48. extern char const *_cucul_skip_utf8(char const *, unsigned int);
  49. extern uint32_t _cucul_utf8_to_utf32(char const *);
  50. extern unsigned int _cucul_utf32_to_utf8(void *, uint32_t);
  51. extern uint8_t _cucul_utf32_to_cp437(uint32_t);
  52. extern uint32_t _cucul_cp437_to_utf32(uint8_t);
  53. /* Colour functions */
  54. uint8_t _cucul_argb32_to_ansi8(uint32_t);
  55. uint8_t _cucul_argb32_to_ansi4fg(uint32_t);
  56. uint8_t _cucul_argb32_to_ansi4bg(uint32_t);
  57. uint16_t _cucul_argb32_to_rgb12fg(uint32_t);
  58. uint16_t _cucul_argb32_to_rgb12bg(uint32_t);
  59. uint32_t _cucul_argb32_to_rgb24fg(uint32_t);
  60. uint32_t _cucul_argb32_to_rgb24bg(uint32_t);
  61. void _cucul_argb32_to_argb4(uint32_t, uint8_t[8]);
  62. #endif /* __CUCUL_INTERNALS_H__ */