[cosmetics] update date in GPL header
[vuplus_xbmc] / xbmc / cores / VideoRenderers / legacy / RGBRendererV2.h
1 #ifndef RGBV2_RENDERER
2 #define RGBV2_RENDERER
3
4 /*
5  *      Copyright (C) 2005-2013 Team XBMC
6  *      http://www.xbmc.org
7  *
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)
11  *  any later version.
12  *
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.
17  *
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/>.
21  *
22  */
23
24 #include "XBoxRenderer.h"
25
26 class CRGBRendererV2 : public CXBoxRenderer
27 {
28 public:
29   CRGBRendererV2(LPDIRECT3DDEVICE8 pDevice);
30   //~CRGBRendererV2();
31
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);
38
39 protected:
40   virtual void Render(DWORD flags);
41   virtual void ManageTextures();
42
43   bool Create444PTexture(bool full, bool field);
44   void Delete444PTexture();
45   void Clear444PTexture(bool full, bool field);
46
47   bool CreateLookupTextures(const YUVCOEF &coef, const YUVRANGE &range);
48   void DeleteLookupTextures();
49
50   void InterleaveYUVto444P(
51       YUVPLANES          pSources,
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);
58
59   void RenderYUVtoRGB(
60       D3DBaseTexture* pSource,
61       RECT &source, RECT &target,
62       float offset_x, float offset_y);
63
64   // YUV interleaved texture
65   LPDIRECT3DTEXTURE8 m_444PTextureFull;
66   LPDIRECT3DTEXTURE8 m_444PTextureField;
67
68   bool m_444GeneratedFull;
69   int m_444RenderBuffer;
70
71
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;
78
79
80   // Pixel shaders
81   DWORD m_hInterleavingShader;
82   DWORD m_hInterleavingShaderAlpha;
83   DWORD m_hYUVtoRGBLookup;
84
85   BYTE m_motionpass;
86
87   // Vertex types
88   static const DWORD FVF_YUVRGBVERTEX = D3DFVF_XYZRHW | D3DFVF_TEX4;
89   static const DWORD FVF_RGBVERTEX = D3DFVF_XYZRHW | D3DFVF_TEX1;
90 };
91
92 #endif