1
0

bltcanvas.h 882 B

123456789101112131415161718192021222324252627
  1. #ifndef _BLTCANVAS_H
  2. #define _BLTCANVAS_H
  3. #include <tataki/export.h>
  4. #include "canvas.h"
  5. class TATAKIAPI BltCanvas : public Canvas
  6. {
  7. public:
  8. BltCanvas();
  9. BltCanvas(int width, int height, OSWINDOWHANDLE wnd);
  10. // override blit and stretchblit so we can use CGContextDrawLayerAtPoint/CGContextDrawLayerInRect
  11. virtual void blit(int srcx, int srcy, Canvas *dest, int dstx, int dsty, int dstw, int dsth);
  12. void blitToRect(api_canvas *canvas, RECT *src, RECT *dst, int alpha = 255);
  13. virtual void stretchblit(int srcx, int srcy, int srcw, int srch, Canvas *dest, int dstx, int dsty, int dstw, int dsth);
  14. void stretchToRectAlpha(api_canvas *canvas, RECT *src, RECT *dst, int alpha = 255);
  15. void DestructiveResize(int w, int h, int nb_bpp = 32); // resizes the bitmap, destroying the contents
  16. void fillBits(ARGB32 color);
  17. protected:
  18. CGLayerRef layer;
  19. };
  20. #endif