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>
44 using dirac::Picture;
45 using dirac::PicArray;
46 using dirac::MvArray;
47 
49 
50 namespace dirac_instr
51 {
52 #define NO_REF -1
53 
56  {
57  public :
58 
61 
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 
101 
104 
107 
109  void SetPicY(int y) {m_pic_y=y;}
110 
112  void SetPicX(int x) {m_pic_x=x;}
113 
114  private :
115 
118 
121 
124 
127  };
128 
130  /*
131  Base class for block overlay objects with pure
132  virtual functions to define sub-class interface
133  */
135  {
136  public :
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 
190 
193 
196 
197  private :
198 
199  };
200 
201 } // namespace dirac_instr
202 
203 #endif
int m_chroma_factor_x
Definition: draw_overlay.h:123
int MvUVBlockX() const
Returns chroma motion vector width.
Definition: draw_overlay.h:75
DrawPictureMotionParams & m_draw_params
Block parameters and chroma scaling.
Definition: draw_overlay.h:192
const OverlaySymbols & Symbols() const
Returns reference to symbols object.
Definition: draw_overlay.h:168
int m_mv_UV_block_x
Definition: draw_overlay.h:120
int MvYBlockY() const
Gets...
Definition: draw_overlay.h:66
void GetPowerUV(int, int &, int &)
Calculates U and V for particular value normalised to 1000.
Picture & m_picture
Picture data.
Definition: draw_overlay.h:189
void SetPicY(int y)
Set original picture height.
Definition: draw_overlay.h:109
void SetPicX(int x)
Set original picture width.
Definition: draw_overlay.h:112
Definition: overlay_symbols.h:46
Class encapsulating parameters for drawing the picture.
Definition: draw_overlay.h:55
TwoDArray< MVector > MvArray
MvArray is a two-D array of MVectors.
Definition: motion.h:186
int ChromaFactorX() const
Returns chroma - luma horizontal sample ratio.
Definition: draw_overlay.h:81
~DrawPictureMotionParams()
Default destructor, does nothing.
Definition: draw_overlay.h:63
virtual ~DrawOverlay()
Destructor.
OverlaySymbols m_symbols
Symbols.
Definition: draw_overlay.h:195
A class for picture component data.
Definition: common.h:718
int m_chroma_factor_y
Chroma - luma sample ratio.
Definition: draw_overlay.h:123
int m_mv_UV_block_y
Motion vector block dimensions - chroma.
Definition: draw_overlay.h:120
void DrawValue(int, int, int)
Draws value.
void SetMvYBlockY(int y)
Sets...
Definition: draw_overlay.h:91
int m_pic_y
Original picture dimensions.
Definition: draw_overlay.h:126
int m_mv_Y_block_y
Motion vector block dimensions - luma.
Definition: draw_overlay.h:117
int PicY() const
Returns original picture height.
Definition: draw_overlay.h:84
int ChromaFactorY() const
Returns chroma - luma vertical smaple ratio.
Definition: draw_overlay.h:78
int PicX() const
Returns original picture width.
Definition: draw_overlay.h:87
Base class for block overlay objects.
Definition: draw_overlay.h:134
void DrawMvBlockUV(int, int, int, int)
Colours motion vector block referenced by motion vector.
void SetMvYBlockX(int x)
Set luma motion vector block width.
Definition: draw_overlay.h:94
void DrawPictureNumber(int)
Draws current picture number.
void DrawCharacter(const PicArray &, int, int)
Draws a character / number / symbol.
DrawOverlay(Picture &, DrawPictureMotionParams &)
Constructor.
virtual void DrawBlock(int, int)=0
Carries out overlay for single block.
void SetChromaFactorX(int x)
Set chroma - luma horizontal sample ratio.
Definition: draw_overlay.h:106
void DrawReferenceNumber(int, int)
Draws picture number for chosen reference.
DrawPictureMotionParams()
Default constuctor, does nothing.
Definition: draw_overlay.h:60
int MvYBlockX() const
Returns luma motion vector block width.
Definition: draw_overlay.h:69
void DrawBlockUV(int, int, int, int)
Colours an 8x8 block referenced by TL chroma pixel.
void DrawPowerBar(int, int)
Draws power bar legend with given limits.
int MvUVBlockY() const
Returns chroma motion vector height.
Definition: draw_overlay.h:72
int m_pic_x
Definition: draw_overlay.h:126
void SetMvUVBlockX(int x)
Set chroma motion vector block width.
Definition: draw_overlay.h:100
void SetChromaFactorY(int y)
Set chroma - luma vertical sample ratio.
Definition: draw_overlay.h:103
void DrawReferenceNumbers(int, int)
Draws picture numbers for both references.
void SetMvUVBlockY(int y)
Set chroma motion vector block height.
Definition: draw_overlay.h:97
virtual void DrawLegend()=0
Draws overlay legend.
int m_mv_Y_block_x
Definition: draw_overlay.h:117
A class for encapsulating all the data relating to a picture.
Definition: picture.h:51

© 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.