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-2015, ITU/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 | #if NH_3D |
---|
42 | #define PelImagePlane TRenImagePlane<Pel> |
---|
43 | #define DoubleImagePlane TRenImagePlane<Double> |
---|
44 | #define IntImagePlane TRenImagePlane<Int> |
---|
45 | |
---|
46 | template<typename T> |
---|
47 | class TRenImagePlane |
---|
48 | { |
---|
49 | public: |
---|
50 | // Construction |
---|
51 | TRenImagePlane(); |
---|
52 | TRenImagePlane( UInt uiWidth, UInt uiHeight, UInt uiPad); |
---|
53 | TRenImagePlane( TRenImagePlane* pcInputPlane ); |
---|
54 | TRenImagePlane( T* pcDataOrg, UInt uiWidthOrg, UInt uiHeightOrg, UInt uiStride, UInt uiPad ); |
---|
55 | |
---|
56 | ~TRenImagePlane(); |
---|
57 | |
---|
58 | // Get Data |
---|
59 | T* getPlaneData(); |
---|
60 | UInt getWidth () { return m_uiWidth; }; |
---|
61 | UInt getHeight () { return m_uiHeight; }; |
---|
62 | |
---|
63 | T* getPlaneDataOrg(); |
---|
64 | UInt getWidthOrg () { return m_uiWidthOrg; }; |
---|
65 | UInt getHeightOrg() { return m_uiHeightOrg; }; |
---|
66 | UInt getPad () { return m_uiPad; }; |
---|
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 | |
---|
98 | protected: |
---|
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 | |
---|
109 | Double m_dRatio; |
---|
110 | Bool m_bClean; |
---|
111 | |
---|
112 | private: |
---|
113 | Void deleteData(); |
---|
114 | }; |
---|
115 | |
---|
116 | template<typename T> |
---|
117 | class TRenImagePlanePart : public TRenImagePlane< T > |
---|
118 | { |
---|
119 | public: |
---|
120 | TRenImagePlanePart( TRenImagePlane<T>* pcPlane, UInt uHorOff, UInt uVerOff, UInt uWidth, UInt uHeight);; |
---|
121 | ~TRenImagePlanePart();; |
---|
122 | }; |
---|
123 | |
---|
124 | #endif // NH_3D |
---|
125 | #endif // __TRENIMAGEPLANE__ |
---|