#include <image_util_type.h>
#include <dlog.h>
-#include <stdlib.h>
-#include <fcntl.h>
#include <glib.h>
#include <mm_util_imgp.h>
#define NUM_OF_COLORSPACE _get_number_of_colorspace()
-typedef gboolean(*ModuleFunc)(void *, int, int, unsigned char *, unsigned char *, unsigned char *);
-
typedef struct {
/* for converting colorspace */
mm_util_color_format_e color;
GAsyncQueue *queue;
} transformation_s;
-typedef struct {
- void *user_data;
- image_util_decode_completed_cb image_decode_completed_cb;
-} decode_cb_s;
-
-typedef struct {
- void *user_data;
- image_util_decode_completed2_cb image_decode_completed_cb;
-} decode2_cb_s;
-
-typedef struct {
- void *user_data;
- image_util_encode_completed_cb image_encode_completed_cb;
-} encode_cb_s;
-
-typedef struct {
- void *user_data;
- image_util_encode_to_file_completed_cb image_encode_to_file_cb;
-} encode_to_file_cb_s;
-
-typedef struct {
- void *user_data;
- image_util_encode_to_buffer_completed_cb image_encode_to_buffer_cb;
-} encode_to_buffer_cb_s;
-
-typedef struct {
- mm_image_info_s **sources;
- unsigned int source_count;
- void *gif_image_h;
- size_t gif_encode_size;
- unsigned int current_buffer_count;
- unsigned int current_resolution_count;
- unsigned int current_delay_count;
-} gif_encode_s;
-
-typedef struct {
- image_util_type_e image_type;
- mm_image_info_s src;
- void **dst_buffer;
- size_t dst_size;
- gchar *path;
- int quality;
- image_util_png_compression_e compression;
- gif_encode_s gif_encode_info;
- encode_cb_s *_encode_cb;
-
- /* for async */
- GThread *thread;
- image_util_image_h new_src;
- encode_to_file_cb_s *encode_to_file_cb;
- encode_to_buffer_cb_s *encode_to_buffer_cb;
-} encode_s;
-
-typedef struct {
- image_util_type_e image_type;
- void *src_buffer;
- size_t src_size;
- void **dst_buffer;
- char *path;
- image_util_colorspace_e colorspace;
- image_util_scale_e down_scale;
- decode_cb_s *_decode_cb;
-
- /* for async */
- GThread *thread;
- gboolean is_decode2;
- decode2_cb_s *decode2_cb;
-} decode_s;
-
#define IMAGE_UTIL_TYPE_CHECK(type) \
image_util_retvm_if((type < IMAGE_UTIL_JPEG || type > IMAGE_UTIL_BMP), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid image type [%d]", type)
gboolean is_transform2;
} t_data_s;
+typedef gboolean(*ModuleFunc)(void *, int, int, unsigned char *, unsigned char *, unsigned char *);
+
static int __mm_util_transform(transformation_h handle, image_util_image_h origin, image_util_image_h *transform)
{
int ret = IMAGE_UTIL_ERROR_NONE;
#include <image_util.h>
#include <image_util_private.h>
+typedef struct {
+ void *user_data;
+ image_util_decode_completed_cb image_decode_completed_cb;
+} decode_cb_s;
+
+typedef struct {
+ void *user_data;
+ image_util_decode_completed2_cb image_decode_completed_cb;
+} decode2_cb_s;
+
+typedef struct {
+ image_util_type_e image_type;
+ void *src_buffer;
+ size_t src_size;
+ void **dst_buffer;
+ char *path;
+ image_util_colorspace_e colorspace;
+ image_util_scale_e down_scale;
+ decode_cb_s *_decode_cb;
+
+ /* for async */
+ GThread *thread;
+ gboolean is_decode2;
+ decode2_cb_s *decode2_cb;
+} decode_s;
+
static int _convert_decode_scale_tbl[] = {
MM_UTIL_JPEG_DECODE_DOWNSCALE_1_1,
MM_UTIL_JPEG_DECODE_DOWNSCALE_1_2,
#include <image_util.h>
#include <image_util_private.h>
+typedef struct {
+ void *user_data;
+ image_util_encode_completed_cb image_encode_completed_cb;
+} encode_cb_s;
+
+typedef struct {
+ void *user_data;
+ image_util_encode_to_file_completed_cb image_encode_to_file_cb;
+} encode_to_file_cb_s;
+
+typedef struct {
+ void *user_data;
+ image_util_encode_to_buffer_completed_cb image_encode_to_buffer_cb;
+} encode_to_buffer_cb_s;
+
+typedef struct {
+ mm_image_info_s **sources;
+ unsigned int source_count;
+ void *gif_image_h;
+ size_t gif_encode_size;
+ unsigned int current_buffer_count;
+ unsigned int current_resolution_count;
+ unsigned int current_delay_count;
+} gif_encode_s;
+
+typedef struct {
+ image_util_type_e image_type;
+ mm_image_info_s src;
+ void **dst_buffer;
+ size_t dst_size;
+ gchar *path;
+ int quality;
+ image_util_png_compression_e compression;
+ gif_encode_s gif_encode_info;
+ encode_cb_s *_encode_cb;
+
+ /* for async */
+ GThread *thread;
+ image_util_image_h new_src;
+ encode_to_file_cb_s *encode_to_file_cb;
+ encode_to_buffer_cb_s *encode_to_buffer_cb;
+} encode_s;
+
static gboolean __is_invalid_image_info(mm_image_info_s image_info)
{
if (image_info.width == 0 || image_info.height == 0 || image_info.data == NULL)