Ephoto: Ecrustify Formatting

v-1.6.0
Stephen 'Okra' Houston 6 years ago
parent ab43168f90
commit a705f9a626
  1. 60
      src/bin/ephoto.c
  2. 401
      src/bin/ephoto.h
  3. 261
      src/bin/ephoto_bcg.c
  4. 130
      src/bin/ephoto_color.c
  5. 343
      src/bin/ephoto_config.c
  6. 369
      src/bin/ephoto_cropper.c
  7. 459
      src/bin/ephoto_directory_browser.c
  8. 22
      src/bin/ephoto_editor.c
  9. 750
      src/bin/ephoto_file.c
  10. 285
      src/bin/ephoto_filters.c
  11. 275
      src/bin/ephoto_hsv.c
  12. 4
      src/bin/ephoto_ipc.c
  13. 431
      src/bin/ephoto_main.c
  14. 125
      src/bin/ephoto_red_eye.c
  15. 96
      src/bin/ephoto_scale.c
  16. 1054
      src/bin/ephoto_single_browser.c
  17. 663
      src/bin/ephoto_slideshow.c
  18. 3
      src/bin/ephoto_thumb.c
  19. 790
      src/bin/ephoto_thumb_browser.c
  20. 33
      src/bin/ephoto_thumbnailer.c

@ -30,50 +30,50 @@ elm_main(int argc, char **argv)
if (argc > 2)
{
printf("Too Many Arguments!\n");
_ephoto_display_usage();
r = 1;
goto end;
printf("Too Many Arguments!\n");
_ephoto_display_usage();
r = 1;
goto end;
}
else if (argc < 2)
{
Evas_Object *win = ephoto_window_add(NULL);
Evas_Object *win = ephoto_window_add(NULL);
if (!win)
{
r = 1;
goto end;
}
if (!win)
{
r = 1;
goto end;
}
}
else if (!strncmp(argv[1], "--help", 6))
{
_ephoto_display_usage();
r = 0;
goto end;
_ephoto_display_usage();
r = 0;
goto end;
}
else
{
char *real = ecore_file_realpath(argv[1]);
char *real = ecore_file_realpath(argv[1]);
if (!real)
{
printf("invalid file or directory: '%s'\n", argv[1]);
r = 1;
goto end;
}
Evas_Object *win = ephoto_window_add(real);
if (!real)
{
printf("invalid file or directory: '%s'\n", argv[1]);
r = 1;
goto end;
}
Evas_Object *win = ephoto_window_add(real);
free(real);
if (!win)
{
r = 1;
goto end;
}
free(real);
if (!win)
{
r = 1;
goto end;
}
}
elm_run();
end:
end:
e_thumb_shutdown();
efreet_mime_shutdown();
eio_shutdown();
@ -86,8 +86,8 @@ static void
_ephoto_display_usage(void)
{
printf("Ephoto Usage: \n" "ephoto --help : This page\n"
"ephoto filename : Specifies a file to open\n"
"ephoto dirname : Specifies a directory to open\n");
"ephoto filename : Specifies a file to open\n"
"ephoto dirname : Specifies a directory to open\n");
}
ELM_MAIN()

