|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Helper class for camera dynamic configuration |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef CAMCONFIGURATIONUTILITY_H |
|
20 #define CAMCONFIGURATIONUTILITY_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include "camconfiguration.h" |
|
24 |
|
25 class CamConfigurationUtility |
|
26 { |
|
27 public: |
|
28 |
|
29 /** |
|
30 * Returns index in KPhotoSizes table for given photo resolution |
|
31 * @param aWidth Width |
|
32 * @param aHeight Height |
|
33 * @return Size index, or KErrNotFound |
|
34 */ |
|
35 static TInt PhotoSizeIndex( TInt aWidth, TInt aHeight ); |
|
36 |
|
37 /** |
|
38 * Returns index in KVideoSizes table for given video resolution |
|
39 * @param aWidth Width |
|
40 * @param aHeight Height |
|
41 * @return Size index, or KErrNotFound |
|
42 */ |
|
43 static TInt VideoSizeIndex( TInt aWidth, TInt aHeight ); |
|
44 |
|
45 /** |
|
46 * Adjusts print qualities from ECamQualityPrint to ECamQualityPrintHigh and Low, |
|
47 * where necessary. |
|
48 * @param aPhotoQualities Array of image quality data |
|
49 */ |
|
50 static void AdjustPrintQualities( RArray<TCamImageQualityData>& aPhotoQualities ); |
|
51 |
|
52 /** |
|
53 * Sets video quality levels for an ordered array of video qualities data. |
|
54 * |
|
55 * @param aOrderedArray |
|
56 */ |
|
57 static void SetVideoQualityLevels( RArray<TCamVideoQualityData>& aOrderedArray ); |
|
58 |
|
59 /** |
|
60 * Appends integer value to array, if the value is not yet present in the array. |
|
61 * @param aValue Integer value |
|
62 * @param aArray Integer array |
|
63 */ |
|
64 static void AddToArrayL( TInt aValue, RArray<TInt>& aArray ); |
|
65 |
|
66 /** |
|
67 * Returns index in KPhotoSizes table for given photo resolution |
|
68 * @param aWidth Width |
|
69 * @param aHeight Height |
|
70 * @return Size id, or KErrNotFound |
|
71 */ |
|
72 static TInt VideoResolution( TInt aWidth, TInt aHeight ); |
|
73 |
|
74 /** |
|
75 * Returns index in KPhotoSizes table for given photo resolution |
|
76 * @param aWidth Width |
|
77 * @param aHeight Height |
|
78 * @return Size id, or KErrNotFound |
|
79 */ |
|
80 static TInt CamVideoResolution( TInt aWidth, TInt aHeight ); |
|
81 |
|
82 /** |
|
83 * Returns TSize of for given photo resolution of the KPhotoSizes table |
|
84 * @param Size id |
|
85 * @return TSize resolution, or KErrNotFound |
|
86 */ |
|
87 static TSize CamVideoResolution( TCamVideoResolution aResolution ); |
|
88 |
|
89 /** |
|
90 * |
|
91 * @param aMimeType type |
|
92 * @return Mime type |
|
93 */ |
|
94 static TInt VideoType( const TText8* aMimeType ); |
|
95 |
|
96 /** |
|
97 * Converts CamcorderVisible value into video description id |
|
98 * @param aQualityValue |
|
99 * @return Description id |
|
100 */ |
|
101 static TCamVideoQualityDescription VideoDescId( TInt aQualityValue ); |
|
102 |
|
103 /** |
|
104 * Converts CamcorderVisible value into image type |
|
105 * @param aValue |
|
106 * @return Image type |
|
107 */ |
|
108 static TCamImageType ImageType( TInt aValue ); |
|
109 |
|
110 |
|
111 static TBool IsSupported( TInt aValue, TCamItemType aItemType, |
|
112 const TCamImageQualityData& aData ); |
|
113 |
|
114 /** |
|
115 * Get the scene setting id from dynamic setting id. |
|
116 */ |
|
117 static TInt MapDynamicSettingToSceneSetting( TInt aSettingId ); |
|
118 }; |
|
119 |
|
120 #endif CAMCONFIGURATIONUTILITY_H |
|
121 |
|
122 // End of file |
|
123 |