Archived
1
0
This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
winamp/Src/tataki/canvas/win/bltcanvas.h

42 lines
1.2 KiB
C
Raw Normal View History

2024-09-24 12:54:57 +00:00
#ifndef _BLTCANVAS_H
#define _BLTCANVAS_H
#include "canvas.h"
#include <tataki/export.h>
#include <bfc/ptrlist.h>
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<SkinBitmap> *skinbmps;
SkinBitmap *envelope;
BITMAP bm;
bool ourbmp;
int bpp;
//void premultiply(ARGB32 *m_pBits, int nwords, int newalpha=-1);
};
#endif