# 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
picture.h
motion.h
overlay_symbols.h
dirac::MvArray
TwoDArray< MVector > MvArray
MvArray is a two-D array of MVectors.
Definition: motion.h:186
dirac_instr
Definition: draw_overlay.h:51
dirac::PicArray
A class for picture component data.
Definition: common.h:719
dirac::Picture
A class for encapsulating all the data relating to a picture.
Definition: picture.h:52
dirac_instr::DrawPictureMotionParams
Class encapsulating parameters for drawing the picture.
Definition: draw_overlay.h:56
dirac_instr::DrawPictureMotionParams::m_mv_UV_block_y
int m_mv_UV_block_y
Motion vector block dimensions - chroma.
Definition: draw_overlay.h:120
dirac_instr::DrawPictureMotionParams::m_pic_y
int m_pic_y
Original picture dimensions.
Definition: draw_overlay.h:126
dirac_instr::DrawPictureMotionParams::PicX
int PicX() const
Returns original picture width.
Definition: draw_overlay.h:87
dirac_instr::DrawPictureMotionParams::SetChromaFactorY
void SetChromaFactorY(int y)
Set chroma - luma vertical sample ratio.
Definition: draw_overlay.h:103
dirac_instr::DrawPictureMotionParams::m_chroma_factor_y
int m_chroma_factor_y
Chroma - luma sample ratio.
Definition: draw_overlay.h:123
dirac_instr::DrawPictureMotionParams::SetMvYBlockX
void SetMvYBlockX(int x)
Set luma motion vector block width.
Definition: draw_overlay.h:94
dirac_instr::DrawPictureMotionParams::MvUVBlockY
int MvUVBlockY() const
Returns chroma motion vector height.
Definition: draw_overlay.h:72
dirac_instr::DrawPictureMotionParams::~DrawPictureMotionParams
~DrawPictureMotionParams()
Default destructor, does nothing.
Definition: draw_overlay.h:63
dirac_instr::DrawPictureMotionParams::ChromaFactorY
int ChromaFactorY() const
Returns chroma - luma vertical smaple ratio.
Definition: draw_overlay.h:78
dirac_instr::DrawPictureMotionParams::DrawPictureMotionParams
DrawPictureMotionParams()
Default constuctor, does nothing.
Definition: draw_overlay.h:60
dirac_instr::DrawPictureMotionParams::MvYBlockY
int MvYBlockY() const
Gets... Returns luma motion vector block height.
Definition: draw_overlay.h:66
dirac_instr::DrawPictureMotionParams::SetPicX
void SetPicX(int x)
Set original picture width.
Definition: draw_overlay.h:112
dirac_instr::DrawPictureMotionParams::m_mv_UV_block_x
int m_mv_UV_block_x
Definition: draw_overlay.h:120
dirac_instr::DrawPictureMotionParams::SetMvUVBlockY
void SetMvUVBlockY(int y)
Set chroma motion vector block height.
Definition: draw_overlay.h:97
dirac_instr::DrawPictureMotionParams::m_mv_Y_block_y
int m_mv_Y_block_y
Motion vector block dimensions - luma.
Definition: draw_overlay.h:117
dirac_instr::DrawPictureMotionParams::m_chroma_factor_x
int m_chroma_factor_x
Definition: draw_overlay.h:123
dirac_instr::DrawPictureMotionParams::ChromaFactorX
int ChromaFactorX() const
Returns chroma - luma horizontal sample ratio.
Definition: draw_overlay.h:81
dirac_instr::DrawPictureMotionParams::m_mv_Y_block_x
int m_mv_Y_block_x
Definition: draw_overlay.h:117
dirac_instr::DrawPictureMotionParams::SetMvYBlockY
void SetMvYBlockY(int y)
Sets... Set luma motion vector block height
Definition: draw_overlay.h:91
dirac_instr::DrawPictureMotionParams::SetChromaFactorX
void SetChromaFactorX(int x)
Set chroma - luma horizontal sample ratio.
Definition: draw_overlay.h:106
dirac_instr::DrawPictureMotionParams::PicY
int PicY() const
Returns original picture height.
Definition: draw_overlay.h:84
dirac_instr::DrawPictureMotionParams::MvUVBlockX
int MvUVBlockX() const
Returns chroma motion vector width.
Definition: draw_overlay.h:75
dirac_instr::DrawPictureMotionParams::m_pic_x
int m_pic_x
Definition: draw_overlay.h:126
dirac_instr::DrawPictureMotionParams::MvYBlockX
int MvYBlockX() const
Returns luma motion vector block width.
Definition: draw_overlay.h:69
dirac_instr::DrawPictureMotionParams::SetPicY
void SetPicY(int y)
Set original picture height.
Definition: draw_overlay.h:109
dirac_instr::DrawPictureMotionParams::SetMvUVBlockX
void SetMvUVBlockX(int x)
Set chroma motion vector block width.
Definition: draw_overlay.h:100
dirac_instr::DrawOverlay
Base class for block overlay objects.
Definition: draw_overlay.h:135
dirac_instr::DrawOverlay::DrawBlock
virtual void DrawBlock(int, int)=0
Carries out overlay for single block.
dirac_instr::DrawOverlay::DrawMvBlockUV
void DrawMvBlockUV(int, int, int, int)
Colours motion vector block referenced by motion vector.
dirac_instr::DrawOverlay::m_symbols
OverlaySymbols m_symbols
Symbols.
Definition: draw_overlay.h:195
dirac_instr::DrawOverlay::DrawPowerBar
void DrawPowerBar(int, int)
Draws power bar legend with given limits.
dirac_instr::DrawOverlay::DrawCharacter
void DrawCharacter(const PicArray &, int, int)
Draws a character / number / symbol.
dirac_instr::DrawOverlay::DrawValue
void DrawValue(int, int, int)
Draws value.
dirac_instr::DrawOverlay::m_picture
Picture & m_picture
Picture data.
Definition: draw_overlay.h:189
dirac_instr::DrawOverlay::DrawPictureNumber
void DrawPictureNumber(int)
Draws current picture number.
dirac_instr::DrawOverlay::DrawLegend
virtual void DrawLegend()=0
Draws overlay legend.
dirac_instr::DrawOverlay::DrawReferenceNumber
void DrawReferenceNumber(int, int)
Draws picture number for chosen reference.
dirac_instr::DrawOverlay::DrawBlockUV
void DrawBlockUV(int, int, int, int)
Colours an 8x8 block referenced by TL chroma pixel.
dirac_instr::DrawOverlay::Symbols
const OverlaySymbols & Symbols() const
Returns reference to symbols object.
Definition: draw_overlay.h:168
dirac_instr::DrawOverlay::DrawReferenceNumbers
void DrawReferenceNumbers(int, int)
Draws picture numbers for both references.
dirac_instr::DrawOverlay::~DrawOverlay
virtual ~DrawOverlay()
Destructor.
dirac_instr::DrawOverlay::GetPowerUV
void GetPowerUV(int, int &, int &)
Calculates U and V for particular value normalised to 1000.
dirac_instr::DrawOverlay::DrawOverlay
DrawOverlay(Picture &, DrawPictureMotionParams &)
Constructor.
dirac_instr::DrawOverlay::m_draw_params
DrawPictureMotionParams & m_draw_params
Block parameters and chroma scaling.
Definition: draw_overlay.h:192
dirac_instr::OverlaySymbols
Definition: overlay_symbols.h:47

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