@ -31,148 +31,148 @@
#if HAVE_GETTEXT && ENABLE_NLS
# include <libintl.h>
# define _(string) gettext (string)
# define _(string) gettext(string)
#else
# define _(string) (string)
# define _(string) (string)
# define ngettext(String1, String2, Var) Var == 1 ? String1 : String2
#endif
# define USE_IPC
/*local types*/
typedef struct _Ephoto_Config Ephoto_Config;
typedef struct _Ephoto Ephoto;
typedef struct _Ephoto_Entry Ephoto_Entry;
typedef struct _Ephoto_Config Ephoto_Config;
typedef struct _Ephoto Ephoto;
typedef struct _Ephoto_Entry Ephoto_Entry;
typedef struct _Ephoto_Event_Entry_Create Ephoto_Event_Entry_Create;
typedef enum _Ephoto_State Ephoto_State;
typedef enum _Ephoto_Orient Ephoto_Orient;
typedef enum _Ephoto_Sort Ephoto_Sort;
typedef enum _Ephoto_Ipc_Domain Ephoto_Ipc_Domain;
typedef enum _Ephoto_State Ephoto_State;
typedef enum _Ephoto_Orient Ephoto_Orient;
typedef enum _Ephoto_Sort Ephoto_Sort;
typedef enum _Ephoto_Ipc_Domain Ephoto_Ipc_Domain;
/*main window functions*/
Evas_Object *ephoto_window_add(const char *path);
void ephoto_title_set(Ephoto *ephoto, const char *title);
void ephoto_thumb_size_set(Ephoto *ephoto, int size);
void ephoto_title_set(Ephoto *ephoto, const char *title);
void ephoto_thumb_size_set(Ephoto *ephoto, int size);
Evas_Object *ephoto_thumb_add(Ephoto *ephoto, Evas_Object *parent,
Ephoto_Entry *entry);
void ephoto_directory_set(Ephoto *ephoto, const char *path,
Elm_Object_Item *expanded, Eina_Bool dirs_only, Eina_Bool thumbs_only);
void ephoto_show_folders(Ephoto *ephoto, Eina_Bool toggle);
Ephoto_Entry *entry);
void ephoto_directory_set(Ephoto *ephoto, const char *path,
Elm_Object_Item *expanded, Eina_Bool dirs_only, Eina_Bool thumbs_only);
void ephoto_show_folders(Ephoto *ephoto, Eina_Bool toggle);
/*config panel functions*/
Eina_Bool ephoto_config_init(Ephoto *em);
void ephoto_config_save(Ephoto *em);
void ephoto_config_free(Ephoto *em);
void ephoto_config_main(Ephoto *em);
Eina_Bool ephoto_config_init(Ephoto *em);
void ephoto_config_save(Ephoto *em);
void ephoto_config_free(Ephoto *em);
void ephoto_config_main(Ephoto *em);
/*single image functions*/
Evas_Object *ephoto_single_browser_add(Ephoto *ephoto, Evas_Object *parent);
void ephoto_single_browser_show_controls(Ephoto *ephoto);
void ephoto_single_browser_entries_set(Evas_Object *obj, Eina_List *entries);
void ephoto_single_browser_entry_set(Evas_Object *obj, Ephoto_Entry *entry);
void ephoto_single_browser_focus_set(Ephoto *ephoto);
void ephoto_single_browser_path_pending_set(Evas_Object *obj,
const char *path);
void ephoto_single_browser_path_pending_unset(Evas_Object *obj);
void ephoto_single_browser_path_created(Evas_Object *obj, Ephoto_Entry *entry);
void ephoto_single_browser_image_data_update(Evas_Object *main,
Evas_Object *image, unsigned int *image_data, Evas_Coord w, Evas_Coord h);
void ephoto_single_browser_image_data_done(Evas_Object *main,
unsigned int *image_data, Evas_Coord w, Evas_Coord h);
void ephoto_single_browser_cancel_editing(Evas_Object *main);
void ephoto_single_browser_slideshow(Evas_Object *obj);
void ephoto_single_browser_show_controls(Ephoto *ephoto);
void ephoto_single_browser_entries_set(Evas_Object *obj, Eina_List *entries);
void ephoto_single_browser_entry_set(Evas_Object *obj, Ephoto_Entry *entry);
void ephoto_single_browser_focus_set(Ephoto *ephoto);
void ephoto_single_browser_path_pending_set(Evas_Object *obj,
const char *path);
void ephoto_single_browser_path_pending_unset(Evas_Object *obj);
void ephoto_single_browser_path_created(Evas_Object *obj, Ephoto_Entry *entry);
void ephoto_single_browser_image_data_update(Evas_Object *main,
Evas_Object *image, unsigned int *image_data, Evas_Coord w, Evas_Coord h);
void ephoto_single_browser_image_data_done(Evas_Object *main,
unsigned int *image_data, Evas_Coord w, Evas_Coord h);
void ephoto_single_browser_cancel_editing(Evas_Object *main);
void ephoto_single_browser_slideshow(Evas_Object *obj);
/* smart callbacks called: "back" - the user wants to go back to the previous
* screen. */
/*slideshow functions*/
Evas_Object *ephoto_slideshow_add(Ephoto *ephoto, Evas_Object *parent);
void ephoto_slideshow_entries_set(Evas_Object *obj, Eina_List *entries);
void ephoto_slideshow_entry_set(Evas_Object *obj, Ephoto_Entry *entry);
void ephoto_slideshow_show_controls(Ephoto *ephoto);
void ephoto_slideshow_entries_set(Evas_Object *obj, Eina_List *entries);
void ephoto_slideshow_entry_set(Evas_Object *obj, Ephoto_Entry *entry);
void ephoto_slideshow_show_controls(Ephoto *ephoto);
/* smart callbacks called: "back" - the user wants to go back to the previous
* screen. */
/*thumbnail browser functions*/
Evas_Object *ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object *parent);
void ephoto_thumb_browser_show_controls(Ephoto *ephoto);
void ephoto_thumb_browser_insert(Ephoto *ephoto, Ephoto_Entry *entry);
void ephoto_thumb_browser_remove(Ephoto *ephoto, Ephoto_Entry *entry);
void ephoto_thumb_browser_update(Ephoto *ephoto, Ephoto_Entry *entry);
void ephoto_thumb_browser_update_info_label(Ephoto *ephoto);
void ephoto_thumb_browser_slideshow(Evas_Object *obj);
void ephoto_thumb_browser_paste(Ephoto *ephoto, Elm_Object_Item *item);
void ephoto_thumb_browser_clear(Ephoto *ephoto);
void ephoto_thumb_browser_recalc(Ephoto *ephoto);
void ephoto_thumb_browser_dirs_only_set(Ephoto *ephoto, Eina_Bool dirs_only);
void ephoto_thumb_browser_show_controls(Ephoto *ephoto);
void ephoto_thumb_browser_insert(Ephoto *ephoto, Ephoto_Entry *entry);
void ephoto_thumb_browser_remove(Ephoto *ephoto, Ephoto_Entry *entry);
void ephoto_thumb_browser_update(Ephoto *ephoto, Ephoto_Entry *entry);
void ephoto_thumb_browser_update_info_label(Ephoto *ephoto);
void ephoto_thumb_browser_slideshow(Evas_Object *obj);
void ephoto_thumb_browser_paste(Ephoto *ephoto, Elm_Object_Item *item);
void ephoto_thumb_browser_clear(Ephoto *ephoto);
void ephoto_thumb_browser_recalc(Ephoto *ephoto);
void ephoto_thumb_browser_dirs_only_set(Ephoto *ephoto, Eina_Bool dirs_only);
/* smart callbacks called: "selected" - an item in the thumb browser is
* selected. The selected Ephoto_Entry is passed as event_info argument. */
/*directory browser functions*/
Evas_Object *ephoto_directory_browser_add(Ephoto *ephoto, Evas_Object *parent);
void ephoto_directory_browser_initialize_structure(Ephoto *ephoto);
void ephoto_directory_browser_top_dir_set(Ephoto *ephoto, const char *dir);
void ephoto_directory_browser_clear(Ephoto *ephoto);
void ephoto_directory_browser_initialize_structure(Ephoto *ephoto);
void ephoto_directory_browser_top_dir_set(Ephoto *ephoto, const char *dir);
void ephoto_directory_browser_clear(Ephoto *ephoto);
/*thumbnailing functions taken from enlightenment*/
int e_thumb_init(void);
int e_thumb_shutdown(void);
int e_thumb_init(void);
int e_thumb_shutdown(void);
Evas_Object *e_thumb_icon_add(Evas *evas, Eina_Bool aspect);
void e_thumb_icon_file_set(Evas_Object *obj, const char *file, const char *key);
void e_thumb_icon_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
void e_thumb_icon_begin(Evas_Object *obj);
void e_thumb_icon_end(Evas_Object *obj);
void e_thumb_icon_rethumb(Evas_Object *obj);
const char *e_thumb_sort_id_get(Evas_Object *obj);
void e_thumb_client_data(Ecore_Ipc_Event_Client_Data *e);
void e_thumb_client_del(Ecore_Ipc_Event_Client_Del *e);
int e_ipc_init(void);
int e_ipc_shutdown(void);
void e_thumb_icon_file_set(Evas_Object *obj, const char *file, const char *key);
void e_thumb_icon_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
void e_thumb_icon_begin(Evas_Object *obj);
void e_thumb_icon_end(Evas_Object *obj);
void e_thumb_icon_rethumb(Evas_Object *obj);
const char *e_thumb_sort_id_get(Evas_Object *obj);
void e_thumb_client_data(Ecore_Ipc_Event_Client_Data *e);
void e_thumb_client_del(Ecore_Ipc_Event_Client_Del *e);
int e_ipc_init(void);
int e_ipc_shutdown(void);
/*editing functions*/
Evas_Object *ephoto_editor_add(Ephoto *ephoto, Evas_Object *parent, const char *title,
const char *data_name, void *data);
void ephoto_editor_del(Evas_Object *obj, Evas_Object *parent);
void ephoto_cropper_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image_parent, Evas_Object *image);
void ephoto_bcg_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image);
void ephoto_hsv_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image);
void ephoto_color_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image);
void ephoto_red_eye_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image);
void ephoto_scale_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image, const char *file);
void ephoto_filter_blur(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_sharpen(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_dither(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_black_and_white(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_old_photo(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_painting(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_posterize(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_sketch(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_invert(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_edge(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_emboss(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_histogram_eq(Ephoto *ephoto, Evas_Object *image);
const char *data_name, void *data);
void ephoto_editor_del(Evas_Object *obj, Evas_Object *parent);
void ephoto_cropper_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image_parent, Evas_Object *image);
void ephoto_bcg_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image);
void ephoto_hsv_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image);
void ephoto_color_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image);
void ephoto_red_eye_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image);
void ephoto_scale_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image, const char *file);
void ephoto_filter_blur(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_sharpen(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_dither(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_black_and_white(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_old_photo(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_painting(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_posterize(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_sketch(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_invert(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_edge(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_emboss(Ephoto *ephoto, Evas_Object *image);
void ephoto_filter_histogram_eq(Ephoto *ephoto, Evas_Object *image);
/*file functions*/
void ephoto_file_save_image(Ephoto *ephoto, Ephoto_Entry *entry,
Evas_Object *image);
void ephoto_file_save_image_as(Ephoto *ephoto, Ephoto_Entry *entry,
Evas_Object *image);
void ephoto_file_upload_image(Ephoto *ephoto, Ephoto_Entry *entry);
void ephoto_file_new_dir(Ephoto *ephoto, const char *path);
void ephoto_file_rename(Ephoto *ephoto, const char *path);
void ephoto_file_move(Ephoto *ephoto, Eina_List *files, const char *path);
void ephoto_file_copy(Ephoto *ephoto, Eina_List *files, const char *path);
void ephoto_file_paste(Ephoto *ephoto, Eina_List *files, Eina_Bool copy,
const char *path);
void ephoto_file_delete(Ephoto *ephoto, Eina_List *files,
Eina_File_Type type);
void ephoto_file_empty_trash(Ephoto *ephoto, Eina_List *files);
void ephoto_file_save_image(Ephoto *ephoto, Ephoto_Entry *entry,
Evas_Object *image);
void ephoto_file_save_image_as(Ephoto *ephoto, Ephoto_Entry *entry,
Evas_Object *image);
void ephoto_file_upload_image(Ephoto *ephoto, Ephoto_Entry *entry);
void ephoto_file_new_dir(Ephoto *ephoto, const char *path);
void ephoto_file_rename(Ephoto *ephoto, const char *path);
void ephoto_file_move(Ephoto *ephoto, Eina_List *files, const char *path);
void ephoto_file_copy(Ephoto *ephoto, Eina_List *files, const char *path);
void ephoto_file_paste(Ephoto *ephoto, Eina_List *files, Eina_Bool copy,
const char *path);
void ephoto_file_delete(Ephoto *ephoto, Eina_List *files,
Eina_File_Type type);
void ephoto_file_empty_trash(Ephoto *ephoto, Eina_List *files);
/*data types and structures*/
@ -211,25 +211,25 @@ enum _Ephoto_Ipc_Domain
struct _Ephoto_Config
{
int config_version;
int thumb_size;
int thumb_gen_size;
int window_width;
int window_height;
double slideshow_timeout;
double left_size;
double right_size;
const char *directory;
const char *slideshow_transition;
const char *open;
Eina_Bool fsel_hide;
Eina_Bool prompts;
Eina_Bool drop;
Eina_Bool movess;
Eina_Bool smooth;
Eina_Bool firstrun;
Eina_Bool folders;
Eina_Bool thumbnail_aspect;
int config_version;
int thumb_size;
int thumb_gen_size;
int window_width;
int window_height;
double slideshow_timeout;
double left_size;
double right_size;
const char *directory;
const char *slideshow_transition;
const char *open;
Eina_Bool fsel_hide;
Eina_Bool prompts;
Eina_Bool drop;
Eina_Bool movess;
Eina_Bool smooth;
Eina_Bool firstrun;
Eina_Bool folders;
Eina_Bool thumbnail_aspect;
Evas_Object *slide_time;
Evas_Object *slide_trans;
Evas_Object *open_dir;
@ -245,47 +245,47 @@ struct _Ephoto_Config
struct _Ephoto
{
Evas_Object *win;
Evas_Object *main;
Evas_Object *layout;
Evas_Object *pager;
Evas_Object *statusbar;
Evas_Object *folders_button;
Evas_Object *folders_icon;
Evas_Object *view_button;
Evas_Object *controls_left;
Evas_Object *controls_right;
Evas_Object *infolabel;
Evas_Object *exit;
Evas_Object *thumb_browser;
Evas_Object *single_browser;
Evas_Object *slideshow;
Evas_Object *dir_browser;
Evas_Object *file_popup;
Eina_Bool folders_toggle;
Eina_List *entries;
Eina_List *selentries;
Eina_List *searchentries;
Eina_List *thumbs;
Eio_Monitor *monitor;
Eina_List *monitor_handlers;
Eina_List *file_pos;
Eina_List *upload_handlers;
Ecore_Thread *file_thread;
Evas_Object *win;
Evas_Object *main;
Evas_Object *layout;
Evas_Object *pager;
Evas_Object *statusbar;
Evas_Object *folders_button;
Evas_Object *folders_icon;
Evas_Object *view_button;
Evas_Object *controls_left;
Evas_Object *controls_right;
Evas_Object *infolabel;
Evas_Object *exit;
Evas_Object *thumb_browser;
Evas_Object *single_browser;
Evas_Object *slideshow;
Evas_Object *dir_browser;
Evas_Object *file_popup;
Eina_Bool folders_toggle;
Eina_List *entries;
Eina_List *selentries;
Eina_List *searchentries;
Eina_List *thumbs;
Eio_Monitor *monitor;
Eina_List *monitor_handlers;
Eina_List *file_pos;
Eina_List *upload_handlers;
Ecore_Thread *file_thread;
Ecore_Con_Url *url_up;
char *url_ret;
char *upload_error;
int file_errors;
char *url_ret;
char *upload_error;
int file_errors;
const char *top_directory;
const char *config_path;
const char *trash_path;
const char *destination;
const char *top_directory;
const char *config_path;
const char *trash_path;
const char *destination;
int thumb_gen_size;
int thumb_gen_size;
struct
{
@ -296,34 +296,34 @@ struct _Ephoto
Ecore_Job *change_dir;
} job;
Eio_File *ls;
Eio_File *ls;
Evas_Object *prefs_win;
Ephoto_State state, prev_state;
Evas_Object *prefs_win;
Ephoto_State state, prev_state;
Ephoto_Config *config;
Ephoto_Sort sort;
Ephoto_Sort sort;
};
struct _Ephoto_Entry
{
const char *path;
const char *basename;
const char *label;
const char *sort_id;
double size;
Ephoto *ephoto;
Eio_Monitor *monitor;
Eina_List *monitor_handlers;
const char *path;
const char *basename;
const char *label;
const char *sort_id;
double size;
Ephoto *ephoto;
Eio_Monitor *monitor;
Eina_List *monitor_handlers;
Elm_Object_Item *item;
Elm_Object_Item *parent;
Eina_List *free_listeners;
Eina_Bool is_dir;
Eina_Bool is_link;
Eina_Bool no_delete;
Evas_Object *genlist;
Evas_Object *gengrid;
Evas_Object *thumb;
Eina_List *free_listeners;
Eina_Bool is_dir;
Eina_Bool is_link;
Eina_Bool no_delete;
Evas_Object *genlist;
Evas_Object *gengrid;
Evas_Object *thumb;
};
struct _Ephoto_Event_Entry_Create
@ -333,15 +333,15 @@ struct _Ephoto_Event_Entry_Create
/*ephoto file functions*/
Ephoto_Entry *ephoto_entry_new(Ephoto *ephoto, const char *path,
const char *label, Eina_File_Type type);
Eina_Bool ephoto_entry_exists(Ephoto *ephoto, const char *path);
void ephoto_entry_free(Ephoto *ephoto, Ephoto_Entry *entry);
void ephoto_entry_free_listener_add(Ephoto_Entry *entry,
void (*cb) (void *data, const Ephoto_Entry *entry), const void *data);
void ephoto_entry_free_listener_del(Ephoto_Entry *entry,
void (*cb) (void *data, const Ephoto_Entry *entry), const void *data);
void ephoto_entries_free(Ephoto *ephoto);
int ephoto_entries_cmp(const void *pa, const void *pb);
const char *label, Eina_File_Type type);
Eina_Bool ephoto_entry_exists(Ephoto *ephoto, const char *path);
void ephoto_entry_free(Ephoto *ephoto, Ephoto_Entry *entry);
void ephoto_entry_free_listener_add(Ephoto_Entry *entry,
void (*cb)(void *data, const Ephoto_Entry *entry), const void *data);
void ephoto_entry_free_listener_del(Ephoto_Entry *entry,
void (*cb)(void *data, const Ephoto_Entry *entry), const void *data);
void ephoto_entries_free(Ephoto *ephoto);
int ephoto_entries_cmp(const void *pa, const void *pb);
/*check if image can be loaded*/
static inline Eina_Bool
@ -361,20 +361,20 @@ _ephoto_eina_file_direct_info_image_useful(const Eina_File_Direct_Info *info)
bname = info->path + info->name_start;
if (bname[0] == '.')
return EINA_FALSE;
return EINA_FALSE;
if ((info->type != EINA_FILE_REG) && (info->type != EINA_FILE_UNKNOWN) &&
(info->type != EINA_FILE_LNK))
return EINA_FALSE;
return EINA_FALSE;
type = strrchr(bname, '.');
if (!type)
return EINA_FALSE;
return EINA_FALSE;
count = sizeof(filters) / sizeof(filters[0]);
for (i = 0; i < count; i++)
{
if (!strcasecmp(type + 1, filters[i]))
return evas_object_image_extension_can_load_get(bname);
if (!strcasecmp(type + 1, filters[i]))
return evas_object_image_extension_can_load_get(bname);
}
return EINA_FALSE;
}
@ -393,7 +393,7 @@ _ephoto_file_image_can_save(const char *ext)
for (i = 0; i < count; i++)
{
if (!strcasecmp(ext, filters[i]))
return EINA_TRUE;
return EINA_TRUE;
}
return EINA_FALSE;
}
@ -408,7 +408,7 @@ ephoto_normalize_color(int color)
static inline int
ephoto_mul_color_alpha(int color, int alpha)
{
return (alpha > 0 && alpha <= 255) ? (color * (255 /alpha)) : color;
return (alpha > 0 && alpha <= 255) ? (color * (255 / alpha)) : color;
}
static inline int
@ -427,15 +427,14 @@ extern int EPHOTO_EVENT_EDITOR_APPLY;
extern int EPHOTO_EVENT_EDITOR_CANCEL;
extern int EPHOTO_EVENT_EDITOR_BACK;
#define CRIT(...) EINA_LOG_CRIT(__VA_ARGS__)
#define ERR(...) EINA_LOG_ERR(__VA_ARGS__)
#define WRN(...) EINA_LOG_WARN(__VA_ARGS__)
#define INF(...) EINA_LOG_INFO(__VA_ARGS__)
#define DBG(...) EINA_LOG_DBG(__VA_ARGS__)
#define CRIT(...) EINA_LOG_CRIT(__VA_ARGS__)
#define ERR(...) EINA_LOG_ERR(__VA_ARGS__)
#define WRN(...) EINA_LOG_WARN(__VA_ARGS__)
#define INF(...) EINA_LOG_INFO(__VA_ARGS__)
#define DBG(...) EINA_LOG_DBG(__VA_ARGS__)
#define EPHOTO_WEIGHT evas_object_size_hint_weight_set
#define EPHOTO_ALIGN evas_object_size_hint_align_set
#define EPHOTO_ALIGN evas_object_size_hint_align_set
#define EPHOTO_EXPAND(X) EPHOTO_WEIGHT((X), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
#define EPHOTO_FILL(X) EPHOTO_ALIGN((X), EVAS_HINT_FILL, EVAS_HINT_FILL)
#define EPHOTO_FILL(X) EPHOTO_ALIGN((X), EVAS_HINT_FILL, EVAS_HINT_FILL)
#endif

@ -3,24 +3,24 @@
typedef struct _Ephoto_BCG Ephoto_BCG;
struct _Ephoto_BCG
{
Evas_Object *main;
Evas_Object *parent;
Evas_Object *image;
Evas_Object *editor;
Evas_Object *bslider;
Evas_Object *cslider;
Evas_Object *gslider;
Eina_List *handlers;
int contrast;
int brightness;
double gamma;
Evas_Coord w, h;
Evas_Object *main;
Evas_Object *parent;
Evas_Object *image;
Evas_Object *editor;
Evas_Object *bslider;
Evas_Object *cslider;
Evas_Object *gslider;
Eina_List *handlers;
int contrast;
int brightness;
double gamma;
Evas_Coord w, h;
unsigned int *original_im_data;
};
unsigned int *
_ephoto_bcg_adjust_brightness(Ephoto_BCG *ebcg, int brightness,
unsigned int *image_data)
unsigned int *image_data)
{
unsigned int *im_data, *im_data_new, *p1, *p2;
Evas_Coord x, y;
@ -28,50 +28,50 @@ _ephoto_bcg_adjust_brightness(Ephoto_BCG *ebcg, int brightness,
im_data = malloc(sizeof(unsigned int) * ebcg->w * ebcg->h);
if (image_data)
memcpy(im_data, image_data, sizeof(unsigned int) * ebcg->w * ebcg->h);
memcpy(im_data, image_data, sizeof(unsigned int) * ebcg->w * ebcg->h);
else
memcpy(im_data, ebcg->original_im_data,
sizeof(unsigned int) * ebcg->w * ebcg->h);
memcpy(im_data, ebcg->original_im_data,
sizeof(unsigned int) * ebcg->w * ebcg->h);
ebcg->brightness = brightness;
im_data_new = malloc(sizeof(unsigned int) * ebcg->w * ebcg->h);
for (y = 0; y < ebcg->h; y++)
{
p1 = im_data + (y * ebcg->w);
p2 = im_data_new + (y * ebcg->w);
for (x = 0; x < ebcg->w; x++)
{
b = (int) ((*p1) & 0xff);
g = (int) ((*p1 >> 8) & 0xff);
r = (int) ((*p1 >> 16) & 0xff);
a = (int) ((*p1 >> 24) & 0xff);
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
bb = (int) b + ebcg->brightness;
gg = (int) g + ebcg->brightness;
rr = (int) r + ebcg->brightness;
bb = ephoto_normalize_color(bb);
gg = ephoto_normalize_color(gg);
rr = ephoto_normalize_color(rr);
bb = ephoto_demul_color_alpha(bb, a);
gg = ephoto_demul_color_alpha(gg, a);
rr = ephoto_demul_color_alpha(rr, a);
*p2 = (a << 24) | (rr << 16) | (gg << 8) | bb;
p2++;
p1++;
}
p1 = im_data + (y * ebcg->w);
p2 = im_data_new + (y * ebcg->w);
for (x = 0; x < ebcg->w; x++)
{
b = (int)((*p1) & 0xff);
g = (int)((*p1 >> 8) & 0xff);
r = (int)((*p1 >> 16) & 0xff);
a = (int)((*p1 >> 24) & 0xff);
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
bb = (int)b + ebcg->brightness;
gg = (int)g + ebcg->brightness;
rr = (int)r + ebcg->brightness;
bb = ephoto_normalize_color(bb);
gg = ephoto_normalize_color(gg);
rr = ephoto_normalize_color(rr);
bb = ephoto_demul_color_alpha(bb, a);
gg = ephoto_demul_color_alpha(gg, a);
rr = ephoto_demul_color_alpha(rr, a);
*p2 = (a << 24) | (rr << 16) | (gg << 8) | bb;
p2++;
p1++;
}
}
ephoto_single_browser_image_data_update(ebcg->main, ebcg->image,
im_data_new, ebcg->w, ebcg->h);
im_data_new, ebcg->w, ebcg->h);
free(im_data);
return im_data_new;
}
unsigned int *
_ephoto_bcg_adjust_contrast(Ephoto_BCG *ebcg, int contrast,
unsigned int *image_data)
unsigned int *image_data)
{
unsigned int *im_data, *im_data_new, *p1, *p2;
Evas_Coord x, y;
@ -80,53 +80,53 @@ _ephoto_bcg_adjust_contrast(Ephoto_BCG *ebcg, int contrast,
im_data = malloc(sizeof(unsigned int) * ebcg->w * ebcg->h);
if (image_data)
memcpy(im_data, image_data, sizeof(unsigned int) * ebcg->w * ebcg->h);
memcpy(im_data, image_data, sizeof(unsigned int) * ebcg->w * ebcg->h);
else
memcpy(im_data, ebcg->original_im_data,
sizeof(unsigned int) * ebcg->w * ebcg->h);
memcpy(im_data, ebcg->original_im_data,
sizeof(unsigned int) * ebcg->w * ebcg->h);
ebcg->contrast = contrast;
top = ((255 + (contrast)) * 259);
bottom = ((259 - (contrast)) * 255);
factor = (float) top / (float) bottom;
factor = (float)top / (float)bottom;
im_data_new = malloc(sizeof(unsigned int) * ebcg->w * ebcg->h);
for (y = 0; y < ebcg->h; y++)
{
p1 = im_data + (y * ebcg->w);
p2 = im_data_new + (y * ebcg->w);
for (x = 0; x < ebcg->w; x++)
{
b = (int) ((*p1) & 0xff);
g = (int) ((*p1 >> 8) & 0xff);
r = (int) ((*p1 >> 16) & 0xff);
a = (int) ((*p1 >> 24) & 0xff);
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
bb = (int) ((factor * (b - 128)) + 128);
gg = (int) ((factor * (g - 128)) + 128);
rr = (int) ((factor * (r - 128)) + 128);
bb = ephoto_normalize_color(bb);
gg = ephoto_normalize_color(gg);
rr = ephoto_normalize_color(rr);
bb = ephoto_demul_color_alpha(bb, a);
gg = ephoto_demul_color_alpha(gg, a);
rr = ephoto_demul_color_alpha(rr, a);
*p2 = (a << 24) | (rr << 16) | (gg << 8) | bb;
p2++;
p1++;
}
p1 = im_data + (y * ebcg->w);
p2 = im_data_new + (y * ebcg->w);
for (x = 0; x < ebcg->w; x++)
{
b = (int)((*p1) & 0xff);
g = (int)((*p1 >> 8) & 0xff);
r = (int)((*p1 >> 16) & 0xff);
a = (int)((*p1 >> 24) & 0xff);
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
bb = (int)((factor * (b - 128)) + 128);
gg = (int)((factor * (g - 128)) + 128);
rr = (int)((factor * (r - 128)) + 128);
bb = ephoto_normalize_color(bb);
gg = ephoto_normalize_color(gg);
rr = ephoto_normalize_color(rr);
bb = ephoto_demul_color_alpha(bb, a);
gg = ephoto_demul_color_alpha(gg, a);
rr = ephoto_demul_color_alpha(rr, a);
*p2 = (a << 24) | (rr << 16) | (gg << 8) | bb;
p2++;
p1++;
}
}
ephoto_single_browser_image_data_update(ebcg->main, ebcg->image,
im_data_new, ebcg->w, ebcg->h);
im_data_new, ebcg->w, ebcg->h);
free(im_data);
return im_data_new;
}
unsigned int *
_ephoto_bcg_adjust_gamma(Ephoto_BCG *ebcg, double gamma,
unsigned int *image_data)
unsigned int *image_data)
{
unsigned int *im_data, *im_data_new, *p1, *p2;
Evas_Coord x, y;
@ -134,50 +134,50 @@ _ephoto_bcg_adjust_gamma(Ephoto_BCG *ebcg, double gamma,
im_data = malloc(sizeof(unsigned int) * ebcg->w * ebcg->h);
if (image_data)
memcpy(im_data, image_data, sizeof(unsigned int) * ebcg->w * ebcg->h);
memcpy(im_data, image_data, sizeof(unsigned int) * ebcg->w * ebcg->h);
else
memcpy(im_data, ebcg->original_im_data,
sizeof(unsigned int) * ebcg->w * ebcg->h);
memcpy(im_data, ebcg->original_im_data,
sizeof(unsigned int) * ebcg->w * ebcg->h);
ebcg->gamma = 1 / gamma;
im_data_new = malloc(sizeof(unsigned int) * ebcg->w * ebcg->h);
for (y = 0; y < ebcg->h; y++)
{
p1 = im_data + (y * ebcg->w);
p2 = im_data_new + (y * ebcg->w);
for (x = 0; x < ebcg->w; x++)
{
b = (int) ((*p1) & 0xff);
g = (int) ((*p1 >> 8) & 0xff);
r = (int) ((*p1 >> 16) & 0xff);
a = (int) ((*p1 >> 24) & 0xff);
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
bb = (int) (pow(((double) b / 255), ebcg->gamma) * 255);
gg = (int) (pow(((double) g / 255), ebcg->gamma) * 255);
rr = (int) (pow(((double) r / 255), ebcg->gamma) * 255);
bb = ephoto_normalize_color(bb);
gg = ephoto_normalize_color(gg);
rr = ephoto_normalize_color(rr);
bb = ephoto_demul_color_alpha(bb, a);
gg = ephoto_demul_color_alpha(gg, a);
rr = ephoto_demul_color_alpha(rr, a);
*p2 = (a << 24) | (rr << 16) | (gg << 8) | bb;
p2++;
p1++;
}
p1 = im_data + (y * ebcg->w);
p2 = im_data_new + (y * ebcg->w);
for (x = 0; x < ebcg->w; x++)
{
b = (int)((*p1) & 0xff);
g = (int)((*p1 >> 8) & 0xff);
r = (int)((*p1 >> 16) & 0xff);
a = (int)((*p1 >> 24) & 0xff);
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
bb = (int)(pow(((double)b / 255), ebcg->gamma) * 255);
gg = (int)(pow(((double)g / 255), ebcg->gamma) * 255);
rr = (int)(pow(((double)r / 255), ebcg->gamma) * 255);
bb = ephoto_normalize_color(bb);
gg = ephoto_normalize_color(gg);
rr = ephoto_normalize_color(rr);
bb = ephoto_demul_color_alpha(bb, a);
gg = ephoto_demul_color_alpha(gg, a);
rr = ephoto_demul_color_alpha(rr, a);
*p2 = (a << 24) | (rr << 16) | (gg << 8) | bb;
p2++;
p1++;
}
}
ephoto_single_browser_image_data_update(ebcg->main, ebcg->image,
im_data_new, ebcg->w, ebcg->h);
im_data_new, ebcg->w, ebcg->h);
free(im_data);
return im_data_new;
}
static void
_brightness_slider_changed(void *data, Evas_Object *obj,
void *event_info EINA_UNUSED)
void *event_info EINA_UNUSED)
{
Ephoto_BCG *ebcg = data;
int brightness;
@ -186,13 +186,13 @@ _brightness_slider_changed(void *data, Evas_Object *obj,
brightness = elm_slider_value_get(obj);
image_data = _ephoto_bcg_adjust_brightness(ebcg, brightness, NULL);
image_data_two =
_ephoto_bcg_adjust_contrast(ebcg, ebcg->contrast, image_data);
_ephoto_bcg_adjust_contrast(ebcg, ebcg->contrast, image_data);
_ephoto_bcg_adjust_gamma(ebcg, ebcg->gamma, image_data_two);
}
static void
_contrast_slider_changed(void *data, Evas_Object *obj,
void *event_info EINA_UNUSED)
void *event_info EINA_UNUSED)
{
Ephoto_BCG *ebcg = data;
int contrast;
@ -201,13 +201,13 @@ _contrast_slider_changed(void *data, Evas_Object *obj,
contrast = elm_slider_value_get(obj);
image_data = _ephoto_bcg_adjust_contrast(ebcg, contrast, NULL);
image_data_two =
_ephoto_bcg_adjust_brightness(ebcg, ebcg->brightness, image_data);
_ephoto_bcg_adjust_brightness(ebcg, ebcg->brightness, image_data);
_ephoto_bcg_adjust_gamma(ebcg, ebcg->gamma, image_data_two);
}
static void
_gamma_slider_changed(void *data, Evas_Object *obj,
void *event_info EINA_UNUSED)
void *event_info EINA_UNUSED)
{
Ephoto_BCG *ebcg = data;
double gamma;
@ -216,13 +216,13 @@ _gamma_slider_changed(void *data, Evas_Object *obj,
gamma = elm_slider_value_get(obj);
image_data = _ephoto_bcg_adjust_gamma(ebcg, gamma, NULL);
image_data_two =
_ephoto_bcg_adjust_brightness(ebcg, ebcg->brightness, image_data);
_ephoto_bcg_adjust_brightness(ebcg, ebcg->brightness, image_data);
_ephoto_bcg_adjust_contrast(ebcg, ebcg->contrast, image_data_two);
}
static Eina_Bool
_bcg_reset(void *data, int type EINA_UNUSED,
void *event_info EINA_UNUSED)
void *event_info EINA_UNUSED)
{
Ephoto_BCG *ebcg = data;
@ -239,7 +239,7 @@ _bcg_reset(void *data, int type EINA_UNUSED,
static Eina_Bool
_bcg_apply(void *data, int type EINA_UNUSED,
void *event_info EINA_UNUSED)
void *event_info EINA_UNUSED)
{
Ephoto_BCG *ebcg = data;
unsigned int *image_data;
@ -254,7 +254,7 @@ _bcg_apply(void *data, int type EINA_UNUSED,
else
{
image_data =
evas_object_image_data_get(ebcg->image, EINA_FALSE);
evas_object_image_data_get(ebcg->image, EINA_FALSE);
evas_object_image_size_get(ebcg->image, &w, &h);
ephoto_single_browser_image_data_done(ebcg->main, image_data, w, h);
}
@ -265,7 +265,7 @@ _bcg_apply(void *data, int type EINA_UNUSED,
static Eina_Bool
_bcg_cancel(void *data, int type EINA_UNUSED,
void *event_info EINA_UNUSED)
void *event_info EINA_UNUSED)
{
Ephoto_BCG *ebcg = data;
@ -284,7 +284,7 @@ _bcg_cancel(void *data, int type EINA_UNUSED,
static void
_editor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
void *event_info EINA_UNUSED)
{
Ephoto_BCG *ebcg = data;
Ecore_Event_Handler *handler;
@ -314,18 +314,18 @@ ephoto_bcg_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent, Evas_Obje
ebcg->parent = parent;
ebcg->image = image;
im_data =
evas_object_image_data_get(ebcg->image,
EINA_FALSE);
evas_object_image_data_get(ebcg->image,
EINA_FALSE);
evas_object_image_size_get(ebcg->image, &ebcg->w,
&ebcg->h);
&ebcg->h);
ebcg->original_im_data = malloc(sizeof(unsigned int) * ebcg->w * ebcg->h);
memcpy(ebcg->original_im_data, im_data,
sizeof(unsigned int) * ebcg->w * ebcg->h);
sizeof(unsigned int) * ebcg->w * ebcg->h);
ebcg->editor = ephoto_editor_add(ephoto, parent, _("Brightness/Contrast/Gamma"),
"ebcg", ebcg);
"ebcg", ebcg);
evas_object_event_callback_add(ebcg->editor, EVAS_CALLBACK_DEL, _editor_del,
ebcg);
ebcg);
slider = elm_slider_add(ebcg->editor);
elm_object_text_set(slider, _("Gamma"));
@ -337,7 +337,7 @@ ephoto_bcg_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent, Evas_Obje
EPHOTO_WEIGHT(slider, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
EPHOTO_ALIGN(slider, EVAS_HINT_FILL, 0.5);
evas_object_smart_callback_add(slider, "delay,changed",
_gamma_slider_changed, ebcg);
_gamma_slider_changed, ebcg);
elm_box_pack_start(ebcg->editor, slider);
evas_object_show(slider);
ebcg->gslider = slider;
@ -352,7 +352,7 @@ ephoto_bcg_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent, Evas_Obje
EPHOTO_WEIGHT(slider, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
EPHOTO_ALIGN(slider, EVAS_HINT_FILL, 0.5);
evas_object_smart_callback_add(slider, "delay,changed",
_contrast_slider_changed, ebcg);
_contrast_slider_changed, ebcg);
elm_box_pack_start(ebcg->editor, slider);
evas_object_show(slider);
ebcg->cslider = slider;
@ -367,26 +367,27 @@ ephoto_bcg_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent, Evas_Obje
EPHOTO_WEIGHT(slider, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
EPHOTO_ALIGN(slider, EVAS_HINT_FILL, 0.5);
evas_object_smart_callback_add(slider, "delay,changed",
_brightness_slider_changed, ebcg);
_brightness_slider_changed, ebcg);
elm_box_pack_start(ebcg->editor, slider);
evas_object_show(slider);
ebcg->bslider = slider;
ebcg->handlers =
eina_list_append(ebcg->handlers,
ecore_event_handler_add(EPHOTO_EVENT_EDITOR_RESET,
_bcg_reset, ebcg));
eina_list_append(ebcg->handlers,
ecore_event_handler_add(EPHOTO_EVENT_EDITOR_RESET,
_bcg_reset, ebcg));
ebcg->handlers =
eina_list_append(ebcg->handlers,
ecore_event_handler_add(EPHOTO_EVENT_EDITOR_APPLY,
_bcg_apply, ebcg));
eina_list_append(ebcg->handlers,
ecore_event_handler_add(EPHOTO_EVENT_EDITOR_APPLY,
_bcg_apply, ebcg));
ebcg->handlers =
eina_list_append(ebcg->handlers,
ecore_event_handler_add(EPHOTO_EVENT_EDITOR_CANCEL,
_bcg_cancel, ebcg));
eina_list_append(ebcg->handlers,
ecore_event_handler_add(EPHOTO_EVENT_EDITOR_CANCEL,
_bcg_cancel, ebcg));
return;
error:
error:
return;
}

@ -3,18 +3,18 @@
typedef struct _Ephoto_Color Ephoto_Color;
struct _Ephoto_Color
{
Evas_Object *main;
Evas_Object *parent;
Evas_Object *image;
Evas_Object *editor;
Evas_Object *bslider;
Evas_Object *gslider;
Evas_Object *rslider;
Eina_List *handlers;
int blue;
int green;
int red;
Evas_Coord w, h;
Evas_Object *main;
Evas_Object *parent;
Evas_Object *image;
Evas_Object *editor;
Evas_Object *bslider;
Evas_Object *gslider;
Evas_Object *rslider;
Eina_List *handlers;
int blue;
int green;
int red;
Evas_Coord w, h;
unsigned int *original_im_data;
};
@ -35,10 +35,10 @@ _ephoto_apply_color_adjustment(Ephoto_Color *eco, unsigned int *image_data, int
im_data = malloc(sizeof(unsigned int) * eco->w * eco->h);
if (image_data)
memcpy(im_data, image_data, sizeof(unsigned int) * eco->w * eco->h);
memcpy(im_data, image_data, sizeof(unsigned int) * eco->w * eco->h);
else
memcpy(im_data, eco->original_im_data,
sizeof(unsigned int) * eco->w * eco->h);
memcpy(im_data, eco->original_im_data,
sizeof(unsigned int) * eco->w * eco->h);
im_data_new = malloc(sizeof(unsigned int) * eco->w * eco->h);
@ -48,32 +48,35 @@ _ephoto_apply_color_adjustment(Ephoto_Color *eco, unsigned int *image_data, int
p2 = im_data_new + (y * eco->w);
for (x = 0; x < eco->w; x++)
{
b = (int) ((*p1) & 0xff);
g = (int) ((*p1 >> 8) & 0xff);
r = (int) ((*p1 >> 16) & 0xff);
a = (int) ((*p1 >> 24) & 0xff);
b = (int)((*p1) & 0xff);
g = (int)((*p1 >> 8) & 0xff);
r = (int)((*p1 >> 16) & 0xff);
a = (int)((*p1 >> 24) & 0xff);
b = ephoto_mul_color_alpha(b, a);
g = ephoto_mul_color_alpha(g, a);
r = ephoto_mul_color_alpha(r, a);
switch (color)
{
case EPHOTO_COLOR_ADJUST_RED:
eco->red = adjust;
cc = (int) r + eco->red;
r = cc;
break;
case EPHOTO_COLOR_ADJUST_BLUE:
eco->blue = adjust;
cc = (int) b + eco->blue;
b = cc;
break;
case EPHOTO_COLOR_ADJUST_GREEN:
eco->green = adjust;
cc = (int) g + eco->green;
g = cc;
break;
default:
break;
case EPHOTO_COLOR_ADJUST_RED:
eco->red = adjust;
cc = (int)r + eco->red;
r = cc;
break;
case EPHOTO_COLOR_ADJUST_BLUE:
eco->blue = adjust;
cc = (int)b + eco->blue;
b = cc;
break;
case EPHOTO_COLOR_ADJUST_GREEN:
eco->green = adjust;
cc = (int)g + eco->green;
g = cc;
break;
default:
break;
}
b = ephoto_normalize_color(b);
g = ephoto_normalize_color(g);
@ -87,7 +90,7 @@ _ephoto_apply_color_adjustment(Ephoto_Color *eco, unsigned int *image_data, int
}
}
ephoto_single_browser_image_data_update(eco->main, eco->image,
im_data_new, eco->w, eco->h);
im_data_new, eco->w, eco->h);
free(im_data);
return im_data_new;
}
@ -107,7 +110,7 @@ _red_slider_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
static void
_green_slider_changed(void *data, Evas_Object *obj,
void *event_info EINA_UNUSED)
void *event_info EINA_UNUSED)
{
Ephoto_Color *eco = data;
int green;
@ -121,7 +124,7 @@ _green_slider_changed(void *data, Evas_Object *obj,
static void
_blue_slider_changed(void *data, Evas_Object *obj,
void *event_info EINA_UNUSED)
void *event_info EINA_UNUSED)
{
Ephoto_Color *eco = data;
int blue;
@ -135,7 +138,7 @@ _blue_slider_changed(void *data, Evas_Object *obj,
static Eina_Bool
_color_reset(void *data, int type EINA_UNUSED,
void *event_info EINA_UNUSED)
void *event_info EINA_UNUSED)
{
Ephoto_Color *eco = data;
@ -152,7 +155,7 @@ _color_reset(void *data, int type EINA_UNUSED,
static Eina_Bool
_color_apply(void *data, int type EINA_UNUSED,
void *event_info EINA_UNUSED)
void *event_info EINA_UNUSED)
{
Ephoto_Color *eco = data;
unsigned int *image_data;
@ -167,7 +170,7 @@ _color_apply(void *data, int type EINA_UNUSED,
else
{
image_data =
evas_object_image_data_get(eco->image, EINA_FALSE);
evas_object_image_data_get(eco->image, EINA_FALSE);
evas_object_image_size_get(eco->image, &w, &h);
ephoto_single_browser_image_data_done(eco->main, image_data, w, h);
}
@ -178,7 +181,7 @@ _color_apply(void *data, int type EINA_UNUSED,
static Eina_Bool
_color_cancel(void *data, int type EINA_UNUSED,
void *event_info EINA_UNUSED)
void *event_info EINA_UNUSED)
{
Ephoto_Color *eco = data;
@ -197,7 +200,7 @@ _color_cancel(void *data, int type EINA_UNUSED,
static void
_editor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
void *event_info EINA_UNUSED)
{
Ephoto_Color *eco = data;
Ecore_Event_Handler *handler;
@ -227,18 +230,18 @@ ephoto_color_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent, Evas_Ob
eco->parent = parent;