Changeset 1313 in 3DVCSoftware for trunk/source/Lib/TLibRenderer/TRenImage.cpp
- Timestamp:
- 13 Aug 2015, 17:38:13 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibRenderer/TRenImage.cpp
r1179 r1313 37 37 #include "TRenFilter.h" 38 38 #include "assert.h" 39 #if H_3D39 #if NH_3D 40 40 41 41 42 42 template<typename T> 43 43 TRenImage<T>::TRenImage( TRenImage& rcIn ) 44 { 44 { 45 45 allocatePlanes( rcIn.getPlane(0)->getWidth(), rcIn.getPlane(0)->getHeight(), rcIn.getNumberOfFullPlanes(), rcIn.getNumberOfQuaterPlanes() ) ; assign(&rcIn); 46 46 } … … 48 48 template<typename T> 49 49 TRenImage<T>::TRenImage( UInt uiWidth, UInt uiHeight, UInt uiNumberOfFullPlanes, UInt uiNumberOfQuaterPlanes ) 50 { 50 { 51 51 allocatePlanes( uiWidth, uiHeight, uiNumberOfFullPlanes, uiNumberOfQuaterPlanes ); 52 52 } … … 55 55 TRenImage<T>::TRenImage() : m_uiNumberOfFullPlanes(0), m_uiNumberOfQuaterPlanes(0), m_uiNumberOfPlanes(0), m_apcPlanes(0) 56 56 { 57 57 58 58 } 59 59 … … 61 61 template<> 62 62 TRenImage<Pel>::TRenImage( TComPicYuv* pcPicYuv, Bool bFirstPlaneOnly ) 63 { 63 { 64 64 if (bFirstPlaneOnly) //400 65 65 { … … 68 68 m_uiNumberOfQuaterPlanes = 0; 69 69 m_apcPlanes = new TRenImagePlane<Pel>*[ m_uiNumberOfPlanes ]; 70 m_apcPlanes[0] = new TRenImagePlane<Pel>( pcPicYuv->getBuf Y(), pcPicYuv->getWidth() + (REN_LUMA_MARGIN << 1), pcPicYuv->getHeight()+ (REN_LUMA_MARGIN << 1), pcPicYuv->getStride (), REN_LUMA_MARGIN );70 m_apcPlanes[0] = new TRenImagePlane<Pel>( pcPicYuv->getBuf( COMPONENT_Y ), pcPicYuv->getWidth( COMPONENT_Y ) + (REN_LUMA_MARGIN << 1), pcPicYuv->getHeight( COMPONENT_Y ) + (REN_LUMA_MARGIN << 1), pcPicYuv->getStride( COMPONENT_Y ), REN_LUMA_MARGIN ); 71 71 } 72 72 else //420 … … 77 77 78 78 m_apcPlanes = new TRenImagePlane<Pel>*[ m_uiNumberOfPlanes ]; 79 m_apcPlanes[0] = new TRenImagePlane<Pel>( pcPicYuv->getBuf Y(), pcPicYuv->getWidth() + (REN_LUMA_MARGIN << 1), pcPicYuv->getHeight() + (REN_LUMA_MARGIN << 1), pcPicYuv->getStride (), REN_LUMA_MARGIN );80 m_apcPlanes[1] = new TRenImagePlane<Pel>( pcPicYuv->getBuf U(), (pcPicYuv->getWidth()>>1)+ REN_LUMA_MARGIN , (pcPicYuv->getHeight()>>1) + REN_LUMA_MARGIN , pcPicYuv->getCStride(), REN_LUMA_MARGIN >> 1 );81 m_apcPlanes[2] = new TRenImagePlane<Pel>( pcPicYuv->getBuf V(), (pcPicYuv->getWidth()>>1)+ REN_LUMA_MARGIN , (pcPicYuv->getHeight()>>1) + REN_LUMA_MARGIN , pcPicYuv->getCStride(), REN_LUMA_MARGIN >> 1 );79 m_apcPlanes[0] = new TRenImagePlane<Pel>( pcPicYuv->getBuf( COMPONENT_Y ), pcPicYuv->getWidth( COMPONENT_Y ) + (REN_LUMA_MARGIN << 1), pcPicYuv->getHeight( COMPONENT_Y ) + (REN_LUMA_MARGIN << 1), pcPicYuv->getStride( COMPONENT_Y ), REN_LUMA_MARGIN ); 80 m_apcPlanes[1] = new TRenImagePlane<Pel>( pcPicYuv->getBuf( COMPONENT_Cb ), pcPicYuv->getWidth( COMPONENT_Cb ) + REN_LUMA_MARGIN , pcPicYuv->getHeight( COMPONENT_Cb ) + REN_LUMA_MARGIN , pcPicYuv->getStride( COMPONENT_Cb), REN_LUMA_MARGIN >> 1 ); 81 m_apcPlanes[2] = new TRenImagePlane<Pel>( pcPicYuv->getBuf( COMPONENT_Cr ), pcPicYuv->getWidth( COMPONENT_Cr ) + REN_LUMA_MARGIN , pcPicYuv->getHeight( COMPONENT_Cr ) + REN_LUMA_MARGIN , pcPicYuv->getStride( COMPONENT_Cr), REN_LUMA_MARGIN >> 1 ); 82 82 } 83 83 } … … 109 109 110 110 template<typename T> 111 Void TRenImage<T>::getDataAndStrides( T** pptData, Int* piStrides ) 111 Void TRenImage<T>::getDataAndStrides( T** pptData, Int* piStrides ) const 112 112 { 113 113 for (UInt uiCurPlane = 0; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++ ) … … 120 120 121 121 template<typename T> 122 Void TRenImage<T>::getWidthAndHeight( Int* ppiWidths, Int* ppiHeights ) 122 Void TRenImage<T>::getWidthAndHeight( Int* ppiWidths, Int* ppiHeights ) const 123 123 { 124 124 for (UInt uiCurPlane = 0; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++ ) … … 233 233 for (UInt uiCurPlane = 1; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++) 234 234 { 235 m_apcPlanes[uiCurPlane]->assign( (Pel) ( 1 << ( g_bitDepthC - 1 ) ) ); 236 } 237 } 238 239 240 template<class T> 241 TRenImage<T>::~TRenImage() { 235 m_apcPlanes[uiCurPlane]->assign( (Pel) ( 1 << ( REN_BIT_DEPTH - 1 ) ) ); 236 } 237 } 238 239 240 template<class T> 241 TRenImage<T>::~TRenImage() 242 { 242 243 xDeletePlanes(); 243 244 delete[] m_apcPlanes; … … 272 273 template Void TRenImage<Pel>::assign<Pel> (TRenImage<Pel>* ); 273 274 274 #endif // H_3D275 #endif // NH_3D
Note: See TracChangeset for help on using the changeset viewer.