aboutsummaryrefslogtreecommitdiff
path: root/Src/omBrowser/graphicsObject.h
blob: 9ce94cf298ff0f2415abaad1df37d77505db168a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef NULLSOFT_WINAMP_UTILITY_GRAPHICS_OBJECT_HEADER
#define NULLSOFT_WINAMP_UTILITY_GRAPHICS_OBJECT_HEADER

#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

#include "./ifc_omgraphics.h"


class GraphicsObject : public ifc_omgraphics
{	
protected:
	GraphicsObject();
	~GraphicsObject();

public:
	static HRESULT CreateInstance(GraphicsObject **instance);

public:
	/* Dispatchable */
	size_t AddRef();
	size_t Release();
	int QueryInterface(GUID interface_guid, void **object);

	/* ifc_omgraphics */
	HRESULT GetDistance(COLORREF rgb1, COLORREF rgb2, int *distance);
	HRESULT GetDarker(COLORREF rgb1, COLORREF rgb2, COLORREF *result);
	HRESULT BlendColor(COLORREF rgbTop, COLORREF rgbBottom, int alpha, COLORREF *result);
	HRESULT Colorize(BYTE *pixels, long cx, long cy, WORD bpp, COLORREF rgbBk, COLORREF rgbFg, BOOL removeAlpha);
	HRESULT BlendOnColor(HBITMAP hbmp, RECT *prcPart, BOOL premult, COLORREF rgb);
	HRESULT BlendOnColor2(BYTE *pixels, int bitmapCX, int bitmapCY, long x, long y, long cx, long cy, WORD bpp, BOOL premult, COLORREF rgb);
	HRESULT Premultiply(BYTE *pixels, long cx, long cy);
	HRESULT AlphaBlend(HDC hdcDest, const RECT *rectDest, HDC hdcSrc, const RECT *rectSrc, BLENDFUNCTION blendFunction);
	HRESULT AnimateRotation(HDC hdc, HBITMAP bitmapFrame, int frameCount, COLORREF rgbBk, BOOL fKeepSize, HBITMAP *result);

protected:
	size_t ref;

protected:
	RECVS_DISPATCH;
};


#endif // NULLSOFT_WINAMP_UTILITY_GRAPHICS_OBJECT_HEADER