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 creator/modifier class
32 // FUNCTION PROTOTYPES
34 // FORWARD DECLARATIONS
41 * Interface class for modifying existing Exif v2.2 (or prior) file format or
42 * creating Exif v2.2 file format using valid Jpeg image.
43 * An instance of this class can be instantiated in one of two ways:
44 * by providing valid Exif data or by providing valid Jpeg image.
49 NONSHARABLE_CLASS( CExifModify ): public CBase
51 public: // Enumerations
54 * The operation mode enumeration specifying the create or modify modes.
63 enum TExifModifyOption
66 ENoJpegParsing = 0x0001, // No jpeg validity checking is done
67 ENoTagChecking = 0x0002 // Ignore unknown EXIF tags and mandatory tag checking
70 public: // Constructors and destructor
73 * Two-phased constructor.
75 IMPORT_C static CExifModify* NewL(
76 const TDesC8& aInData,
77 CExifModify::TOperationMode aOperationMode = EModify );
79 IMPORT_C static CExifModify* NewL(
80 const TDesC8& aInData,
81 CExifModify::TOperationMode aOperationMode,
82 TUint aExifModifyOption );
86 * Two-phased constructor.
88 IMPORT_C static CExifModify* NewL();
93 virtual ~CExifModify();
95 public: // New functions
98 * Returns a constant pointer to a CExifRead instance that can be used
99 * to parse the associated Exif image.
101 * @return Unmodifiable pointer to Exif reader instance.
103 virtual const CExifRead* Reader() const = 0;
106 * Inserts/Updates the given tag in the specified IFD structure of the
109 * @param aIfdType The hosting IFD type.
110 * @param aExifTagInfo The informative fields of tag that is updated.
111 * @param aExifData Data of the tag that is updated.
114 virtual void SetTagL(
115 TExifIfdType aIfdType,
116 TExifTagInfo aExifTagInfo,
117 const TDesC8& aTagData ) = 0;
120 * Removes the tag with the given tag ID from the specified IFD
121 * structure in the Exif data.
123 * @param aIfdType The hosting IFD type.
124 * @param aTagId The target tag ID.
125 * @return Error code.
127 virtual TInt DeleteTag( TExifIfdType aIfdType, TUint16 aTagId ) = 0;
130 * Removes the specified IFD structure and all its tags from the Exif
133 * @param aIfdType The target IFD type.
134 * @return Error code.
136 virtual TInt DeleteIfd( TExifIfdType aIfdType ) = 0;
139 * Inserts/Updates the given thumbnail Jpeg image data into the 1st IFD
140 * structure in the Exif data.
142 * @param aThumbnailData The Exif thumbnail image data that is updated.
145 virtual void SetThumbnailL( const TDesC8& aThumbnailData ) = 0;
148 * Removes the thumbnail Jpeg image data from the 1st IFD structure in
151 * @return Error code.
153 virtual TInt RemoveThumbnail() = 0;
156 * Flushes the Exif data into the given data buffer, and releases the
157 * internal structures.
159 * @param aInData The original Exif image data, which contains identical
160 * data provided while calling the NewL function.
161 * @return Pointer to descriptor containing new Exif image data.
163 virtual HBufC8* WriteDataL( const TDesC8& aInData ) = 0;
166 * Inserts/Updates given Image Description in the Exif data.
168 * @param aImageDescription Updated Image Description data.
171 virtual void SetImageDescriptionL( const TDesC8& aImageDescription ) = 0;
174 * Inserts/Updates given Make in the Exif data.
176 * @param aMake Updated Make data.
179 virtual void SetMakeL( const TDesC8& aMake ) = 0;
182 * Inserts/Updates given Model in the Exif data.
184 * @param aModel Updated Model data.
187 virtual void SetModelL( const TDesC8& aModel ) = 0;
190 * Inserts/Updates given Orientation in the Exif data.
192 * @param aOrientation Updated Orientation data.
195 virtual void SetOrientationL( TUint16 aOrientation ) = 0;
198 * Inserts/Updates given X Resolution in the Exif data.
200 * @param aXResolution1 Updated X Resolution numerator.
201 * @param aXResolution2 Updated X Resolution denominator.
204 virtual void SetXResolutionL(
205 TUint32 aXResolution1,
206 TUint32 aXResolution2 ) = 0;
209 * Inserts/Updates given Y Resolution in the Exif data.
211 * @param aYResolution1 Updated Y Resolution numerator.
212 * @param aYResolution2 Updated Y Resolution denominator.
215 virtual void SetYResolutionL(
216 TUint32 aYResolution1,
217 TUint32 aYResolution2 ) = 0;
220 * Inserts/Updates given Resolution Unit in the Exif data.
222 * @param aResolutionUnit Updated Resolution Unit data.
225 virtual void SetResolutionUnitL( TUint16 aResolutionUnit ) = 0;
228 * Inserts/Updates given Transfer Function in the Exif data.
230 * @param aTransferFunction Updated Transfer Function data.
233 virtual void SetTransferFunctionL(
234 const TDesC8& aTransferFunction ) = 0;
237 * Inserts/Updates given Date Time in the Exif data.
239 * @param aDateTime Updated Date Time data.
242 virtual void SetDateTimeL( const TDesC8& aDateTime ) = 0;
245 * Inserts/Updates given YCbCr Positioning in the Exif data.
247 * @param aYCbCrPositioning YCbCr Positioning data.
250 virtual void SetYCbCrPositioningL( TUint16 aYCbCrPositioning) = 0;
253 * Inserts/Updates given Software in the Exif data.
255 * @param aSoftware Updated Software data.
258 virtual void SetSoftwareL( const TDesC8& aSoftware ) = 0;
261 * Inserts/Updates given Copyright in the Exif data.
263 * @param aCopyright Updated Copyright data.
266 virtual void SetCopyrightL( const TDesC8& aCopyright ) = 0;
269 * Inserts/Updates given Exposure Time in the Exif data.
271 * @param aExposureTime1 Updated Exposure Time numerator.
272 * @param aExposureTime2 Updated Exposure Time denominator.
275 virtual void SetExposureTimeL(
276 TUint32 aExposureTime1,
277 TUint32 aExposureTime2 ) = 0;
280 * Inserts/Updates given Components Configuration in the Exif data.
282 * @param aComponentsConfiguration Updated Components Configuration data.
285 virtual void SetComponentsConfigurationL(
286 TUint8 aFirstComponent, TUint8 aSecondComponent,
287 TUint8 aThirdComponent, TUint8 aFourthComponent ) = 0;
290 * Inserts/Updates given Flash in the Exif data.
292 * @param aFlash Updated Flash data.
295 virtual void SetFlashL( TUint16 aFlash ) = 0;
298 * Inserts/Updates given Color Space in the Exif data.
300 * @param aColorSpace Updated Color Space data.
303 virtual void SetColorSpaceL( TUint16 aColorSpace ) = 0;
306 * Inserts/Updates given Pixel X Dimension in the Exif data.
308 * @param aPixelXDimension Updated Pixel X Dimension data.
311 virtual void SetPixelXDimensionL( TUint32 aPixelXDimension ) = 0;
314 * Inserts/Updates given Pixel Y Dimension in the Exif data.
316 * @param aPixelYDimension Updated Pixel Y Dimension data.
319 virtual void SetPixelYDimensionL( TUint32 aPixelYDimension ) = 0;
322 * Inserts/Updates given Exposure Mode in the Exif data.
324 * @param aExposureMode Updated Exposure Mode data.
327 virtual void SetExposureModeL( TUint16 aExposureMode ) = 0;
330 * Inserts/Updates given White Balance in the Exif data.
332 * @param aWhiteBalance Updated White Balance data.
335 virtual void SetWhiteBalanceL( TUint16 aWhiteBalance ) = 0;
338 * Inserts/Updates given Scene Capture Type in the Exif data.
340 * @param aSceneCaptureType Updated Scene Capture Type data.
343 virtual void SetSceneCaptureTypeL( TUint16 aSceneCaptureType ) = 0;
347 * Inserts/Updates given Exposure Program in the Exif data.
349 * @param aExposureProgram Updated Exposure Program data.
351 */virtual void SetExposureProgramL( TUint16 aExposureProgram ) = 0;
354 * Inserts/Updates given Iso Speed Ratings in the Exif data.
356 * @param aIsoSpeedRatings Updated Iso Speed Ratings data.
359 virtual void SetIsoSpeedRatingsL( const TDesC8& aIsoSpeedRatings ) = 0;
362 * Inserts/Updates given Date Time Original in the Exif data.
364 * @param aDateTimeOriginal Updated Date Time Original data.
367 virtual void SetDateTimeOriginalL(
368 const TDesC8& aDateTimeOriginal ) = 0;
371 * Inserts/Updates given Date Time Digitized in the Exif data.
373 * @param aDateTimeDigitized Updated Date Time Digitized data.
376 virtual void SetDateTimeDigitizedL(
377 const TDesC8& aDateTimeDigitized ) = 0;
380 * Inserts/Updates given Aperture Value in the Exif data.
382 * @param aApertureValue1 Updated Aperture Value numerator.
383 * @param aApertureValue2 Updated Aperture Value denominator.
386 virtual void SetApertureValueL(
387 TUint32 aApertureValue1,
388 TUint32 aApertureValue2 ) = 0;
391 * Inserts/Updates given Exposure Bias Value in the Exif data.
393 * @param aExposureBiasValue1 Updated Exposure Bias Value numerator.
394 * @param aExposureBiasValue2 Updated Exposure Bias Value denominator.
397 virtual void SetExposureBiasValueL(
398 TInt32 aExposureBiasValue1,
399 TInt32 aExposureBiasValue2 ) = 0;
402 * Inserts/Updates given Metering Mode in the Exif data.
404 * @param aMeteringMode Updated Metering Mode data.
407 virtual void SetMeteringModeL( TUint16 aMeteringMode ) = 0;
410 * Inserts/Updates given Light Source in the Exif data.
412 * @param aLightSource Updated Light Source data.
415 virtual void SetLightSourceL( TUint16 aLightSource ) = 0;
418 * Inserts/Updates given Maker Note in the Exif data.
420 * @param aMakerNote Updated Maker Note data.
423 virtual void SetMakerNoteL( const TDesC8& aMakerNote ) = 0;
426 * Inserts/Updates given User Comment in the Exif data.
428 * @param aUserComment Updated User Comment data.
431 virtual void SetUserCommentL( const TDesC8& aUserComment ) = 0;
434 * Inserts/Updates given Related Sound File in the Exif data.
436 * @param aRelatedSoundFile Updated Related Sound File data.
439 virtual void SetRelatedSoundFileL(
440 const TDesC8& aRelatedSoundFile ) = 0;
443 * Inserts/Updates given File Source in the Exif data.
445 * @param aFileSource Updated File Source data.
448 virtual void SetFileSourceL( TInt8 aFileSource ) = 0;
451 * Inserts/Updates given Digital Zoom Ratio in the Exif data.
453 * @param aDigitalZoomRatio1 Updated Digital Zoom Ratio numerator.
454 * @param aDigitalZoomRatio2 Updated Digital Zoom Ratio denominator.
457 virtual void SetDigitalZoomRatioL(
458 TUint32 aDigitalZoomRatio1,
459 TUint32 aDigitalZoomRatio2 ) = 0;
462 * Inserts/Updates given Contrast in the Exif data.
464 * @param aContrast Updated Contrast data.
467 virtual void SetContrastL( TUint16 aContrast ) = 0;
470 * Inserts/Updates given Saturation in the Exif data.
472 * @param aSaturation Updated Saturation data.
475 virtual void SetSaturationL( TUint16 aSaturation ) = 0;
478 * Inserts/Updates given Sharpness in the Exif data.
480 * @param aSharpness Updated Sharpness data.
483 virtual void SetSharpnessL( TUint16 aSharpness ) = 0;
486 * Inserts/Updates given thumbnail X Resolution in the Exif data.
488 * @param aXResolution1 Updated thumbnail X Resolution numerator.
489 * @param aXResolution2 Updated thumbnail X Resolution denominator.
492 virtual void SetThumbnailXResolutionL(
493 TUint32 aXResolution1,
494 TUint32 aXResolution2 ) = 0;
497 * Inserts/Updates given thumbnail Y Resolution in the Exif data.
499 * @param aYResolution1 Updated thumbnail Y Resolution numerator.
500 * @param aYResolution2 Updated thumbnail Y Resolution denominator.
503 virtual void SetThumbnailYResolutionL(
504 TUint32 aYResolution1,
505 TUint32 aYResolution2 ) = 0;
508 * Inserts/Updates given thumbnail Resolution Unit in the Exif data.
510 * @param aResolutionUnit Updated thumbnail Resolution Unit data.
513 virtual void SetThumbnailResolutionUnitL( TUint16 aResolutionUnit ) = 0;
516 * Inserts/Updates given Shutter Speed Value in the Exif data.
518 * @param aShutterSpeedValue1 Updated Shutter Speed Value numerator.
519 * @param aShutterSpeedValue2 Updated Shutter Speed Value denominator.
522 virtual void SetShutterSpeedValueL(
523 TInt32 aShutterSpeedValue1,
524 TInt32 aShutterSpeedValue2 ) = 0;
527 * Inserts/Updates given Brightness Value in the Exif data.
529 * @param aBrightnessValue1 Updated Brightness Value numerator.
530 * @param aBrightnessValue2 Updated Brightness Value denominator.
533 virtual void SetBrightnessValueL(
534 TInt32 aBrightnessValue1,
535 TInt32 aBrightnessValue2 ) = 0;
538 * Inserts/Updates given Custom Rendered in the Exif data.
540 * @param aCustomRendered Updated Custom Rendered data.
543 virtual void SetCustomRenderedL( TUint16 aCustomRendered ) = 0;
546 * Inserts/Updates given Gain Control in the Exif data.
548 * @param aGainControl Updated Gain Control data.
551 virtual void SetGainControlL( TUint16 aGainControl ) = 0;
555 #endif // EXIFMODIFY_H