# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

draw_overlay.h
Go to the documentation of this file.
1 /* ***** BEGIN LICENSE BLOCK *****
2 *
3 * $Id: draw_overlay.h,v 1.6 2008/03/14 08:17:37 asuraparaju Exp $ $Name: Dirac_1_0_2 $
4 *
5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 *
7 * The contents of this file are subject to the Mozilla Public License
8 * Version 1.1 (the "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 * http://www.mozilla.org/MPL/
11 *
12 * Software distributed under the License is distributed on an "AS IS" basis,
13 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
14 * the specific language governing rights and limitations under the License.
15 *
16 * The Original Code is BBC Research and Development code.
17 *
18 * The Initial Developer of the Original Code is the British Broadcasting
19 * Corporation.
20 * Portions created by the Initial Developer are Copyright (C) 2004.
21 * All Rights Reserved.
22 *
23 * Contributor(s): Chris Bowley (Original Author)
24 *
25 * Alternatively, the contents of this file may be used under the terms of
26 * the GNU General Public License Version 2 (the "GPL"), or the GNU Lesser
27 * Public License Version 2.1 (the "LGPL"), in which case the provisions of
28 * the GPL or the LGPL are applicable instead of those above. If you wish to
29 * allow use of your version of this file only under the terms of the either
30 * the GPL or LGPL and not to allow others to use your version of this file
31 * under the MPL, indicate your decision by deleting the provisions above
32 * and replace them with the notice and other provisions required by the GPL
33 * or LGPL. If you do not delete the provisions above, a recipient may use
34 * your version of this file under the terms of any one of the MPL, the GPL
35 * or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
37
38 #ifndef _BLOCK_OVERLAY_H_
39 #define _BLOCK_OVERLAY_H_
40
41
42 #include <libdirac_common/motion.h>
43 #include <libdirac_common/picture.h>
44 using dirac::Picture;
45 using dirac::PicArray;
46 using dirac::MvArray;
47
48 #include <util/instrumentation/libdirac_instrument/overlay_symbols.h>
49
50 namespace dirac_instr
51 {
52 #define NO_REF -1
53
55 class DrawPictureMotionParams
56 {
57 public :
58
60 DrawPictureMotionParams() {}
61
63 ~DrawPictureMotionParams() {}
66 int MvYBlockY() const {return m_mv_Y_block_y;}
67
69 int MvYBlockX() const {return m_mv_Y_block_x;}
70
72 int MvUVBlockY() const {return m_mv_UV_block_y;}
73
75 int MvUVBlockX() const {return m_mv_UV_block_x;}
76
78 int ChromaFactorY() const {return m_chroma_factor_y;}
79
81 int ChromaFactorX() const {return m_chroma_factor_x;}
82
84 int PicY() const {return m_pic_y;}
85
87 int PicX() const {return m_pic_x;}
88
91 void SetMvYBlockY(int y) {m_mv_Y_block_y=y;}
92
94 void SetMvYBlockX(int x) {m_mv_Y_block_x=x;}
95
97 void SetMvUVBlockY(int y) {m_mv_UV_block_y=y;}
98
100 void SetMvUVBlockX(int x) {m_mv_UV_block_x=x;}
101
103 void SetChromaFactorY(int y) {m_chroma_factor_y=y;}
104
106 void SetChromaFactorX(int x) {m_chroma_factor_x=x;}
107
109 void SetPicY(int y) {m_pic_y=y;}
110
112 void SetPicX(int x) {m_pic_x=x;}
113
114 private :
115
117 int m_mv_Y_block_y, m_mv_Y_block_x;
118
120 int m_mv_UV_block_y, m_mv_UV_block_x;
121
123 int m_chroma_factor_y, m_chroma_factor_x;
124
126 int m_pic_y, m_pic_x;
127 };
128
130 /*
131 Base class for block overlay objects with pure
132 virtual functions to define sub-class interface
133 */
134 class DrawOverlay
135 {
136 public :
138 DrawOverlay(Picture &, DrawPictureMotionParams &);
139
141 virtual ~DrawOverlay();
142
144 virtual void DrawBlock(int, int)=0;
145
147 virtual void DrawLegend()=0;
148
150 // //
151 // Assumes default copy constructor and assignment = //
152 // //
154
156 void DrawReferenceNumbers(int, int);
157
159 void DrawReferenceNumber(int, int);
160
162 void DrawPictureNumber(int);
163
165 void DrawCharacter(const PicArray &, int, int);
166
168 const OverlaySymbols & Symbols() const {return m_symbols;}
169
170 protected :
171
172
174 void GetPowerUV(int, int &, int &);
175
177 void DrawPowerBar(int, int);
178
180 void DrawValue(int, int, int);
181
183 void DrawMvBlockUV(int, int, int, int);
184
186 void DrawBlockUV(int, int, int, int);
187
189 Picture & m_picture;
190
192 DrawPictureMotionParams & m_draw_params;
193
195 OverlaySymbols m_symbols;
196
197 private :
198
199 };
200
201 } // namespace dirac_instr
202
203 #endif

© 2004 British Broadcasting Corporation. Dirac code licensed under the Mozilla Public License (MPL) Version 1.1.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.