|
1 /* |
|
2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: YUV format transcoder. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef TVTYUVCONVERTER_H |
|
20 #define TVTYUVCONVERTER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 /** |
|
25 * Yuv format transcoder. |
|
26 * |
|
27 * Implements conversion between different YUV formats. |
|
28 * |
|
29 * @lib VTImageConverter.lib |
|
30 * @since S60 v3.1 |
|
31 */ |
|
32 NONSHARABLE_CLASS( VtYuvConverter ) |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Converts from 4:2:0 planar source image to 4:2:2 interleaved image. |
|
38 * |
|
39 * @since S60 v3.1 |
|
40 * @param aSource Constant descriptor containing source image data. |
|
41 * @param aSize Size of the image in pixels. |
|
42 * @param aTarget Modifiable descriptor for target image data. |
|
43 * @param aStide Number of bytes per scanline in target buffer. |
|
44 * @return KErrNone if conversion was successful, KErrUnderflow if result |
|
45 * does not fit in target buffer or KErrArgument if source buffer's size |
|
46 * does not match with the given source size in pixels. |
|
47 */ |
|
48 static TInt ConvertFrom420PlanarTo422Interleaved( |
|
49 const TDesC8& aSource, |
|
50 const TSize& aSize, |
|
51 TDes8& aTarget, |
|
52 TInt aStride ); |
|
53 |
|
54 private: |
|
55 |
|
56 /** |
|
57 * Constructor. |
|
58 */ |
|
59 VtYuvConverter(); |
|
60 |
|
61 /** |
|
62 * Copy constructor. |
|
63 */ |
|
64 VtYuvConverter( const VtYuvConverter& ); |
|
65 |
|
66 /** |
|
67 * Returns image size in bytes for 420 planar image that has given pixel |
|
68 * size. |
|
69 */ |
|
70 static TInt ByteSize420Planar( const TSize& aSizeInPixels ); |
|
71 |
|
72 /** |
|
73 * Returns image size in bytes for 422 interleaved image that has given |
|
74 * pixel size. |
|
75 */ |
|
76 static TInt ByteSize422Interleaved( const TSize& aSizeInPixels ); |
|
77 }; |
|
78 |
|
79 #endif // TVTYUVCONVERTER_H |