|
1 /* |
|
2 * Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "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 * Kanrikogaku Kenkyusho, Ltd. - Initial contribution |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Contains the CDirectPrintRsImageParser class definition. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CDIRECTPRINTRSDIRECTPARSER_H |
|
20 #define CDIRECTPRINTRSDIRECTPARSER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <f32file.h> |
|
24 |
|
25 class CDirectPrintRsImageParser : public CBase |
|
26 { |
|
27 public: |
|
28 enum TImageEncoding |
|
29 { |
|
30 EUnknown = 0, |
|
31 ENonDiffHuffmanBaseline = 0xc0, |
|
32 ENonDiffHuffmanExtendedSeq, |
|
33 ENonDiffHuffmanProgressive, |
|
34 ENonDiffHuffmanLossless, |
|
35 EUnused1, |
|
36 EDiffHuffmanSequential, |
|
37 EDiffHuffmanProgressive, |
|
38 EDiffHuffmanLossless, |
|
39 EReserved, |
|
40 ENonDiffArithExtendedSeq, |
|
41 ENonDiffArithProgressive, |
|
42 ENonDiffArithLossless, |
|
43 EUnused2, |
|
44 EDiffArithSequential, |
|
45 EDiffArithProgressive, |
|
46 EDiffArithLossless |
|
47 }; |
|
48 |
|
49 /** |
|
50 * 2-phase constructor |
|
51 * |
|
52 * @return new object. The object is left on the cleanup stack |
|
53 */ |
|
54 static CDirectPrintRsImageParser* NewLC(); |
|
55 |
|
56 /** |
|
57 * Destructor |
|
58 */ |
|
59 ~CDirectPrintRsImageParser(); |
|
60 |
|
61 /** |
|
62 * JPEG image validator |
|
63 * |
|
64 * @param aFileName image file name |
|
65 * @param aValid place holder for validity indicator |
|
66 * @param aErr place holder for error code |
|
67 */ |
|
68 void ValidateL( const TDesC& aFileName, TBool& aValid, TInt& aErr ); |
|
69 |
|
70 private: |
|
71 |
|
72 CDirectPrintRsImageParser(); |
|
73 void ConstructL(); |
|
74 TBool Validate( TInt aStartOfDataOffset, TInt aWidth, TInt aHeight, TInt aSize, TInt aEncoding, TInt aErr ); |
|
75 TInt ReadData( RFile& aFile, TInt aStartByte, TDes8& aData ); |
|
76 |
|
77 private: |
|
78 |
|
79 RFs iFs; |
|
80 }; |
|
81 |
|
82 #endif // CDIRECTPRINTRSDIRECTPARSER_H |
|
83 |
|
84 // End of File |