ifc_omgraphics.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #ifndef NULLSOFT_WINAMP_OMGRAPHICS_INTERFACE_HEADER
  2. #define NULLSOFT_WINAMP_OMGRAPHICS_INTERFACE_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <bfc/dispatch.h>
  7. // {0CE26A63-B611-468b-A679-810AAD0FB124}
  8. static const GUID IFC_OmGrpahics =
  9. { 0xce26a63, 0xb611, 0x468b, { 0xa6, 0x79, 0x81, 0xa, 0xad, 0xf, 0xb1, 0x24 } };
  10. class __declspec(novtable) ifc_omgraphics: public Dispatchable
  11. {
  12. protected:
  13. ifc_omgraphics() {}
  14. ~ifc_omgraphics() {}
  15. public:
  16. HRESULT GetDistance(COLORREF rgb1, COLORREF rgb2, int *distance);
  17. HRESULT GetDarker(COLORREF rgb1, COLORREF rgb2, COLORREF *result);
  18. HRESULT BlendColor(COLORREF rgbTop, COLORREF rgbBottom, int alpha, COLORREF *result);
  19. HRESULT Colorize(BYTE *pixels, long cx, long cy, WORD bpp, COLORREF rgbBk, COLORREF rgbFg, BOOL removeAlpha);
  20. HRESULT BlendOnColor(HBITMAP hbmp, RECT *prcPart, BOOL premult, COLORREF rgb);
  21. HRESULT BlendOnColor2(BYTE *pixels, int bitmapCX, int bitmapCY, long x, long y, long cx, long cy, WORD bpp, BOOL premult, COLORREF rgb);
  22. HRESULT Premultiply(BYTE *pixels, long cx, long cy);
  23. HRESULT AlphaBlend(HDC hdcDest, const RECT *rectDest, HDC hdcSrc, const RECT *rectSrc, BLENDFUNCTION blendFunction);
  24. HRESULT AnimateRotation(HDC hdc, HBITMAP bitmapFrame, int frameCount, COLORREF rgbBk, BOOL fKeepSize, HBITMAP *result);
  25. public:
  26. DISPATCH_CODES
  27. {
  28. API_GETDISTANCE = 10,
  29. API_GETDARKER = 20,
  30. API_BLENDCOLOR = 30,
  31. API_COLORIZE = 40,
  32. API_BLENDONCOLOR = 50,
  33. API_BLENDONCOLOR2 = 60,
  34. API_PREMULTIPLY = 70,
  35. API_ALPHABLEND = 80,
  36. API_ANIMATEROTATION = 90,
  37. };
  38. };
  39. inline HRESULT ifc_omgraphics::GetDistance(COLORREF rgb1, COLORREF rgb2, int *distance)
  40. {
  41. return _call(API_GETDISTANCE, (HRESULT)E_NOTIMPL, rgb1, rgb2, distance);
  42. }
  43. inline HRESULT ifc_omgraphics::GetDarker(COLORREF rgb1, COLORREF rgb2, COLORREF *result)
  44. {
  45. return _call(API_GETDARKER, (HRESULT)E_NOTIMPL, rgb1, rgb2, result);
  46. }
  47. inline HRESULT ifc_omgraphics::BlendColor(COLORREF rgbTop, COLORREF rgbBottom, int alpha, COLORREF *result)
  48. {
  49. return _call(API_BLENDCOLOR, (HRESULT)E_NOTIMPL, rgbTop, rgbBottom, alpha, result);
  50. }
  51. inline HRESULT ifc_omgraphics::Colorize(BYTE *pixels, long cx, long cy, WORD bpp, COLORREF rgbBk, COLORREF rgbFg, BOOL removeAlpha)
  52. {
  53. return _call(API_COLORIZE, (HRESULT)E_NOTIMPL, pixels, cx, cy, bpp, rgbBk, rgbFg, removeAlpha);
  54. }
  55. inline HRESULT ifc_omgraphics::BlendOnColor(HBITMAP hbmp, RECT *prcPart, BOOL premult, COLORREF rgb)
  56. {
  57. return _call(API_BLENDONCOLOR, (HRESULT)E_NOTIMPL, hbmp, prcPart, premult, rgb);
  58. }
  59. inline HRESULT ifc_omgraphics::BlendOnColor2(BYTE *pixels, int bitmapCX, int bitmapCY, long x, long y, long cx, long cy, WORD bpp, BOOL premult, COLORREF rgb)
  60. {
  61. return _call(API_BLENDONCOLOR2, (HRESULT)E_NOTIMPL, pixels, bitmapCX, bitmapCY, x, y, cx, cy, bpp, premult, rgb);
  62. }
  63. inline HRESULT ifc_omgraphics::Premultiply(BYTE *pixels, long cx, long cy)
  64. {
  65. return _call(API_PREMULTIPLY, (HRESULT)E_NOTIMPL, pixels, cx, cy);
  66. }
  67. inline HRESULT ifc_omgraphics::AlphaBlend(HDC hdcDest, const RECT *rectDest, HDC hdcSrc, const RECT *rectSrc, BLENDFUNCTION blendFunction)
  68. {
  69. return _call(API_ALPHABLEND, (HRESULT)E_NOTIMPL, hdcDest, rectDest, hdcSrc, rectSrc, blendFunction);
  70. }
  71. inline HRESULT ifc_omgraphics::AnimateRotation(HDC hdc, HBITMAP bitmapFrame, int frameCount, COLORREF rgBk, BOOL fKeepSize, HBITMAP *result)
  72. {
  73. return _call(API_ANIMATEROTATION, (HRESULT)E_NOTIMPL, bitmapFrame, frameCount, rgBk, fKeepSize, result);
  74. }
  75. #endif //NULLSOFT_WINAMP_OMGRAPHICS_INTERFACE_HEADER