|
1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __MJPEGLOAD_H__ |
|
21 #define __MJPEGLOAD_H__ |
|
22 |
|
23 #include <e32base.h> |
|
24 #include "TBitmapHandle.h" |
|
25 |
|
26 |
|
27 class TJpegData |
|
28 { |
|
29 public: |
|
30 TSize iSize; |
|
31 TSize iBlockSize; |
|
32 TSize iSizeInBlocks; |
|
33 }; |
|
34 |
|
35 |
|
36 |
|
37 /// Jpeg scale factor, used by SetScale() |
|
38 /// scales are 1:1, 1:2, 1:4 and 1:8 |
|
39 enum TJpegScale |
|
40 { |
|
41 EScale1 = 0, |
|
42 EScale2 = 1, |
|
43 EScale4 = 2, |
|
44 EScale8 = 3 |
|
45 }; |
|
46 |
|
47 |
|
48 /// Jpeg loader interface |
|
49 class MJpegLoad |
|
50 { |
|
51 public: |
|
52 virtual ~MJpegLoad() {} |
|
53 |
|
54 /// Opens jpeg file for decoding |
|
55 /// @param aFile full filename of jpeg |
|
56 virtual void OpenL( const TFileName& aFile ) = 0; |
|
57 |
|
58 /// Opens jpeg file for decoding |
|
59 /// @param aData descriptor of jpeg file data |
|
60 virtual void OpenL( const TPtr8& aData ) = 0; |
|
61 |
|
62 /// Sets load scale |
|
63 /// @param aScale scale factor to use |
|
64 virtual void SetScale( TJpegScale aScale ) = 0; |
|
65 |
|
66 /// Loads image or partial image |
|
67 /// for normal image load, use Info().iSize |
|
68 /// @param aRect rectangle in pixels to load. |
|
69 /// Returns real decoded size which is |
|
70 /// macroblock size dependent |
|
71 /// @return TBitmapHandle loaded image. |
|
72 virtual TBitmapHandle LoadImageL( TRect& aRect ) = 0; |
|
73 |
|
74 /// Scans the jpeg file for random access load |
|
75 /// must be called before LoadBlock() |
|
76 virtual void ScanRandomL() = 0; |
|
77 |
|
78 /// Decodes one macroblock from jpeg |
|
79 /// @param aBlock x&y coordinates of macroblock to decode |
|
80 /// @return block bitmap in 32bit RGB ( 0RGB ) format |
|
81 virtual TBitmapHandle LoadBlockL( const TPoint& aBlock ) = 0; |
|
82 |
|
83 /// Gives info about jpeg |
|
84 /// Can only be called after OpenL |
|
85 /// return jpeg information struct |
|
86 virtual const TJpegData& Info() = 0; |
|
87 |
|
88 /// Gives Exif data chunk if any |
|
89 virtual TPtrC8 ExifData() = 0; |
|
90 |
|
91 |
|
92 }; |
|
93 |
|
94 #endif |