bltcanvas.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef _BLTCANVAS_H
  2. #define _BLTCANVAS_H
  3. #include "canvas.h"
  4. #include <tataki/export.h>
  5. #include <bfc/ptrlist.h>
  6. class TATAKIAPI BltCanvas : public Canvas
  7. {
  8. public:
  9. BltCanvas();
  10. BltCanvas(int w, int h, HWND wnd=NULL, int nb_bpp=32/*, unsigned __int8 *pal=NULL,int palsize=0*/);
  11. BltCanvas(HBITMAP bmp);
  12. virtual ~BltCanvas();
  13. void *getBits();
  14. HBITMAP getBitmap();
  15. SkinBitmap *makeSkinBitmap(); // this one makes a new, with own bits
  16. SkinBitmap *getSkinBitmap(); // this one gives a skinbitmap envoloppe of this bltcanvas
  17. void disposeSkinBitmap(SkinBitmap *b); // call only after makeSkinBitmap
  18. void fillBits(COLORREF color);
  19. void vflip(int vert_cells=1);
  20. void hflip(int hor_cells=1);
  21. void maskColor(COLORREF from, COLORREF to);
  22. void makeAlpha(int newalpha=-1); // -1 = premultiply using current alpha
  23. void DestructiveResize(int w, int h, int nb_bpp = 32); // resizes the bitmap, destroying the contents
  24. private: // NONPORTABLE
  25. void AllocBitmap(int w, int h, int nb_bpp);
  26. HBITMAP hbmp, prevbmp;
  27. PtrList<SkinBitmap> *skinbmps;
  28. SkinBitmap *envelope;
  29. BITMAP bm;
  30. bool ourbmp;
  31. int bpp;
  32. //void premultiply(ARGB32 *m_pBits, int nwords, int newalpha=-1);
  33. };
  34. #endif