5 * Copyright (C) 2005-2013 Team XBMC
8 * This Program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2, or (at your option)
13 * This Program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with XBMC; see the file COPYING. If not, see
20 * <http://www.gnu.org/licenses/>.
24 #include "XBoxRenderer.h"
26 class CRGBRendererV2 : public CXBoxRenderer
29 CRGBRendererV2(LPDIRECT3DDEVICE8 pDevice);
32 // Functions called from mplayer
33 // virtual void WaitForFlip();
34 virtual bool Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags);
35 virtual unsigned int PreInit();
36 virtual void UnInit();
37 virtual void FlipPage(int source);
40 virtual void Render(DWORD flags);
41 virtual void ManageTextures();
43 bool Create444PTexture(bool full, bool field);
44 void Delete444PTexture();
45 void Clear444PTexture(bool full, bool field);
47 bool CreateLookupTextures(const YUVCOEF &coef, const YUVRANGE &range);
48 void DeleteLookupTextures();
50 void InterleaveYUVto444P(
52 LPDIRECT3DTEXTURE8 pAlpha,
53 LPDIRECT3DSURFACE8 pTarget,
54 RECT &source, RECT &sourcealpha, RECT &target,
55 unsigned cshift_x, unsigned cshift_y,
56 float offset_x, float offset_y,
57 float coffset_x, float coffset_y);
60 D3DBaseTexture* pSource,
61 RECT &source, RECT &target,
62 float offset_x, float offset_y);
64 // YUV interleaved texture
65 LPDIRECT3DTEXTURE8 m_444PTextureFull;
66 LPDIRECT3DTEXTURE8 m_444PTextureField;
68 bool m_444GeneratedFull;
69 int m_444RenderBuffer;
72 // textures for YUV->RGB lookup
73 LPDIRECT3DTEXTURE8 m_UVLookup;
74 LPDIRECT3DTEXTURE8 m_YLookup;
75 LPDIRECT3DTEXTURE8 m_UVErrorLookup;
76 YUVRANGE m_yuvrange_last;
77 YUVCOEF m_yuvcoef_last;
81 DWORD m_hInterleavingShader;
82 DWORD m_hInterleavingShaderAlpha;
83 DWORD m_hYUVtoRGBLookup;
88 static const DWORD FVF_YUVRGBVERTEX = D3DFVF_XYZRHW | D3DFVF_TEX4;
89 static const DWORD FVF_RGBVERTEX = D3DFVF_XYZRHW | D3DFVF_TEX1;