|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // ExifUtilty.h |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __EXIFUTILITY_H__ |
|
19 #define __EXIFUTILITY_H__ |
|
20 |
|
21 class MExifMetadataReader; |
|
22 class MExifMetadataWriter; |
|
23 |
|
24 |
|
25 /** |
|
26 @publishedAll |
|
27 @released |
|
28 |
|
29 This class offers a friendly interface to read the metadata in exif encoded image files |
|
30 |
|
31 Note: Unless otherwise stated in a method's documentation, TInt& arguments represent unsigned quantities and will be updated with unsigned values, even though TInt is a signed type. |
|
32 In such cases, proper typecasting should be used to ensure that the values are correctly treated as unsigned. |
|
33 |
|
34 Note: Get method arguments will only be updated if the method is returning KErrNone. |
|
35 |
|
36 */ |
|
37 class TExifReaderUtility |
|
38 { |
|
39 public: |
|
40 // Construction and destruction |
|
41 IMPORT_C TExifReaderUtility(MExifMetadataReader* aExifMetadataReader); |
|
42 |
|
43 public: |
|
44 // Getters |
|
45 IMPORT_C TInt GetMake(HBufC8*& aParam) const; |
|
46 IMPORT_C TInt GetModel(HBufC8*& aParam) const; |
|
47 IMPORT_C TInt GetDateTime(HBufC8*& aParam) const; |
|
48 IMPORT_C TInt GetDateTimeOriginal(HBufC8*& aParam) const; |
|
49 IMPORT_C TInt GetDateTimeDigitized(HBufC8*& aParam) const; |
|
50 IMPORT_C TInt GetInteroperabilityIndex(HBufC8*& aParam) const; |
|
51 IMPORT_C TInt GetInteroperabilityVersion(HBufC8*& aParam) const; |
|
52 |
|
53 IMPORT_C TInt GetExifVersion(HBufC8*& aParam) const; |
|
54 IMPORT_C TInt GetComponentsConfiguration(HBufC8*& aParam) const; |
|
55 IMPORT_C TInt GetFlashPixVersion(HBufC8*& aParam) const; |
|
56 |
|
57 IMPORT_C TInt GetXResolution(TInt& aNumerator, TInt& aDenominator) const; |
|
58 IMPORT_C TInt GetYResolution(TInt& aNumerator, TInt& aDenominator) const; |
|
59 IMPORT_C TInt GetThumbXResolution(TInt& aNumerator, TInt& aDenominator) const; |
|
60 IMPORT_C TInt GetThumbYResolution(TInt& aNumerator, TInt& aDenominator) const; |
|
61 |
|
62 IMPORT_C TInt GetResolutionUnit(TUint16& aParam) const; |
|
63 IMPORT_C TInt GetYCbCrPositioning(TUint16& aParam) const; |
|
64 IMPORT_C TInt GetOrientation(TUint16& aParam) const; |
|
65 IMPORT_C TInt GetColorSpace(TUint16& aParam) const; |
|
66 IMPORT_C TInt GetPixelXDimension(TInt& aParam) const; |
|
67 IMPORT_C TInt GetPixelYDimension(TInt& aParam) const; |
|
68 |
|
69 IMPORT_C TInt GetThumbCompression(TUint16& aParam) const; |
|
70 IMPORT_C TInt GetThumbResolutionUnit(TUint16& aParam) const; |
|
71 IMPORT_C TInt GetThumbOrientation(TUint16& aParam) const; |
|
72 |
|
73 IMPORT_C TInt GetImageDescription(HBufC8*& aParam) const; |
|
74 IMPORT_C TInt GetCopyright(HBufC8*& aParam) const; |
|
75 IMPORT_C TInt GetMakerNote(HBufC8*& aParam) const; |
|
76 IMPORT_C TInt GetUserComment(HBufC8*& aParam) const; |
|
77 IMPORT_C TInt GetFlash(TUint16& aParam) const; |
|
78 IMPORT_C TInt GetFocalLength(TInt& aNumerator, TInt& aDenominator) const; |
|
79 IMPORT_C TInt GetShutterSpeedValue(TInt& aNumerator, TInt& aDenominator) const; |
|
80 IMPORT_C TInt GetJpegInterchangeFormatLength(TInt& aParam) const; |
|
81 IMPORT_C TInt GetJpegInterchangeFormatLength(TUint& aParam) const; |
|
82 |
|
83 IMPORT_C TInt GetGpsVersionId(HBufC8*& aParam) const; |
|
84 IMPORT_C TInt GetGpsLatitudeRef(HBufC8*& aParam) const; |
|
85 IMPORT_C TInt GetGpsLatitude(TInt& aDegNumerator, TInt& aDegDenominator, TInt& aMinNumerator, TInt& aMinDenominator, TInt& aSecNumerator, TInt& aSecDenominator) const; |
|
86 IMPORT_C TInt GetGpsLongitudeRef(HBufC8*& aParam) const; |
|
87 IMPORT_C TInt GetGpsLongitude(TInt& aDegNumerator, TInt& aDegDenominator, TInt& aMinNumerator, TInt& aMinDenominator, TInt& aSecNumerator, TInt& aSecDenominator) const; |
|
88 IMPORT_C TInt GetGpsAltitudeRef(TUint8& aParam) const; |
|
89 IMPORT_C TInt GetGpsAltitude(TInt& aNumerator, TInt& aDenominator) const; |
|
90 IMPORT_C TInt GetGpsTimeStamp(TInt& aHourNumerator, TInt& aHourDenominator, TInt& aMinNumerator, TInt& aMinDenominator, TInt& aSecNumerator, TInt& aSecDenominator) const; |
|
91 IMPORT_C TInt GetGpsSatellites(HBufC8*& aParam) const; |
|
92 IMPORT_C TInt GetGpsStatus(HBufC8*& aParam) const; |
|
93 IMPORT_C TInt GetGpsMeasureMode(HBufC8*& aParam) const; |
|
94 IMPORT_C TInt GetGpsDop(TInt& aNumerator, TInt& aDenominator) const; |
|
95 IMPORT_C TInt GetGpsSpeedRef(HBufC8*& aParam) const; |
|
96 IMPORT_C TInt GetGpsSpeed(TInt& aNumerator, TInt& aDenominator) const; |
|
97 IMPORT_C TInt GetGpsTrackRef(HBufC8*& aParam) const; |
|
98 IMPORT_C TInt GetGpsTrack(TInt& aNumerator, TInt& aDenominator) const; |
|
99 IMPORT_C TInt GetGpsImgDirectionRef(HBufC8*& aParam) const; |
|
100 IMPORT_C TInt GetGpsImgDirection(TInt& aNumerator, TInt& aDenominator) const; |
|
101 IMPORT_C TInt GetGpsMapDatum(HBufC8*& aParam) const; |
|
102 IMPORT_C TInt GetGpsDestLatitudeRef(HBufC8*& aParam) const; |
|
103 IMPORT_C TInt GetGpsDestLatitude(TInt& aDegNumerator, TInt& aDegDenominator, TInt& aMinNumerator, TInt& aMinDenominator, TInt& aSecNumerator, TInt& aSecDenominator) const; |
|
104 IMPORT_C TInt GetGpsDestLongitudeRef(HBufC8*& aParam) const; |
|
105 IMPORT_C TInt GetGpsDestLongitude(TInt& aDegNumerator, TInt& aDegDenominator, TInt& aMinNumerator, TInt& aMinDenominator, TInt& aSecNumerator, TInt& aSecDenominator) const; |
|
106 IMPORT_C TInt GetGpsDestBearingRef(HBufC8*& aParam) const; |
|
107 IMPORT_C TInt GetGpsDestBearing(TInt& aNumerator, TInt& aDenominator) const; |
|
108 IMPORT_C TInt GetGpsDestDistanceRef(HBufC8*& aParam) const; |
|
109 IMPORT_C TInt GetGpsDestDistance(TInt& aNumerator, TInt& aDenominator) const; |
|
110 IMPORT_C TInt GetGpsProcessingMethod(HBufC8*& aParam) const; |
|
111 IMPORT_C TInt GetGpsAreaInformation(HBufC8*& aParam) const; |
|
112 IMPORT_C TInt GetGpsDateStamp(HBufC8*& aParam) const; |
|
113 IMPORT_C TInt GetGpsDifferential(TUint16& aParam) const; |
|
114 private: |
|
115 MExifMetadataReader* iExifRead; |
|
116 }; |
|
117 |
|
118 |
|
119 /** |
|
120 @publishedAll |
|
121 @released |
|
122 |
|
123 This class offers a friendly interface to write the metadata in exif encoded image files |
|
124 |
|
125 Note: Unless otherwise stated in a method's documentation, it should be assumed that TInt arguments are representing unsigned quantities, even though TInt is a signed type. |
|
126 So unless otherwise stated, these parameters should be given unsigned values only. |
|
127 */ |
|
128 class TExifWriterUtility |
|
129 { |
|
130 public: |
|
131 // Construction and destruction |
|
132 IMPORT_C TExifWriterUtility(MExifMetadataWriter* aExifMetadata); |
|
133 |
|
134 public: |
|
135 // Setters |
|
136 IMPORT_C TInt SetMake(HBufC8* aMake); |
|
137 IMPORT_C TInt SetModel(HBufC8* aModel); |
|
138 IMPORT_C TInt SetDateTime(HBufC8* aDateTime); |
|
139 IMPORT_C TInt SetDateTimeOriginal(HBufC8* aDateTime); |
|
140 IMPORT_C TInt SetDateTimeDigitized(HBufC8* aDateTime); |
|
141 IMPORT_C TInt SetInteroperabilityIndex(HBufC8* aIdx); |
|
142 IMPORT_C TInt SetInteroperabilityVersion(HBufC8* aIdx); |
|
143 |
|
144 IMPORT_C TInt SetExifVersion(HBufC8* aExifVersion); |
|
145 IMPORT_C TInt SetComponentsConfiguration(HBufC8* aComponentsConfig); |
|
146 IMPORT_C TInt SetFlashPixVersion(HBufC8* aFlashPixVer); |
|
147 |
|
148 IMPORT_C TInt SetXResolution(TInt aNumerator, TInt aDenominator); |
|
149 IMPORT_C TInt SetYResolution(TInt aNumerator, TInt aDenominator); |
|
150 IMPORT_C TInt SetThumbXResolution(TInt aNumerator, TInt aDenominator); |
|
151 IMPORT_C TInt SetThumbYResolution(TInt aNumerator, TInt aDenominator); |
|
152 |
|
153 IMPORT_C TInt SetResolutionUnit(TInt aResUnit); |
|
154 IMPORT_C TInt SetYCbCrPositioning(TInt aPositioning); |
|
155 IMPORT_C TInt SetOrientation(TInt aOrientation); |
|
156 IMPORT_C TInt SetColorSpace(TInt aColorSpace); |
|
157 IMPORT_C TInt SetPixelXDimension(TInt aPixelXDim); |
|
158 IMPORT_C TInt SetPixelYDimension(TInt aPixelYDim); |
|
159 |
|
160 IMPORT_C TInt SetThumbCompression(TInt aCompression); |
|
161 IMPORT_C TInt SetThumbResolutionUnit(TInt aResUnit); |
|
162 IMPORT_C TInt SetThumbOrientation(TInt aOrientation); |
|
163 |
|
164 IMPORT_C TInt SetImageDescription(HBufC8* aImageDescription); |
|
165 IMPORT_C TInt SetCopyright(HBufC8* aCopyright); |
|
166 IMPORT_C TInt SetMakerNote(HBufC8* aMakerNote); |
|
167 IMPORT_C TInt SetUserComment(HBufC8* aUserComment); |
|
168 IMPORT_C TInt SetFlash(TUint16 aFlash); |
|
169 IMPORT_C TInt SetFocalLength(TInt aNumerator, TInt aDenominator); |
|
170 IMPORT_C TInt SetShutterSpeedValue(TInt aNumerator, TInt aDenominator); |
|
171 |
|
172 IMPORT_C TInt SetGpsVersionId(HBufC8* aGpsVersionId); |
|
173 IMPORT_C TInt SetGpsLatitudeRef(HBufC8* aGpsLatitudeRef); |
|
174 IMPORT_C TInt SetGpsLatitude(TInt aDegNumerator, TInt aDegDenominator, TInt aMinNumerator, TInt aMinDenominator, TInt aSecNumerator, TInt aSecDenominator); |
|
175 IMPORT_C TInt SetGpsLongitudeRef(HBufC8* aGpsLongitudeRef); |
|
176 IMPORT_C TInt SetGpsLongitude(TInt aDegNumerator, TInt aDegDenominator, TInt aMinNumerator, TInt aMinDenominator, TInt aSecNumerator, TInt aSecDenominator); |
|
177 IMPORT_C TInt SetGpsAltitudeRef(TUint8 aGpsAltitudeRef); |
|
178 IMPORT_C TInt SetGpsAltitude(TInt aNumerator, TInt aDenominator); |
|
179 IMPORT_C TInt SetGpsTimeStamp(TInt aHourNumerator, TInt aHourDenominator, TInt aMinNumerator, TInt aMinDenominator, TInt aSecNumerator, TInt aSecDenominator); |
|
180 IMPORT_C TInt SetGpsSatellites(HBufC8* aGpsSatellites); |
|
181 IMPORT_C TInt SetGpsStatus(HBufC8* aGpsStatus); |
|
182 IMPORT_C TInt SetGpsMeasureMode(HBufC8* aGpsMeasureMode); |
|
183 IMPORT_C TInt SetGpsDop(TInt aNumerator, TInt aDenominator); |
|
184 IMPORT_C TInt SetGpsSpeedRef(HBufC8* aGpsSpeedRef); |
|
185 IMPORT_C TInt SetGpsSpeed(TInt aNumerator, TInt aDenominator); |
|
186 IMPORT_C TInt SetGpsTrackRef(HBufC8* aGpsTrackRef); |
|
187 IMPORT_C TInt SetGpsTrack(TInt aNumerator, TInt aDenominator); |
|
188 IMPORT_C TInt SetGpsImgDirectionRef(HBufC8* aGpsImgDirectionRef); |
|
189 IMPORT_C TInt SetGpsImgDirection(TInt aNumerator, TInt aDenominator); |
|
190 IMPORT_C TInt SetGpsMapDatum(HBufC8* aGpsMapDatum); |
|
191 IMPORT_C TInt SetGpsDestLatitudeRef(HBufC8* aGpsDestLatitudeRef); |
|
192 IMPORT_C TInt SetGpsDestLatitude(TInt aDegNumerator, TInt aDegDenominator, TInt aMinNumerator, TInt aMinDenominator, TInt aSecNumerator, TInt aSecDenominator); |
|
193 IMPORT_C TInt SetGpsDestLongitudeRef(HBufC8* aGpsDestLongitudeRef); |
|
194 IMPORT_C TInt SetGpsDestLongitude(TInt aDegNumerator, TInt aDegDenominator, TInt aMinNumerator, TInt aMinDenominator, TInt aSecNumerator, TInt aSecDenominator); |
|
195 IMPORT_C TInt SetGpsDestBearingRef(HBufC8* aGpsDestBearingRef); |
|
196 IMPORT_C TInt SetGpsDestBearing(TInt aNumerator, TInt aDenominator); |
|
197 IMPORT_C TInt SetGpsDestDistanceRef(HBufC8* aGpsDestDistanceRef); |
|
198 IMPORT_C TInt SetGpsDestDistance(TInt aNumerator, TInt aDenominator); |
|
199 IMPORT_C TInt SetGpsProcessingMethod(HBufC8* aGpsProcessingMethod); |
|
200 IMPORT_C TInt SetGpsAreaInformation(HBufC8* aGpsAreaInformation); |
|
201 IMPORT_C TInt SetGpsDateStamp(HBufC8* aDateStamp); |
|
202 IMPORT_C TInt SetGpsDifferential(TUint16 aGpsDifferential); |
|
203 |
|
204 private: // Member |
|
205 |
|
206 MExifMetadataWriter* iExifWrite; |
|
207 |
|
208 }; |
|
209 |
|
210 |
|
211 #endif // __EXIFUTILITY_H__ |