# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

picture.h
Go to the documentation of this file.
1/* ***** BEGIN LICENSE BLOCK *****
2*
3* $Id: picture.h,v 1.4 2008/08/14 00:51:08 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): Thomas Davies (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 _PICTURE_H_
39#define _PICTURE_H_
40
41#include <libdirac_common/common.h>
42#include <libdirac_common/wavelet_utils.h>
43
44 namespace dirac
45{
47
51 class Picture
52 {
53
54 public:
55
57
60 Picture( const PictureParams& pp );
61
63 Picture(const Picture& cpy);
64
66 virtual ~Picture();
67
69 Picture& operator=( const Picture& rhs );
70
72
75 void Fill(ValueType val );
76
77 //gets and sets
79 PictureParams& GetPparams() const {return m_pparams;}
80
82 void SetPictureSort( const PictureSort ps ){m_pparams.SetPicSort( ps ); }
83
85 void SetPictureType( const PictureType ftype ){m_pparams.SetPictureType( ftype ); }
86
88 void SetReferenceType( const ReferenceType rtype ){m_pparams.SetReferenceType( rtype ); }
89
91 void ReconfigPicture( const PictureParams &pp );
92
94 PicArray& Data(CompSort cs){return *m_pic_data[(int) cs];}
95
97 const PicArray& Data(CompSort cs) const{return *m_pic_data[(int) cs];}
98
100 PicArray& UpData(CompSort cs);
101
103 const PicArray& UpData(CompSort cs) const;
104
106 const CoeffArray& WltData( CompSort c ) const { return m_wlt_data[(int) c]; }
107
109 CoeffArray& WltData( CompSort c ) { return m_wlt_data[(int) c]; }
110
112 void InitWltData( const int transform_depth );
113
115
118 void Clip();
119
121
124 void ClipUpData();
125
126 protected:
127 mutable PictureParams m_pparams;
128 PicArray* m_pic_data[3];//the picture data
129 mutable PicArray* m_up_pic_data[3];//upconverted data. Mutable because we
130 //create them on the fly even in const
131 //functions.
132
133 CoeffArray m_wlt_data[3];// the wavelet coefficient data
134
136 virtual void Init();
137
139 virtual void ClearData();
140
142 void ClipComponent(PicArray& pic_data, CompSort cs) const;
143
144 };
145
146} // namespace dirac
147
148
149#endif
wavelet_utils.h
PictureType
PictureType
Definition: common_types.h:86
ReferenceType
ReferenceType
Definition: common_types.h:92
common.h
dirac
Definition of class SequenceHeaderByteIO.
Definition: accessunit_byteio.h:52
dirac::CompSort
CompSort
Types of picture component.
Definition: common.h:87
dirac::ValueType
short ValueType
Type of picture data (including motion compensated residuals)
Definition: common.h:70
dirac::PictureSort
Picture type Class.
Definition: common.h:229
dirac::PictureParams
Parameters for initialising picture class objects.
Definition: common.h:533
dirac::PictureParams::SetPicSort
void SetPicSort(const PictureSort &ps)
Sets the type of picture.
dirac::PictureParams::SetPictureType
void SetPictureType(const PictureType ftype)
Sets the picture to be Intra/Inter.
dirac::PictureParams::SetReferenceType
void SetReferenceType(const ReferenceType rtype)
Sets the picture to be a reference or not.
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::Picture::UpData
const PicArray & UpData(CompSort cs) const
Returns a given upconverted component.
dirac::Picture::UpData
PicArray & UpData(CompSort cs)
Returns a given upconverted component.
dirac::Picture::Fill
void Fill(ValueType val)
Picture Fill.
dirac::Picture::Data
PicArray & Data(CompSort cs)
Returns a given component.
Definition: picture.h:94
dirac::Picture::SetPictureSort
void SetPictureSort(const PictureSort ps)
Sets the picture sort.
Definition: picture.h:82
dirac::Picture::Data
const PicArray & Data(CompSort cs) const
Returns a given component.
Definition: picture.h:97
dirac::Picture::InitWltData
void InitWltData(const int transform_depth)
Initialises the wavelet coefficient data arrays;.
dirac::Picture::SetPictureType
void SetPictureType(const PictureType ftype)
Sets the picture type.
Definition: picture.h:85
dirac::Picture::WltData
const CoeffArray & WltData(CompSort c) const
Returns the wavelet coefficient data.
Definition: picture.h:106
dirac::Picture::ClipComponent
void ClipComponent(PicArray &pic_data, CompSort cs) const
Clip an individual component.
dirac::Picture::m_up_pic_data
PicArray * m_up_pic_data[3]
Definition: picture.h:129
dirac::Picture::ClearData
virtual void ClearData()
Delete all the data.
dirac::Picture::ClipUpData
void ClipUpData()
Clip the upconverted data to prevent overshoot.
dirac::Picture::SetReferenceType
void SetReferenceType(const ReferenceType rtype)
Sets the picture type.
Definition: picture.h:88
dirac::Picture::Picture
Picture(const PictureParams &pp)
Constructor.
dirac::Picture::GetPparams
PictureParams & GetPparams() const
Gets the picture parameters.
Definition: picture.h:79
dirac::Picture::m_pparams
PictureParams m_pparams
Definition: picture.h:127
dirac::Picture::Picture
Picture(const Picture &cpy)
Copy constructor. Private as not currently used [may want to implement reference counting later....
dirac::Picture::Init
virtual void Init()
Initialises the picture once the picture parameters have been set.
dirac::Picture::WltData
CoeffArray & WltData(CompSort c)
Returns the wavelet coefficient data.
Definition: picture.h:109
dirac::Picture::operator=
Picture & operator=(const Picture &rhs)
Assignment =. Private as not currently used [may want to implement reference counting later....
dirac::Picture::m_wlt_data
CoeffArray m_wlt_data[3]
Definition: picture.h:133
dirac::Picture::ReconfigPicture
void ReconfigPicture(const PictureParams &pp)
Reconfigures to the new parameters.
dirac::Picture::~Picture
virtual ~Picture()
Destructor.
dirac::Picture::Clip
void Clip()
Clip the data to prevent overshoot.
dirac::Picture::m_pic_data
PicArray * m_pic_data[3]
Definition: picture.h:128
dirac::CoeffArray
A class for wavelet coefficient data.
Definition: wavelet_utils.h:623

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