Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

121 Zeilen
4.0 KiB

  1. /*
  2. * libcucul++ C++ bindings for libcucul
  3. * Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.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. /** \file cucul++.h
  14. * \version \$Id$
  15. * \author Jean-Yves Lamoureux <jylam@lnxscene.org>
  16. * \brief The \e libcucul++ public header.
  17. *
  18. * This header contains the public types and functions that applications
  19. * using \e libcucul++ may use.
  20. */
  21. #ifndef _CUCUL_PP_H
  22. #define _CUCUL_PP_H
  23. #include <cucul.h>
  24. class Cucul
  25. {
  26. friend class Caca;
  27. public:
  28. Cucul();
  29. Cucul(int width, int height);
  30. ~Cucul();
  31. /* Ugly, I know */
  32. class Font
  33. {
  34. friend class Cucul;
  35. protected:
  36. cucul_font *font;
  37. };
  38. class Dither
  39. {
  40. friend class Cucul;
  41. protected:
  42. cucul_dither *dither;
  43. };
  44. class Buffer
  45. {
  46. friend class Cucul;
  47. protected:
  48. cucul_buffer *buffer;
  49. };
  50. void set_size(unsigned int w, unsigned int h);
  51. unsigned int get_width(void);
  52. unsigned int get_height(void);
  53. void set_color(unsigned int f, unsigned int b);
  54. char const * get_color_name(unsigned int color);
  55. void printf(int x , int y , char const * format,...);
  56. void putchar(int x, int y, char ch);
  57. void putstr(int x, int y, char *str);
  58. void clear(void);
  59. void blit(int, int, Cucul* c1, Cucul* c2);
  60. void invert();
  61. void flip();
  62. void flop();
  63. void rotate();
  64. void draw_line(int, int, int, int, char const *);
  65. void draw_polyline(int const x[], int const y[], int, char const *);
  66. void draw_thin_line(int, int, int, int);
  67. void draw_thin_polyline(int const x[], int const y[], int);
  68. void draw_circle(int, int, int, char const *);
  69. void draw_ellipse(int, int, int, int, char const *);
  70. void draw_thin_ellipse(int, int, int, int);
  71. void fill_ellipse(int, int, int, int, char const *);
  72. void draw_box(int, int, int, int, char const *);
  73. void draw_thin_box(int, int, int, int);
  74. void fill_box(int, int, int, int, char const *);
  75. void draw_triangle(int, int, int, int, int, int, char const *);
  76. void draw_thin_triangle(int, int, int, int, int, int);
  77. void fill_triangle(int, int, int, int, int, int, char const *);
  78. int rand(int, int);
  79. Dither * create_dither(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
  80. void set_dither_palette(Cucul::Dither *, unsigned int r[], unsigned int g[], unsigned int b[], unsigned int a[]);
  81. void set_dither_brightness(Cucul::Dither *, float);
  82. void set_dither_gamma(Cucul::Dither *, float);
  83. void set_dither_contrast(Cucul::Dither *, float);
  84. void set_dither_invert(Cucul::Dither *, int);
  85. void set_dither_antialias(Cucul::Dither *, char const *);
  86. char const *const * get_dither_antialias_list(Cucul::Dither const *);
  87. void set_dither_color(Cucul::Dither *, char const *);
  88. char const *const * get_dither_color_list(Cucul::Dither const *);
  89. void set_dither_charset(Cucul::Dither *, char const *);
  90. char const *const * get_dither_charset_list(Cucul::Dither const *);
  91. void set_dither_mode(Cucul::Dither *, char const *);
  92. char const *const * get_dither_mode_list(Cucul::Dither const *);
  93. void dither_bitmap(int, int, int, int, Cucul::Dither const *, void *);
  94. void free_dither(Cucul::Dither *);
  95. Font * load_font(void const *, unsigned int);
  96. char const *const * get_font_list(void);
  97. unsigned int get_font_width(Font *);
  98. unsigned int get_font_height(Font *);
  99. void render_canvas(Font *, unsigned char *, unsigned int, unsigned int, unsigned int);
  100. void free_font(Font *);
  101. Buffer * export_canvas(char const *);
  102. char const *const * get_export_list(void);
  103. protected:
  104. cucul_canvas_t *get_cucul_canvas_t();
  105. private:
  106. cucul_canvas_t *cv;
  107. };
  108. #endif /* _CUCUL_PP_H */