2 * Copyright (c) 2003, 2004 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Exif file format parser ( reader ) class
40 // FUNCTION PROTOTYPES
42 // FORWARD DECLARATIONS
49 * Interface class for parsing Exif v2.2 file format. An instance of this class
50 * can be instantiated providing valid Exif data.
55 NONSHARABLE_CLASS( CExifRead ): public CBase
58 public: // Enumerations
61 ENoOptions = 0x0000, // Original, safe full parsing
62 ENoJpeg = 0x0001, // No main JPEG included, no parsing for main image
63 EFastJpegParsing = 0x0002, // Fast JPEG marker parsing
64 ENoTagChecking = 0x0004 // Ignore unknown EXIF tags and mandatory tag checking
67 public: // Constructors and destructor
70 * Two-phased constructor.
72 IMPORT_C static CExifRead* NewL( const TDesC8& aExifData );
74 IMPORT_C static CExifRead* NewL( const TDesC8& aExifData, TUint aExifReadOption );
81 public: // New functions
84 * Returns the Tag instance, which has the specified ID from the
87 * @param aIfdType The hosting IFD type
88 * @param aTagId The queried tag ID.
89 * @return Unmodifiable tag instance returned.
91 virtual const CExifTag* GetTagL(
92 TExifIfdType aIfdType,
93 TUint16 aTagId ) const = 0;
96 * Returns the IDs of all the tags that are stored in the Exif data.
98 * @param aIfdType The hosting IFD type.
99 * @param aNoTags Number of tag IDs returned.
100 * @return Pointer to the tag IDs.
102 virtual TUint16* GetTagIdsL(
103 TExifIfdType aIfdType,
104 TInt& aNoTags ) const = 0;
107 * Returns the types of the IFDs stored in the Exif data.
109 * @param aNoIfd Number of IFD types returned.
110 * @return Pointer to the IFD types.
112 virtual TExifIfdType* GetIfdTypesL( TInt& aNoIfd ) const = 0;
115 * Returns pointer to a copy of the thumbnail image data.
117 * @return Pointer to the descriptor containing a copy of the
118 * Exif thumbnail image.
120 virtual HBufC8* GetThumbnailL() const = 0;
123 * Returns a boolean stating if the queried IFD structure exists in the
126 * @param aIfdType The queried IFD type.
127 * @return Boolean stating if the specified IFD exists or not.
129 virtual TBool IfdExists( TExifIfdType aIfdType ) const = 0;
132 * Returns a boolean stating if the queried tag exists in the specified
135 * @param aTagId Queried tag ID.
136 * @param aIfdType The hosting IFD type.
137 * @return Boolean stating if the specified tag exists or not.
139 virtual TBool TagExists(
141 TExifIfdType aIfdType ) const = 0;
144 * Gets the Image Description tag data.
146 * @return Pointer to the descriptor containing copy of the Image
149 virtual HBufC8* GetImageDescriptionL() const = 0;
152 * Gets the Make tag data.
154 * @return Pointer to the descriptor containing copy of the Make data.
156 virtual HBufC8* GetMakeL() const = 0;
159 * Gets the Model tag data.
161 * @return Pointer to the descriptor containing copy of the Model data.
163 virtual HBufC8* GetModelL() const = 0;
166 * Gets the Transfer Function tag data.
168 * @return Pointer to the descriptor containing copy of the Transfer
171 virtual HBufC8* GetTransferFunctionL() const = 0;
174 * Gets the Date Time tag data.
176 * @return Pointer to the descriptor containing copy of the Date Time
179 virtual HBufC8* GetDateTimeL() const = 0;
182 * Gets the Software tag data.
184 * @return Pointer to the descriptor containing copy of the Software
187 virtual HBufC8* GetSoftwareL() const = 0;
190 * Gets the Copyright tag data.
192 * @return Pointer to the descriptor containing copy of the Copyright
195 virtual HBufC8* GetCopyrightL() const = 0;
198 * Gets the Orientation tag data.
200 * @param aOrientation Returned Orientation data.
201 * @return Error code.
203 virtual TInt GetOrientation( TUint16& aOrientation ) const = 0;
206 * Gets the X Resolution tag data.
208 * @param aXResolution1 Returned X Resolution numerator.
209 * @param aXResolution2 Returned X Resolution denominator.
210 * @return Error code.
212 virtual TInt GetXResolution(
213 TUint32& aXResolution1,
214 TUint32& aXResolution2 ) const = 0;
217 * Gets the Y Resolution tag data.
219 * @param aYResolution1 Returned Y Resolution numerator.
220 * @param aYResolution2 Returned Y Resolution denominator.
221 * @return Error code.
223 virtual TInt GetYResolution(
224 TUint32& aYResolution1,
225 TUint32& aYResolution2 ) const = 0;
228 * Gets the Resolution Unit tag data.
230 * @param aResolutionUnit Returned Resolution Unit data.
231 * @return Error code.
233 virtual TInt GetResolutionUnit( TUint16& aResolutionUnit ) const = 0;
236 * Gets the YCbCr Positioning tag data.
238 * @param aYCbCrPositioning Returned YCbCr Positioning data.
239 * @return Error code.
241 virtual TInt GetYCbCrPositioning(
242 TUint16& aYCbCrPositioning ) const = 0;
245 * Gets the Exif Ifd Pointer tag data.
247 * @param aExifIfdPointer Returned Exif Ifd Pointer data.
248 * @return Error code.
250 virtual TInt GetExifIfdPointer( TUint32& aExifIfdPointer ) const = 0;
253 * Gets the Gps Info Ifd Pointer tag data.
255 * @param aGpsInfoIfdPointer Returned Gps Info Ifd Pointer data.
256 * @return Error code.
258 virtual TInt GetGpsInfoIfdPointer(
259 TUint32& aGpsInfoIfdPointer ) const = 0;
262 * Gets the Iso Speed Ratings tag data.
264 * @return Pointer to the descriptor containing copy of the Iso Speed
267 virtual HBufC8* GetIsoSpeedRatingsL() const = 0;
270 * Gets the Date Time Original tag data.
272 * @return Pointer to the descriptor containing copy of the Date Time
275 virtual HBufC8* GetDateTimeOriginalL() const = 0;
278 * Gets the Date Time Digitized tag data.
280 * @return Pointer to the descriptor containing copy of the Date Time
283 virtual HBufC8* GetDateTimeDigitizedL() const = 0;
286 * Gets the Maker Note tag data.
288 * @return Pointer to the descriptor containing copy of the Maker Note
291 virtual HBufC8* GetMakerNoteL() const = 0;
294 * Gets the User Comment tag data.
296 * @return Pointer to the descriptor containing copy of the User
299 virtual HBufC8* GetUserCommentL() const = 0;
302 * Gets the Related Sound File tag data.
304 * @return Pointer to the descriptor containing copy of the Related
307 virtual HBufC8* GetRelatedSoundFileL() const = 0;
310 * Gets the Exposure Time tag data.
312 * @param ExposureTime Returned Exposure Time data.
313 * @return Error code.
315 virtual TInt GetExposureTime(
316 TUint32& aExposureTime1,
317 TUint32& aExposureTime2 ) const = 0;
320 * Gets the Components Configuration tag data.
322 * @param aComponentsConfiguration Returned Components Configuration
324 * @return Error code.
326 virtual TInt GetComponentsConfiguration(
327 TUint8& aFirstComponent, TUint8& aSecondComponent,
328 TUint8& aThirdComponent, TUint8& aFourthComponent) const = 0;
331 * Gets the Flash tag data.
333 * @param aFlash Returned Flash data.
334 * @return Error code.
336 virtual TInt GetFlash( TUint16& aFlash ) const = 0;
339 * Gets the ColorSpace tag data.
341 * @param aColorSpace Returned ColorSpace data.
342 * @return Error code.
344 virtual TInt GetColorSpace( TUint16& aColorSpace ) const = 0;
347 * Gets the Pixel X Dimension tag data.
349 * @param aPixelXDimension Returned Pixel X Dimension data.
350 * @return Error code.
352 virtual TInt GetPixelXDimension( TUint32& aPixelXDimension ) const = 0;
355 * Gets the Pixel Y Dimension tag data.
357 * @param aPixelYDimension Returned Pixel Y Dimension data.
358 * @return Error code.
360 virtual TInt GetPixelYDimension( TUint32& aPixelYDimension ) const = 0;
363 * Gets the Exposure Mode tag data.
365 * @param aExposureMode Returned Exposure Mode data.
366 * @return Error code.
368 virtual TInt GetExposureMode( TUint16& aExposureMode ) const = 0;
371 * Gets the White Balance tag data.
373 * @param aWhiteBalance Returned White Balance data.
374 * @return Error code.
376 virtual TInt GetWhiteBalance( TUint16& aWhiteBalance ) const = 0;
379 * Gets the Scene Capture Type tag data.
381 * @param aSceneCaptureType Returned Scene Capture Type data.
382 * @return Error code.
384 virtual TInt GetSceneCaptureType(
385 TUint16& aSceneCaptureType ) const = 0;
388 * Gets the Exposure Program tag data.
390 * @param aExposureProgram Returned Exposure Program data.
391 * @return Error code.
393 virtual TInt GetExposureProgram( TUint16& aExposureProgram ) const = 0;
396 * Gets the Aperture Value tag data.
398 * @param aApertureValue1 Returned Aperture Value numerator.
399 * @param aApertureValue2 Returned Aperture Value denominator.
400 * @return Error code.
402 virtual TInt GetApertureValue(
403 TUint32& aApertureValue1,
404 TUint32& aApertureValue2 ) const = 0;
407 * Gets the Exposure Bias Value tag data.
409 * @param aExposureBiasValue1 Returned Exposure Bias Value numerator.
410 * @param aExposureBiasValue1 Returned Exposure Bias Value denominator.
411 * @return Error code.
413 virtual TInt GetExposureBiasValue(
414 TInt32& aExposureBiasValue1,
415 TInt32& aExposureBiasValue2 ) const = 0;
418 * Gets the Metering Mode tag data.
420 * @param aMeteringMode Returned Metering Mode data.
421 * @return Error code.
423 virtual TInt GetMeteringMode( TUint16& aMeteringMode ) const = 0;
426 * Gets the Light Source tag data.
428 * @param aLightSource Returned Light Source data.
429 * @return Error code.
431 virtual TInt GetLightSource( TUint16& aLightSource ) const = 0;
434 * Gets the File Source tag data.
436 * @param aFileSource Returned File Source data.
437 * @return Error code.
439 virtual TInt GetFileSource( TInt8& aFileSource ) const = 0;
442 * Gets the Digital Zoom Ratio tag data.
444 * @param aDigitalZoomRatio1 Returned Digital Zoom Ratio numerator.
445 * @param aDigitalZoomRatio2 Returned Digital Zoom Ratio denominator.
446 * @return Error code.
448 virtual TInt GetDigitalZoomRatio(
449 TUint32& aDigitalZoomRatio1,
450 TUint32& aDigitalZoomRatio2 ) const = 0;
453 * Gets the Contrast tag data.
455 * @param aContrast Returned Contrast data.
456 * @return Error code.
458 virtual TInt GetContrast( TUint16& aContrast ) const = 0;
461 * Gets the Saturation tag data.
463 * @param aSaturation Returned Saturation data.
464 * @return Error code.
466 virtual TInt GetSaturation( TUint16& aSaturation ) const = 0;
469 * Gets the Sharpness tag data.
471 * @param aSharpness Returned Sharpness data.
472 * @return Error code.
474 virtual TInt GetSharpness( TUint16& aSharpness ) const = 0;
477 * Gets the Exif Version tag data.
479 * @param aExifVersion Returned Exif Version data.
480 * @return Error code.
482 virtual TInt GetExifVersion( TUint32& aExifVersion ) const = 0;
485 * Gets the Flash Pix Version tag data.
487 * @param aFlashPixVersion Returned Flash Pix Version data.
488 * @return Error code.
490 virtual TInt GetFlashPixVersion( TUint32& aFlashPixVersion ) const = 0;
493 * Gets the Interoperability Ifd Pointer tag data.
495 * @param aInteroperabilityIfdPointer Returned Interoperability Ifd
497 * @return Error code.
499 virtual TInt GetInteroperabilityIfdPointer(
500 TUint32& aInteroperabilityIfdPointer ) const = 0;
503 * Gets the thumbnail X Resolution tag data.
505 * @param aXResolution1 Returned thumbnail X Resolution numerator.
506 * @param aXResolution1 Returned thumbnail X Resolution denominator.
507 * @return Error code.
509 virtual TInt GetThumbnailXResolution(
510 TUint32& aXResolution1,
511 TUint32& aXResolution2 ) const = 0;
514 * Gets the thumbnail Y Resolution tag data.
516 * @param aYResolution1 Returned thumbnail Y Resolution numerator.
517 * @param aYResolution1 Returned thumbnail Y Resolution denominator.
518 * @return Error code.
520 virtual TInt GetThumbnailYResolution(
521 TUint32& aYResolution1,
522 TUint32& aYResolution2 ) const = 0;
525 * Gets the thumbnail Resolution Unit tag data.
527 * @param aResolutionUnit Returned thumbnail Resolution Unit data.
528 * @return Error code.
530 virtual TInt GetThumbnailResolutionUnit(
531 TUint16& aResolutionUnit ) const = 0;
534 * Gets the thumbnail Compression tag data.
536 * @param aCompression Returned thumbnail Compression data.
537 * @return Error code.
539 virtual TInt GetThumbnailCompression( TUint16& aCompression ) const = 0;
542 * Gets the thumbnail Jpeg Interchange Format tag data.
544 * @param aJpegInterchangeFormat Returned thumbnail Jpeg Interchange
546 * @return Error code.
548 virtual TInt GetJpegInterchangeFormat(
549 TUint32& aJpegInterchangeFormat ) const = 0;
552 * Gets the thumbnail Jpeg Interchange Format Length tag data.
554 * @param aJpegInterchangeFormatLength Returned thumbnail Jpeg
555 * Interchange Format Length data.
556 * @return Error code.
558 virtual TInt GetJpegInterchangeFormatLength(
559 TUint32& aJpegInterchangeFormatLength ) const = 0;
562 * Returns a copy of whole Exif APP1 segment in a descriptor.
564 * @return Descriptor containing the Exif APP1 segment data.
566 virtual HBufC8* GetExifAppSegmentL() const = 0;
569 * Gets the Shutter Speed Value tag data.
571 * @param aShutterSpeedValue1 Shutter Speed Value numerator.
572 * @param aShutterSpeedValue2 Shutter Speed Value denominator.
573 * @return Error code.
575 virtual TInt GetShutterSpeedValue( TInt32& aShutterSpeedValue1,
576 TInt32& aShutterSpeedValue2 ) const = 0;
579 * Gets the Brightness Value tag data.
581 * @param aBrightnessValue1 Brightness Value numerator.
582 * @param aBrightnessValue2 Brightness Value denominator.
583 * @return Error code.
585 virtual TInt GetBrightnessValue( TInt32& aBrightnessValue1,
586 TInt32& aBrightnessValue2 ) const = 0;
589 * Gets the Custom Rendered tag data.
591 * @param aCustomRendered Returned Custom Rendered data.
592 * @return Error code.
594 virtual TInt GetCustomRendered( TUint16& aCustomRendered ) const = 0;
597 * Gets the Gain Control tag data.
599 * @param aGainControl Returned Gain Control data.
600 * @return Error code.
602 virtual TInt GetGainControl( TUint16& aGainControl ) const = 0;
605 * Gets the Gps Version tag data.
607 * @param aGpsVersion Returned Gps Version data.
608 * @return Error code.
610 virtual TInt GetGpsVersion( TUint32& aGpsVersion ) const = 0;