summaryrefslogtreecommitdiff
path: root/include/camera_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/camera_utils.h')
-rwxr-xr-xinclude/camera_utils.h153
1 files changed, 153 insertions, 0 deletions
diff --git a/include/camera_utils.h b/include/camera_utils.h
new file mode 100755
index 0000000..36e7da3
--- /dev/null
+++ b/include/camera_utils.h
@@ -0,0 +1,153 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __DEF_camera_utils_H_
+#define __DEF_camera_utils_H_
+
+#include <sys/vfs.h>
+
+#include "cam.h"
+
+typedef unsigned char byte;
+
+/* GPS */
+typedef enum {
+ CAM_IMG_ROTATION_LEFT = 0,
+ CAM_IMG_ROTATION_RIGHT,
+} CamRorationAngle;
+
+gboolean cam_utils_check_battery_warning_low(void);
+gboolean cam_utils_check_battery_critical_low(void);
+gboolean cam_utils_check_call_running(void);
+
+
+int cam_utils_get_battery_level(void);
+
+gint cam_utils_get_charging_status(void);
+
+void *cam_utils_YUV422_to_ARGB(byte *frame, int width, int height);
+
+void *cam_utils_IYUV_to_ARGB(byte *frame, int width, int height);
+
+gboolean
+cam_utils_save_to_jpg_file(int storage_id, gchar *filename, void *frame,
+ int width, int height, GError **error);
+
+gboolean
+cam_utils_save_to_jpg_memory(byte **memory, unsigned int *size, void *src_frame,
+ int width, int height);
+
+void
+cam_utils_draw_guide_rectangle(void *data, void *frame, int x_org, int y_org,
+ int width, int height);
+
+void cam_utils_convert_YUYV_to_UYVY(unsigned char *dst, unsigned char *src, gint length); /* fast convert , but lost 1pixel Y data. */
+
+void cam_utils_convert_UYVY_to_YUYV(char *dst, char *src, gint length);
+
+#if 1
+void
+cam_utils_convert_YUYV_to_YUV420P(unsigned char *pInBuf, unsigned char *pOutBuf,
+ int width, int height);
+#else
+void
+cam_utils_convert_YUYV_to_YUV420P(byte *src, byte *dst, gint width,
+ gint height);
+#endif
+
+void *cam_utils_load_fake_yuv_image(); /* This function load memory address of 640*480 yuyv (16bit) image */
+
+void *cam_utils_get_fake_yuv_image();
+
+void cam_utils_free_fake_yuv_image();
+
+guint64 cam_system_get_remain_rec_time(void *data);
+
+gint64 cam_system_get_still_count_by_resolution(void *data);
+
+gint64 cam_get_free_space(const gchar *path);
+
+gint64 cam_get_capacity_space(const gchar *path);
+
+void *cam_utils_load_temp_file(gchar *filepath, gint *pfilesize);
+
+gboolean cam_utils_check_torchlight_status(void *data);
+
+gboolean cam_utils_check_mmc_for_writing(GError **error);
+
+gboolean cam_utils_check_mmc_for_inserted_stats(void *data);
+
+int cam_utils_check_mmc_status(void);
+
+int cam_utils_get_storage_id_from_filepath(const char *filepath);
+
+gboolean cam_utils_safety_file_copy(const char *dst, const char *src,
+ GError **error);
+
+gboolean cam_utils_check_wide_resolution(int resol_w, int resol_h);
+
+gboolean cam_utils_parse_args(int argc, char *argv[], CamExeArgs *args);
+
+gboolean cam_utils_check_fake_image_exist(const char *fake_image_path);
+
+gboolean cam_utils_image_rotate(char *src, int src_width, int src_height,
+ char *dst, int *dst_width, int *dst_height,
+ int degree);
+gboolean cam_utils_set_guide_rect_color(void *data);
+/**
+ * @brief change video stream xy to windos xy
+ * while target is 0 degree(landscape):the coordinate sytem:
+ * win ----------------------------------(width:horizontal)
+ * -offset - video -offset -
+ * -<--->-<--------------->-<----->-
+ * - - - -
+ *height(vertical)----------------------------------
+ * @param[in] faces camera_detected_face_s array
+ * @param[in] count face count
+ * @param[in] data user_data, it should be appdata
+ * @return void
+ */
+void cam_utils_set_videos_xy_to_windows_xy(CamVideoRectangle src,
+ CamVideoRectangle *result,
+ void *data);
+/**
+ * @brief change windos stream xy to video xy
+ * while target is 0 degree(landscape):the coordinate sytem:
+ * win ----------------------------------(width:horizontal)
+ * -offset - video -offset -
+ * -<--->-<--------------->-<----->-
+ * - - - -
+ *height(vertical)----------------------------------
+ * @param[in] faces camera_detected_face_s array
+ * @param[in] count face count
+ * @param[in] data user_data, it should be appdata
+ * @return void
+ */
+
+void cam_utils_set_windows_xy_to_videos_xy(CamVideoRectangle src,
+ CamVideoRectangle *result,
+ void *data);
+/**
+ * @brief send request from child thread to main thread
+ * @param[in] data user_data, it should be appdata
+ * @param[in] pipe_data passing data : child thread to main thread
+ * @param[in] cmd the operation command
+ * @return void
+ */
+gboolean cam_utils_request_main_pipe_handler(void *data, void *pipe_data, int cmd);
+
+#endif /* __DEF_camera_utils_H__ */