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