source: 3DVCSoftware/branches/HTM-DEV-0.2-dev/source/Lib/TLibRenderer/TRenImagePlane.h @ 438

Last change on this file since 438 was 438, checked in by tech, 12 years ago

Integrated 3D encoder control, camera parameters, renderer and MV fixes.

  • Property svn:eol-style set to native
File size: 4.3 KB
Line 
1/* The copyright in this software is being made available under the BSD
2 * License, included below. This software may be subject to other third party
3 * and contributor rights, including patent rights, and no such rights are
4 * granted under this license.
5 *
6 * Copyright (c) 2010-2011, ISO/IEC
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 *  * Redistributions of source code must retain the above copyright notice,
13 *    this list of conditions and the following disclaimer.
14 *  * Redistributions in binary form must reproduce the above copyright notice,
15 *    this list of conditions and the following disclaimer in the documentation
16 *    and/or other materials provided with the distribution.
17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
18 *    be used to endorse or promote products derived from this software without
19 *    specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34
35#ifndef __TRENIMAGEPLANE__
36#define __TRENIMAGEPLANE__
37
38#include "../TLibCommon/CommonDef.h"
39#include "../TLibCommon/TComPicYuv.h"
40
41#define PelImagePlane     TRenImagePlane<Pel>
42#define DoubleImagePlane  TRenImagePlane<Double>
43#define IntImagePlane     TRenImagePlane<Int>
44
45template<typename T>
46class TRenImagePlane
47{
48public:
49  // Construction
50  TRenImagePlane();
51  TRenImagePlane( UInt uiWidth, UInt uiHeight, UInt uiPad, UInt uiBitDepth );
52  TRenImagePlane( TRenImagePlane* pcInputPlane );
53  TRenImagePlane( T* pcDataOrg, UInt uiWidthOrg, UInt uiHeightOrg, UInt uiStride, UInt uiPad, UInt uiBitDepth  );
54
55  ~TRenImagePlane();
56
57  // Get Data
58  T*   getPlaneData();
59  UInt getWidth    () { return m_uiWidth; };
60  UInt getHeight   () { return m_uiHeight; };
61
62  T*   getPlaneDataOrg();
63  UInt getWidthOrg () { return m_uiWidthOrg;  };
64  UInt getHeightOrg() { return m_uiHeightOrg; };
65  UInt getPad      () { return m_uiPad;       };
66  UInt getBitDepth () { return m_uiBitDepth; };
67  UInt getStride   () { return m_uiStride; };
68
69  Void setData ( T* pDataOrg, UInt uiWidthOrg, UInt uiHeightOrg, UInt uiStride, UInt uiPad, Bool bClean /*= false*/ ); 
70 
71  Void setData ( TRenImagePlane<T>* pcInPlane, Bool bClean );
72  Void setClean( Bool bClean );
73  Void extendMargin();
74
75  // Assignment
76  Void assign( Pel*    data, UInt uiSourceStride );
77  Void assign( Pel     data );
78
79  Void assign( Double* data, UInt uiSourceStride );
80  Void assign( Double  data );
81
82  Void assign( Bool*  data, UInt uiSourceStride );
83  Void assign( Bool   data );
84
85  Void assign( Int*   data, UInt uiSourceStride );
86  Void assign( Int    data );
87
88  Void assign( TRenImagePlane<T>* pcPlane);
89
90  Void assign( T data , UInt uRow, UInt uStartOffset, UInt uEndOffset);
91  Void assign( TRenImagePlane<T>* pcPlane, UInt uRow, UInt uStartOffset, UInt uEndOffset);
92  Void assign( TRenImagePlane<T>* pcSourcePlane, UInt uSourceRowStart, UInt uSourceColStart, UInt uWidth, UInt uHeight);
93
94  // Operators
95  Void devide(   Double dDevisor );
96  Void multiply( Double dMultiplier );
97
98protected:
99  T     *m_pcData;
100  UInt   m_uiWidth;
101  UInt   m_uiHeight;
102  UInt   m_uiStride;
103
104  T     *m_pcDataOrg;
105  UInt   m_uiWidthOrg;
106  UInt   m_uiHeightOrg;
107  UInt   m_uiPad;
108  UInt   m_uiBitDepth; 
109
110  Bool   m_bClean;
111
112private:
113  Void deleteData();
114};
115
116template<typename T>
117class TRenImagePlanePart : public TRenImagePlane< T >
118{
119public:
120  TRenImagePlanePart( TRenImagePlane<T>* pcPlane, UInt uHorOff, UInt uVerOff, UInt uWidth, UInt uHeight);;
121  ~TRenImagePlanePart();;
122};
123
124#endif // __TRENIMAGEPLANE__
Note: See TracBrowser for help on using the repository browser.