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>
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:
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

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