2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
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.
18 #ifndef __DEF_camera_utils_H_
19 #define __DEF_camera_utils_H_
25 typedef unsigned char byte;
29 CAM_IMG_ROTATION_LEFT = 0,
30 CAM_IMG_ROTATION_RIGHT,
33 gboolean cam_utils_check_battery_warning_low(void);
34 gboolean cam_utils_check_battery_critical_low(void);
37 int cam_utils_get_battery_level(void);
39 gint cam_utils_get_charging_status(void);
41 void *cam_utils_YUV422_to_ARGB(byte *frame, int width, int height);
43 void *cam_utils_IYUV_to_ARGB(byte *frame, int width, int height);
46 cam_utils_save_to_jpg_file(int storage_id, gchar *filename, void *frame,
47 int width, int height, GError **error);
50 cam_utils_save_to_jpg_memory(byte **memory, unsigned int *size, void *src_frame,
51 int width, int height);
54 cam_utils_draw_guide_rectangle(void *data, void *frame, int x_org, int y_org,
55 int width, int height);
57 void cam_utils_convert_YUYV_to_UYVY(unsigned char *dst, unsigned char *src, gint length); /* fast convert , but lost 1pixel Y data. */
59 void cam_utils_convert_UYVY_to_YUYV(char *dst, char *src, gint length);
63 cam_utils_convert_YUYV_to_YUV420P(unsigned char *pInBuf, unsigned char *pOutBuf,
64 int width, int height);
67 cam_utils_convert_YUYV_to_YUV420P(byte *src, byte *dst, gint width,
71 void *cam_utils_load_fake_yuv_image(); /* This function load memory address of 640*480 yuyv (16bit) image */
73 void *cam_utils_get_fake_yuv_image();
75 void cam_utils_free_fake_yuv_image();
77 guint64 cam_system_get_remain_rec_time(void *data);
79 gint64 cam_system_get_still_count_by_resolution(void *data);
81 gint64 cam_get_free_space(const gchar *path);
83 gint64 cam_get_capacity_space(const gchar *path);
85 void *cam_utils_load_temp_file(gchar *filepath, gint *pfilesize);
87 gboolean cam_utils_check_torchlight_status(void *data);
89 gboolean cam_utils_check_mmc_for_writing(GError **error);
91 gboolean cam_utils_check_mmc_for_inserted_stats(void *data);
93 int cam_utils_check_mmc_status(void);
95 int cam_utils_get_storage_id_from_filepath(const char *filepath);
97 gboolean cam_utils_safety_file_copy(const char *dst, const char *src,
100 gboolean cam_utils_check_wide_resolution(int resol_w, int resol_h);
102 gboolean cam_utils_parse_args(int argc, char *argv[], CamExeArgs *args);
104 gboolean cam_utils_check_fake_image_exist(const char *fake_image_path);
106 int cam_utils_captured_image_select(void *data, const char *file_path);
108 gboolean cam_utils_image_rotate(char *src, int src_width, int src_height,
109 char *dst, int *dst_width, int *dst_height,
111 gboolean cam_utils_set_guide_rect_color(void *data);
113 * @brief change video stream xy to windos xy
114 * while target is 0 degree(landscape):the coordinate sytem:
115 * win ----------------------------------(width:horizontal)
116 * -offset - video -offset -
117 * -<--->-<--------------->-<----->-
119 *height(vertical)----------------------------------
120 * @param[in] faces camera_detected_face_s array
121 * @param[in] count face count
122 * @param[in] data user_data, it should be appdata
125 void cam_utils_set_videos_xy_to_windows_xy(CamVideoRectangle src,
126 CamVideoRectangle *result,
129 * @brief change windos stream xy to video xy
130 * while target is 0 degree(landscape):the coordinate sytem:
131 * win ----------------------------------(width:horizontal)
132 * -offset - video -offset -
133 * -<--->-<--------------->-<----->-
135 *height(vertical)----------------------------------
136 * @param[in] faces camera_detected_face_s array
137 * @param[in] count face count
138 * @param[in] data user_data, it should be appdata
142 void cam_utils_set_windows_xy_to_videos_xy(CamVideoRectangle src,
143 CamVideoRectangle *result,
147 #endif /* __DEF_camera_utils_H__ */