1 | |
---|
2 | |
---|
3 | |
---|
4 | |
---|
5 | #ifndef __TRENIMAGE__ |
---|
6 | #define __TRENIMAGE__ |
---|
7 | |
---|
8 | #include "../TLibCommon/CommonDef.h" |
---|
9 | #include "../TLibCommon/TComPicYuv.h" |
---|
10 | #include "TRenImagePlane.h" |
---|
11 | |
---|
12 | |
---|
13 | #define PelImage TRenImage<Pel> |
---|
14 | #define DoubleImage TRenImage<Double> |
---|
15 | #define IntImage TRenImage<Int> |
---|
16 | |
---|
17 | |
---|
18 | template<typename T> |
---|
19 | class TRenImage |
---|
20 | { |
---|
21 | public: |
---|
22 | |
---|
23 | // Construction |
---|
24 | TRenImage( TRenImage& rcInputImage ); |
---|
25 | TRenImage(); |
---|
26 | // TRenImage( TRenImagePlane<T>** ppcYPlanes, UInt uiNumberOfFullPlanes, UInt uiNumberOfQuaterPlanes ); |
---|
27 | |
---|
28 | TRenImage( UInt uiWidth, UInt uiHeight, UInt uiNumPlanes, UInt uiNumQPlanes ); |
---|
29 | TRenImage( TComPicYuv* pcPicYuvIn, Bool bFirstPlaneOnly = false ); |
---|
30 | |
---|
31 | Void allocatePlanes(UInt uiWidth, UInt uiHeight, UInt uiNumFullPlanes, UInt uiNumQuaterPlanes); |
---|
32 | ~TRenImage(); |
---|
33 | |
---|
34 | TRenImage* create(); |
---|
35 | Void init(); |
---|
36 | |
---|
37 | // Get Planes and data |
---|
38 | TRenImagePlane<T>* getPlane(UInt uiPlaneNumber) const; |
---|
39 | TRenImagePlane<T>** getPlanes() const; |
---|
40 | |
---|
41 | UInt getNumberOfPlanes() const; |
---|
42 | UInt getNumberOfQuaterPlanes() const; |
---|
43 | UInt getNumberOfFullPlanes() const; |
---|
44 | Bool is420() {return m_uiNumberOfFullPlanes == 1 && m_uiNumberOfQuaterPlanes == 2; }; |
---|
45 | Bool is444() {return m_uiNumberOfFullPlanes == 3 && m_uiNumberOfQuaterPlanes == 0; }; |
---|
46 | Bool is400() {return m_uiNumberOfFullPlanes == 1 && m_uiNumberOfQuaterPlanes == 0; }; |
---|
47 | |
---|
48 | // Assign |
---|
49 | Void assign(Int iVal); |
---|
50 | template<typename S> Void assign(TRenImage<S>* pcSrcImage); |
---|
51 | Void setData( TRenImage* pcInputImage, Bool bClean ); |
---|
52 | |
---|
53 | Void extendMargin(); |
---|
54 | // Operators |
---|
55 | Void devide( Double dDevisor ); |
---|
56 | |
---|
57 | |
---|
58 | private: |
---|
59 | |
---|
60 | UInt m_uiNumberOfFullPlanes; |
---|
61 | UInt m_uiNumberOfQuaterPlanes; |
---|
62 | UInt m_uiNumberOfPlanes; |
---|
63 | TRenImagePlane<T> ** m_apcPlanes; // First Full Planes, then Quater Planes |
---|
64 | |
---|
65 | Void xDeletePlanes(); |
---|
66 | }; |
---|
67 | |
---|
68 | |
---|
69 | |
---|
70 | |
---|
71 | |
---|
72 | #endif // __TRENIMAGE__ |
---|
73 | |
---|
74 | |
---|