25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

cucul_internals.h 1.8 KiB

18 yıl önce
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. /* Charset functions */
  46. extern unsigned int _cucul_strlen_utf8(char const *);
  47. extern char const *_cucul_skip_utf8(char const *, unsigned int);
  48. /* Colour functions */
  49. uint8_t _cucul_argb32_to_ansi8(uint32_t);
  50. uint8_t _cucul_argb32_to_ansi4fg(uint32_t);
  51. uint8_t _cucul_argb32_to_ansi4bg(uint32_t);
  52. uint16_t _cucul_argb32_to_rgb12fg(uint32_t);
  53. uint16_t _cucul_argb32_to_rgb12bg(uint32_t);
  54. uint32_t _cucul_argb32_to_rgb24fg(uint32_t);
  55. uint32_t _cucul_argb32_to_rgb24bg(uint32_t);
  56. void _cucul_argb32_to_argb4(uint32_t, uint8_t[8]);
  57. #endif /* __CUCUL_INTERNALS_H__ */