2 * Copyright (C) 2013 Canonical Ltd
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 * Authored by: Thomas Voss <thomas.voss@canonical.com>
19 #ifndef CAMERA_COMPATIBILITY_LAYER_CONFIGURATION_H_
20 #define CAMERA_COMPATIBILITY_LAYER_CONFIGURATION_H_
38 WHITE_BALANCE_MODE_AUTO
,
39 WHITE_BALANCE_MODE_DAYLIGHT
,
40 WHITE_BALANCE_MODE_CLOUDY_DAYLIGHT
,
41 WHITE_BALANCE_MODE_FLUORESCENT
,
42 WHITE_BALANCE_MODE_INCANDESCENT
57 AUTO_FOCUS_MODE_CONTINUOUS_VIDEO
,
59 AUTO_FOCUS_MODE_MACRO
,
60 AUTO_FOCUS_MODE_CONTINUOUS_PICTURE
,
61 AUTO_FOCUS_MODE_INFINITY
71 EFFECT_MODE_POSTERIZE
,
72 EFFECT_MODE_WHITEBOARD
,
73 EFFECT_MODE_BLACKBOARD
,
79 CAMERA_PIXEL_FORMAT_YUV422SP
,
80 CAMERA_PIXEL_FORMAT_YUV420SP
,
81 CAMERA_PIXEL_FORMAT_YUV422I
,
82 CAMERA_PIXEL_FORMAT_YUV420P
,
83 CAMERA_PIXEL_FORMAT_RGB565
,
84 CAMERA_PIXEL_FORMAT_RGBA8888
,
85 CAMERA_PIXEL_FORMAT_BAYER_RGGB
97 typedef void (*size_callback
)(void* ctx
, int width
, int height
);
99 // Dumps the camera parameters to stdout.
100 void android_camera_dump_parameters(struct CameraControl
* control
);
102 // Query camera parameters
103 int android_camera_get_number_of_devices();
104 void android_camera_enumerate_supported_preview_sizes(struct CameraControl
* control
, size_callback cb
, void* ctx
);
105 void android_camera_get_preview_fps_range(struct CameraControl
* control
, int* min
, int* max
);
106 void android_camera_get_preview_fps(struct CameraControl
* control
, int* fps
);
107 void android_camera_enumerate_supported_picture_sizes(struct CameraControl
* control
, size_callback cb
, void* ctx
);
108 void android_camera_get_preview_size(struct CameraControl
* control
, int* width
, int* height
);
109 void android_camera_get_picture_size(struct CameraControl
* control
, int* width
, int* height
);
111 void android_camera_get_current_zoom(struct CameraControl
* control
, int* zoom
);
112 void android_camera_get_max_zoom(struct CameraControl
* control
, int* max_zoom
);
114 void android_camera_get_effect_mode(struct CameraControl
* control
, EffectMode
* mode
);
115 void android_camera_get_flash_mode(struct CameraControl
* control
, FlashMode
* mode
);
116 void android_camera_get_white_balance_mode(struct CameraControl
* control
, WhiteBalanceMode
* mode
);
117 void android_camera_get_scene_mode(struct CameraControl
* control
, SceneMode
* mode
);
118 void android_camera_get_auto_focus_mode(struct CameraControl
* control
, AutoFocusMode
* mode
);
119 void android_camera_get_preview_format(struct CameraControl
* control
, CameraPixelFormat
* format
);
121 // Adjusts camera parameters
122 void android_camera_set_preview_size(struct CameraControl
* control
, int width
, int height
);
123 void android_camera_set_preview_fps(struct CameraControl
* control
, int fps
);
124 void android_camera_set_picture_size(struct CameraControl
* control
, int width
, int height
);
125 void android_camera_set_effect_mode(struct CameraControl
* control
, EffectMode mode
);
126 void android_camera_set_flash_mode(struct CameraControl
* control
, FlashMode mode
);
127 void android_camera_set_white_balance_mode(struct CameraControl
* control
, WhiteBalanceMode mode
);
128 void android_camera_set_scene_mode(struct CameraControl
* control
, SceneMode mode
);
129 void android_camera_set_auto_focus_mode(struct CameraControl
* control
, AutoFocusMode mode
);
130 void android_camera_set_preview_format(struct CameraControl
* control
, CameraPixelFormat format
);
132 void android_camera_set_focus_region(struct CameraControl
* control
, FocusRegion
* region
);
133 void android_camera_reset_focus_region(struct CameraControl
* control
);
135 // Set photo metadata
136 void android_camera_set_rotation(struct CameraControl
* control
, int rotation
);
139 void android_camera_enumerate_supported_video_sizes(struct CameraControl
* control
, size_callback cb
, void* ctx
);
140 void android_camera_get_video_size(struct CameraControl
* control
, int* width
, int* height
);
141 void android_camera_set_video_size(struct CameraControl
* control
, int width
, int height
);
147 #endif // CAMERA_COMPATIBILITY_LAYER_CONFIGURATION_H_