Minor fix.
[xy_vsfilter.git] / src / subtitles / CompositionObject.h
blobc9a6438c8c555ba0d677cd082879f827e1e21838
1 /*
2 * $Id: CompositionObject.h 3720 2011-09-12 00:30:00Z aleksoid $
4 * (C) 2006-2010 see AUTHORS
6 * This file is part of mplayerc.
8 * Mplayerc 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 3 of the License, or
11 * (at your option) any later version.
13 * Mplayerc 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 this program. If not, see <http://www.gnu.org/licenses/>.
24 #pragma once
26 #include "Rasterizer.h"
29 struct HDMV_PALETTE {
30 BYTE entry_id;
31 BYTE Y;
32 BYTE Cr;
33 BYTE Cb;
34 BYTE T; // HDMV rule : 0 transparent, 255 opaque (compatible DirectX)
37 class CGolombBuffer;
39 class CompositionObject : Rasterizer
41 public :
42 SHORT m_object_id_ref;
43 BYTE m_window_id_ref;
44 bool m_object_cropped_flag;
45 bool m_forced_on_flag;
46 BYTE m_version_number;
47 BYTE m_nObjectNumber;
49 SHORT m_horizontal_position;
50 SHORT m_vertical_position;
51 SHORT m_width;
52 SHORT m_height;
54 SHORT m_cropping_horizontal_position;
55 SHORT m_cropping_vertical_position;
56 SHORT m_cropping_width;
57 SHORT m_cropping_height;
59 REFERENCE_TIME m_rtStart;
60 REFERENCE_TIME m_rtStop;
62 CompositionObject();
63 ~CompositionObject();
65 void SetRLEData(BYTE* pBuffer, int nSize, int nTotalSize);
66 void AppendRLEData(BYTE* pBuffer, int nSize);
67 int GetRLEDataSize() {
68 return m_nRLEDataSize;
70 bool IsRLEComplete() {
71 return m_nRLEPos >= m_nRLEDataSize;
73 void RenderHdmv(SubPicDesc& spd);
74 void RenderDvb(SubPicDesc& spd, SHORT nX, SHORT nY);
75 void WriteSeg (SubPicDesc& spd, SHORT nX, SHORT nY, SHORT nCount, SHORT nPaletteIndex);
76 void InitColor(const SubPicDesc& spd);
77 void SetPalette (int nNbEntry, HDMV_PALETTE* pPalette, bool bIsHD);
78 void SetPalette (int nNbEntry, DWORD* dwColors);
79 bool HavePalette() {
80 return !m_Palette.IsEmpty();
83 private :
84 BYTE* m_pRLEData;
85 int m_nRLEDataSize;
86 int m_nRLEPos;
88 CAtlArray<HDMV_PALETTE> m_Palette;
89 enum ColorType
91 NONE,
92 YUV_Rec601,
93 YUV_Rec709,
94 RGB
96 ColorType m_OriginalColorType;
98 DWORD m_Colors[256];
99 int m_colorType;
101 void DvbRenderField(SubPicDesc& spd, CGolombBuffer& gb, SHORT nXStart, SHORT nYStart, SHORT nLength);
102 void Dvb2PixelsCodeString(SubPicDesc& spd, CGolombBuffer& gb, SHORT& nX, SHORT& nY);
103 void Dvb4PixelsCodeString(SubPicDesc& spd, CGolombBuffer& gb, SHORT& nX, SHORT& nY);
104 void Dvb8PixelsCodeString(SubPicDesc& spd, CGolombBuffer& gb, SHORT& nX, SHORT& nY);