[5] | 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 | */ |
---|
[2] | 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 | |
---|
| 45 | template<typename T> |
---|
| 46 | class TRenImagePlane |
---|
| 47 | { |
---|
| 48 | public: |
---|
| 49 | // Construction |
---|
| 50 | TRenImagePlane(); |
---|
| 51 | TRenImagePlane( UInt uiWidth, UInt uiHeight, UInt uiPad); |
---|
| 52 | TRenImagePlane( TRenImagePlane* pcInputPlane ); |
---|
| 53 | TRenImagePlane( T* pcDataOrg, UInt uiWidthOrg, UInt uiHeightOrg, UInt uiStride, UInt uiPad ); |
---|
| 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 getStride () { return m_uiStride; }; |
---|
| 67 | |
---|
[56] | 68 | Void setData ( T* pDataOrg, UInt uiWidthOrg, UInt uiHeightOrg, UInt uiStride, UInt uiPad, Bool bClean /*= false*/ ); |
---|
| 69 | |
---|
[2] | 70 | Void setData ( TRenImagePlane<T>* pcInPlane, Bool bClean ); |
---|
| 71 | Void setClean( Bool bClean ); |
---|
| 72 | Void extendMargin(); |
---|
| 73 | |
---|
| 74 | // Assignment |
---|
| 75 | Void assign( Pel* data, UInt uiSourceStride ); |
---|
| 76 | Void assign( Pel data ); |
---|
| 77 | |
---|
| 78 | Void assign( Double* data, UInt uiSourceStride ); |
---|
| 79 | Void assign( Double data ); |
---|
| 80 | |
---|
| 81 | Void assign( Bool* data, UInt uiSourceStride ); |
---|
| 82 | Void assign( Bool data ); |
---|
| 83 | |
---|
| 84 | Void assign( Int* data, UInt uiSourceStride ); |
---|
| 85 | Void assign( Int data ); |
---|
| 86 | |
---|
| 87 | Void assign( TRenImagePlane<T>* pcPlane); |
---|
| 88 | |
---|
| 89 | Void assign( T data , UInt uRow, UInt uStartOffset, UInt uEndOffset); |
---|
| 90 | Void assign( TRenImagePlane<T>* pcPlane, UInt uRow, UInt uStartOffset, UInt uEndOffset); |
---|
| 91 | Void assign( TRenImagePlane<T>* pcSourcePlane, UInt uSourceRowStart, UInt uSourceColStart, UInt uWidth, UInt uHeight); |
---|
| 92 | |
---|
| 93 | // Operators |
---|
| 94 | Void devide( Double dDevisor ); |
---|
| 95 | Void multiply( Double dMultiplier ); |
---|
| 96 | |
---|
| 97 | protected: |
---|
| 98 | T *m_pcData; |
---|
| 99 | UInt m_uiWidth; |
---|
| 100 | UInt m_uiHeight; |
---|
| 101 | UInt m_uiStride; |
---|
| 102 | |
---|
| 103 | T *m_pcDataOrg; |
---|
| 104 | UInt m_uiWidthOrg; |
---|
| 105 | UInt m_uiHeightOrg; |
---|
| 106 | UInt m_uiPad; |
---|
| 107 | |
---|
| 108 | Double m_dRatio; |
---|
| 109 | Bool m_bClean; |
---|
| 110 | |
---|
| 111 | private: |
---|
| 112 | Void deleteData(); |
---|
| 113 | }; |
---|
| 114 | |
---|
| 115 | template<typename T> |
---|
| 116 | class TRenImagePlanePart : public TRenImagePlane< T > |
---|
| 117 | { |
---|
| 118 | public: |
---|
| 119 | TRenImagePlanePart( TRenImagePlane<T>* pcPlane, UInt uHorOff, UInt uVerOff, UInt uWidth, UInt uHeight);; |
---|
| 120 | ~TRenImagePlanePart();; |
---|
| 121 | }; |
---|
| 122 | |
---|
| 123 | #endif // __TRENIMAGEPLANE__ |
---|