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.

преди 19 години
преди 19 години
преди 19 години
преди 19 години
преди 19 години
преди 19 години
преди 19 години
преди 19 години
преди 19 години
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. /* Ugly, I know */
  26. class Font
  27. {
  28. public:
  29. ~Font();
  30. Font(void const *, unsigned int);
  31. char const *const * getList(void);
  32. unsigned int getWidth();
  33. unsigned int getHeight();
  34. void renderCanvas(Cucul *, unsigned char *, unsigned int, unsigned int, unsigned int);
  35. private:
  36. cucul_font *font;
  37. };
  38. class Dither
  39. {
  40. public:
  41. Dither(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
  42. ~Dither();
  43. void setPalette(unsigned int r[], unsigned int g[], unsigned int b[], unsigned int a[]);
  44. void setBrightness(float);
  45. void setGamma(float);
  46. void setContrast(float);
  47. void setInvert(int);
  48. void setAntialias(char const *);
  49. char const *const * getAntialiasList();
  50. void setColor(char const *);
  51. char const *const * getColorList();
  52. void setCharset(char const *);
  53. char const *const * getCharsetList();
  54. void setMode(char const *);
  55. char const *const * getModeList();
  56. void Bitmap(Cucul *, int, int, int, int, void *);
  57. private:
  58. cucul_dither *dither;
  59. };
  60. class Buffer
  61. {
  62. public:
  63. Buffer(Cucul *cv, char const *);
  64. ~Buffer();
  65. char const *const * getExportList(void);
  66. private:
  67. cucul_buffer *buffer;
  68. };
  69. class Cucul
  70. {
  71. friend class Caca;
  72. friend class Dither;
  73. friend class Font;
  74. friend class Buffer;
  75. public:
  76. Cucul();
  77. Cucul(int width, int height);
  78. ~Cucul();
  79. void setSize(unsigned int w, unsigned int h);
  80. unsigned int getWidth(void);
  81. unsigned int getHeight(void);
  82. void setColor(unsigned int f, unsigned int b);
  83. char const * getColorName(unsigned int color);
  84. void Printf(int x , int y , char const * format,...);
  85. void putChar(int x, int y, char ch);
  86. void putStr(int x, int y, char *str);
  87. void Clear(void);
  88. void Blit(int, int, Cucul* c1, Cucul* c2);
  89. void Invert();
  90. void Flip();
  91. void Flop();
  92. void Rotate();
  93. void drawLine(int, int, int, int, char const *);
  94. void drawPolyline(int const x[], int const y[], int, char const *);
  95. void drawThinLine(int, int, int, int);
  96. void drawThinPolyline(int const x[], int const y[], int);
  97. void drawCircle(int, int, int, char const *);
  98. void drawEllipse(int, int, int, int, char const *);
  99. void drawThinEllipse(int, int, int, int);
  100. void fillEllipse(int, int, int, int, char const *);
  101. void drawBox(int, int, int, int, char const *);
  102. void drawThinBox(int, int, int, int);
  103. void fillBox(int, int, int, int, char const *);
  104. void drawTriangle(int, int, int, int, int, int, char const *);
  105. void drawThinTriangle(int, int, int, int, int, int);
  106. void fillTriangle(int, int, int, int, int, int, char const *);
  107. int Rand(int, int);
  108. protected:
  109. cucul_canvas_t *get_cucul_canvas_t();
  110. private:
  111. cucul_canvas_t *cv;
  112. };
  113. #endif /* _CUCUL_PP_H */