From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/tataki/canvas/win/bltcanvas.h | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Src/tataki/canvas/win/bltcanvas.h (limited to 'Src/tataki/canvas/win/bltcanvas.h') diff --git a/Src/tataki/canvas/win/bltcanvas.h b/Src/tataki/canvas/win/bltcanvas.h new file mode 100644 index 00000000..250e8ba3 --- /dev/null +++ b/Src/tataki/canvas/win/bltcanvas.h @@ -0,0 +1,41 @@ +#ifndef _BLTCANVAS_H +#define _BLTCANVAS_H + +#include "canvas.h" +#include +#include +class TATAKIAPI BltCanvas : public Canvas +{ +public: + BltCanvas(); + BltCanvas(int w, int h, HWND wnd=NULL, int nb_bpp=32/*, unsigned __int8 *pal=NULL,int palsize=0*/); + BltCanvas(HBITMAP bmp); + virtual ~BltCanvas(); + void *getBits(); + HBITMAP getBitmap(); + SkinBitmap *makeSkinBitmap(); // this one makes a new, with own bits + SkinBitmap *getSkinBitmap(); // this one gives a skinbitmap envoloppe of this bltcanvas + void disposeSkinBitmap(SkinBitmap *b); // call only after makeSkinBitmap + + void fillBits(COLORREF color); + + void vflip(int vert_cells=1); + void hflip(int hor_cells=1); + void maskColor(COLORREF from, COLORREF to); + void makeAlpha(int newalpha=-1); // -1 = premultiply using current alpha + + void DestructiveResize(int w, int h, int nb_bpp = 32); // resizes the bitmap, destroying the contents +private: // NONPORTABLE + + void AllocBitmap(int w, int h, int nb_bpp); + HBITMAP hbmp, prevbmp; + PtrList *skinbmps; + SkinBitmap *envelope; + BITMAP bm; + bool ourbmp; + int bpp; + + //void premultiply(ARGB32 *m_pBits, int nwords, int newalpha=-1); +}; + +#endif -- cgit