1 #ifndef __XY_BITMAP_674EB983_2A49_432D_A750_62C3B3E9DA67_H__
2 #define __XY_BITMAP_674EB983_2A49_432D_A750_62C3B3E9DA67_H__
5 #include <boost/shared_ptr.hpp>
6 #include "XySubRenderIntf.h"
11 enum MemLayout
{ PACK
, PLANNA
, RESERVED
};
26 plans
[0] = plans
[1] = plans
[2] = plans
[3] = NULL
;
30 static XyBitmap
*CreateBitmap(const CRect
& target_rect
, MemLayout layout
);
32 static void AlphaBltPack(SubPicDesc
& spd
, POINT pos
, SIZE size
, LPCVOID pixels
, int pitch
);
33 static void AlphaBltPlannar(SubPicDesc
& spd
, POINT pos
, SIZE size
, const XyPlannerFormatExtra
& pixels
, int pitch
);
35 static void ClearBitmap(XyBitmap
*bitmap
);
38 class XySubRenderFrame
: public CUnknown
, public IXySubRenderFrame
42 STDMETHODIMP
NonDelegatingQueryInterface(REFIID riid
, void** ppv
);
44 STDMETHODIMP
GetOutputRect(RECT
*outputRect
);
45 STDMETHODIMP
GetClipRect(RECT
*clipRect
);
46 STDMETHODIMP
GetXyColorSpace(int *xyColorSpace
);
47 STDMETHODIMP
GetBitmapCount(int *count
);
48 STDMETHODIMP
GetBitmap(int index
, ULONGLONG
*id
, POINT
*position
, SIZE
*size
, LPCVOID
*pixels
, int *pitch
);
49 STDMETHODIMP
GetBitmapExtra(int index
, LPVOID extra_info
);
54 typedef ::boost::shared_ptr
<XyBitmap
> SharedBitmap
;
56 CAtlArray
<SharedBitmap
> m_bitmaps
;
57 CAtlArray
<int> m_bitmap_ids
;
60 XyColorSpace m_xy_color_space
;
63 typedef ::boost::shared_ptr
<XySubRenderFrame
> SharedPtrXySubRenderFrame
;
65 class XySubRenderFrameCreater
68 static XySubRenderFrameCreater
* GetDefaultCreater();
70 HRESULT
SetOutputRect(const RECT
& output_rect
);
71 HRESULT
SetClipRect(const RECT
& clip_rect
);
72 HRESULT
SetColorSpace(XyColorSpace color_space
);
74 HRESULT
GetOutputRect(RECT
*output_rect
);
75 HRESULT
GetClipRect(RECT
*clip_rect
);
76 HRESULT
GetColorSpace(XyColorSpace
*color_space
);
78 XySubRenderFrame
* NewXySubRenderFrame(UINT bitmap_count
);
79 XyBitmap
* CreateBitmap(const RECT
& target_rect
);
80 DWORD
TransColor(DWORD argb
);
82 XySubRenderFrameCreater():m_xy_color_space(XY_CS_ARGB
), m_bitmap_layout(XyBitmap::PACK
){}
86 XyColorSpace m_xy_color_space
;
87 XyBitmap::MemLayout m_bitmap_layout
;
91 #endif // __XY_BITMAP_674EB983_2A49_432D_A750_62C3B3E9DA67_H__