1/*
2** Copyright 2008, The Android Open Source Project
3**
4** Licensed under the Apache License, Version 2.0 (the "License");
5** you may not use this file except in compliance with the License.
6** You may obtain a copy of the License at
7**
8**     http://www.apache.org/licenses/LICENSE-2.0
9**
10** Unless required by applicable law or agreed to in writing, software
11** distributed under the License is distributed on an "AS IS" BASIS,
12** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13** See the License for the specific language governing permissions and
14** limitations under the License.
15*/
16
17#ifndef ANDROID_HARDWARE_QCAMERA_PARAMETERS_H
18#define ANDROID_HARDWARE_QCAMERA_PARAMETERS_H
19
20// Camera dependencies
21#include <CameraParameters.h>
22
23using ::android::hardware::camera::common::V1_0::helper::CameraParameters;
24using ::android::hardware::camera::common::V1_0::helper::Size;
25
26namespace android {
27
28struct FPSRange{
29    int minFPS;
30    int maxFPS;
31    FPSRange(){
32        minFPS=0;
33        maxFPS=0;
34    };
35    FPSRange(int min,int max){
36        minFPS=min;
37        maxFPS=max;
38    };
39};
40class QCameraParameters: public CameraParameters
41{
42public:
43#if 1
44    QCameraParameters() : CameraParameters() {};
45    QCameraParameters(const String8 &params): CameraParameters(params) {};
46    #else
47    QCameraParameters() : CameraParameters() {};
48    QCameraParameters(const String8 &params) { unflatten(params); }
49#endif
50    ~QCameraParameters();
51
52    // Supported PREVIEW/RECORDING SIZES IN HIGH FRAME RATE recording, sizes in pixels.
53    // Example value: "800x480,432x320". Read only.
54    static const char KEY_SUPPORTED_HFR_SIZES[];
55    // The mode of preview frame rate.
56    // Example value: "frame-rate-auto, frame-rate-fixed".
57    static const char KEY_PREVIEW_FRAME_RATE_MODE[];
58    static const char KEY_SUPPORTED_PREVIEW_FRAME_RATE_MODES[];
59    static const char KEY_PREVIEW_FRAME_RATE_AUTO_MODE[];
60    static const char KEY_PREVIEW_FRAME_RATE_FIXED_MODE[];
61
62    static const char KEY_SKIN_TONE_ENHANCEMENT[] ;
63    static const char KEY_SUPPORTED_SKIN_TONE_ENHANCEMENT_MODES[] ;
64
65    //Touch Af/AEC settings.
66    static const char KEY_TOUCH_AF_AEC[];
67    static const char KEY_SUPPORTED_TOUCH_AF_AEC[];
68    //Touch Index for AEC.
69    static const char KEY_TOUCH_INDEX_AEC[];
70    //Touch Index for AF.
71    static const char KEY_TOUCH_INDEX_AF[];
72    // Current auto scene detection mode.
73    // Example value: "off" or SCENE_DETECT_XXX constants. Read/write.
74    static const char KEY_SCENE_DETECT[];
75    // Supported auto scene detection settings.
76    // Example value: "off,backlight,snow/cloudy". Read only.
77    static const char KEY_SUPPORTED_SCENE_DETECT[];
78	   // Returns true if video snapshot is supported. That is, applications
79    static const char KEY_FULL_VIDEO_SNAP_SUPPORTED[];
80    static const char KEY_POWER_MODE_SUPPORTED[];
81
82    static const char KEY_ISO_MODE[];
83    static const char KEY_SUPPORTED_ISO_MODES[];
84    static const char KEY_LENSSHADE[] ;
85    static const char KEY_SUPPORTED_LENSSHADE_MODES[] ;
86
87    static const char KEY_AUTO_EXPOSURE[];
88    static const char KEY_SUPPORTED_AUTO_EXPOSURE[];
89
90    static const char KEY_GPS_LATITUDE_REF[];
91    static const char KEY_GPS_LONGITUDE_REF[];
92    static const char KEY_GPS_ALTITUDE_REF[];
93    static const char KEY_GPS_STATUS[];
94    static const char KEY_EXIF_DATETIME[];
95    static const char KEY_MEMORY_COLOR_ENHANCEMENT[];
96    static const char KEY_SUPPORTED_MEM_COLOR_ENHANCE_MODES[];
97
98
99    static const char KEY_POWER_MODE[];
100
101    static const char KEY_ZSL[];
102    static const char KEY_SUPPORTED_ZSL_MODES[];
103
104    static const char KEY_CAMERA_MODE[];
105
106    static const char KEY_VIDEO_HIGH_FRAME_RATE[];
107    static const char KEY_SUPPORTED_VIDEO_HIGH_FRAME_RATE_MODES[];
108    static const char KEY_HIGH_DYNAMIC_RANGE_IMAGING[];
109    static const char KEY_SUPPORTED_HDR_IMAGING_MODES[];
110    static const char KEY_AE_BRACKET_HDR[];
111
112
113    // DENOISE
114    static const char KEY_DENOISE[];
115    static const char KEY_SUPPORTED_DENOISE[];
116
117    //Selectable zone AF.
118    static const char KEY_SELECTABLE_ZONE_AF[];
119    static const char KEY_SUPPORTED_SELECTABLE_ZONE_AF[];
120
121    //Face Detection
122    static const char KEY_FACE_DETECTION[];
123    static const char KEY_SUPPORTED_FACE_DETECTION[];
124
125    //Redeye Reduction
126    static const char KEY_REDEYE_REDUCTION[];
127    static const char KEY_SUPPORTED_REDEYE_REDUCTION[];
128    static const char EFFECT_EMBOSS[];
129    static const char EFFECT_SKETCH[];
130    static const char EFFECT_NEON[];
131
132    // Values for Touch AF/AEC
133    static const char TOUCH_AF_AEC_OFF[] ;
134    static const char TOUCH_AF_AEC_ON[] ;
135    static const char SCENE_MODE_ASD[];
136    static const char SCENE_MODE_BACKLIGHT[];
137    static const char SCENE_MODE_FLOWERS[];
138    static const char SCENE_MODE_AR[];
139    static const char SCENE_MODE_HDR[];
140	static const char SCENE_DETECT_OFF[];
141    static const char SCENE_DETECT_ON[];
142    static const char PIXEL_FORMAT_YUV420SP_ADRENO[]; // ADRENO
143	static const char PIXEL_FORMAT_RAW[];
144    static const char PIXEL_FORMAT_YV12[]; // NV12
145    static const char PIXEL_FORMAT_NV12[]; //NV12
146    // Normal focus mode. Applications should call
147    // CameraHardwareInterface.autoFocus to start the focus in this mode.
148    static const char FOCUS_MODE_NORMAL[];
149    static const char ISO_AUTO[];
150    static const char ISO_HJR[] ;
151    static const char ISO_100[];
152    static const char ISO_200[] ;
153    static const char ISO_400[];
154    static const char ISO_800[];
155    static const char ISO_1600[];
156    // Values for Lens Shading
157    static const char LENSSHADE_ENABLE[] ;
158    static const char LENSSHADE_DISABLE[] ;
159
160    // Values for auto exposure settings.
161    static const char AUTO_EXPOSURE_FRAME_AVG[];
162    static const char AUTO_EXPOSURE_CENTER_WEIGHTED[];
163    static const char AUTO_EXPOSURE_SPOT_METERING[];
164
165    static const char KEY_SHARPNESS[];
166    static const char KEY_MAX_SHARPNESS[];
167    static const char KEY_CONTRAST[];
168    static const char KEY_MAX_CONTRAST[];
169    static const char KEY_SATURATION[];
170    static const char KEY_MAX_SATURATION[];
171
172    static const char KEY_HISTOGRAM[] ;
173    static const char KEY_SUPPORTED_HISTOGRAM_MODES[] ;
174    // Values for HISTOGRAM
175    static const char HISTOGRAM_ENABLE[] ;
176    static const char HISTOGRAM_DISABLE[] ;
177
178    // Values for SKIN TONE ENHANCEMENT
179    static const char SKIN_TONE_ENHANCEMENT_ENABLE[] ;
180    static const char SKIN_TONE_ENHANCEMENT_DISABLE[] ;
181
182    // Values for Denoise
183    static const char DENOISE_OFF[] ;
184    static const char DENOISE_ON[] ;
185
186    // Values for auto exposure settings.
187    static const char SELECTABLE_ZONE_AF_AUTO[];
188    static const char SELECTABLE_ZONE_AF_SPOT_METERING[];
189    static const char SELECTABLE_ZONE_AF_CENTER_WEIGHTED[];
190    static const char SELECTABLE_ZONE_AF_FRAME_AVERAGE[];
191
192    // Values for Face Detection settings.
193    static const char FACE_DETECTION_OFF[];
194    static const char FACE_DETECTION_ON[];
195
196    // Values for MCE settings.
197    static const char MCE_ENABLE[];
198    static const char MCE_DISABLE[];
199
200    // Values for ZSL settings.
201    static const char ZSL_OFF[];
202    static const char ZSL_ON[];
203
204    // Values for HDR Bracketing settings.
205    static const char AE_BRACKET_HDR_OFF[];
206    static const char AE_BRACKET_HDR[];
207    static const char AE_BRACKET[];
208
209    // Values for Power mode settings.
210    static const char LOW_POWER[];
211    static const char NORMAL_POWER[];
212
213    // Values for HFR settings.
214    static const char VIDEO_HFR_OFF[];
215    static const char VIDEO_HFR_2X[];
216    static const char VIDEO_HFR_3X[];
217    static const char VIDEO_HFR_4X[];
218
219    // Values for Redeye Reduction settings.
220    static const char REDEYE_REDUCTION_ENABLE[];
221    static const char REDEYE_REDUCTION_DISABLE[];
222    // Values for HDR settings.
223    static const char HDR_ENABLE[];
224    static const char HDR_DISABLE[];
225
226   // Values for Redeye Reduction settings.
227   // static const char REDEYE_REDUCTION_ENABLE[];
228   // static const char REDEYE_REDUCTION_DISABLE[];
229   // Values for HDR settings.
230   //    static const char HDR_ENABLE[];
231   //    static const char HDR_DISABLE[];
232
233
234   static const char KEY_SINGLE_ISP_OUTPUT_ENABLED[];
235   static const char KEY_SUPPORTED_CAMERA_FEATURES[];
236   static const char KEY_MAX_NUM_REQUESTED_FACES[];
237
238    enum {
239        CAMERA_ORIENTATION_UNKNOWN = 0,
240        CAMERA_ORIENTATION_PORTRAIT = 1,
241        CAMERA_ORIENTATION_LANDSCAPE = 2,
242    };
243    int getOrientation() const;
244    void setOrientation(int orientation);
245    void getSupportedHfrSizes(Vector<Size> &sizes) const;
246    void setPreviewFpsRange(int minFPS,int maxFPS);
247	void setPreviewFrameRateMode(const char *mode);
248    const char *getPreviewFrameRateMode() const;
249    void setTouchIndexAec(int x, int y);
250    void getTouchIndexAec(int *x, int *y) const;
251    void setTouchIndexAf(int x, int y);
252    void getTouchIndexAf(int *x, int *y) const;
253    void getMeteringAreaCenter(int * x, int *y) const;
254
255};
256
257}; // namespace android
258
259#endif
260