Macros | Functions | Variables
ethumb.c File Reference

Copyright (C) 2009 by ProFUSION embedded systems. More...

Macros

#define PATH_MAX   4096
 
#define DBG(...)   EINA_LOG_DOM_DBG(_log_dom, __VA_ARGS__)
 
#define INF(...)   EINA_LOG_DOM_INFO(_log_dom, __VA_ARGS__)
 
#define WRN(...)   EINA_LOG_DOM_WARN(_log_dom, __VA_ARGS__)
 
#define ERR(...)   EINA_LOG_DOM_ERR(_log_dom, __VA_ARGS__)
 
#define _check_uri_char(c)    ((c) >= 32 && (c) < 128 && (ACCEPTABLE_URI_CHARS[(c) - 32] & 0x08))
 
#define CHECK_DELTA(Param)
 
#define CHECK_FLT_DELTA(Param)
 
#define CMP_PARAM(Param)
 
#define CMP_FLT_PARAM(Param)
 
#define HASH_PARAM_I(Param)   r ^= eina_hash_int32((unsigned int*) &e->Param, 0);
 
#define HASH_PARAM_P(Param)   r ^= eina_hash_int32((unsigned int*) &e->Param, 0);
 
#define HASH_PARAM_D(Param)   r ^= eina_hash_int64((unsigned long long int*)&e->Param, 0);
 
#define HASH_PARAM_F(Param)   r ^= eina_hash_int32((unsigned int*) &e->Param, 0);
 

Functions

EAPI Eina_Bool ethumb_plugin_register (const Ethumb_Plugin *plugin)
 
EAPI Eina_Bool ethumb_plugin_unregister (const Ethumb_Plugin *plugin)
 
static void _ethumb_plugins_load (void)
 
static void _ethumb_plugins_unload (void)
 
EAPI int ethumb_init (void)
 Initialize ethumb. More...
 
EAPI int ethumb_shutdown (void)
 Shutdown ethumb, unloading all currently-loaded modules. More...
 
EAPI Ethumbethumb_new (void)
 Create a new ethumb object. More...
 
static void _ethumb_frame_free (Ethumb_Frame *frame)
 
EAPI void ethumb_free (Ethumb *ethumb)
 Free an ethumb object.
 
EAPI void ethumb_thumb_fdo_set (Ethumb *e, Ethumb_Thumb_FDO_Size s)
 
EAPI void ethumb_thumb_size_set (Ethumb *e, int tw, int th)
 Set the size of thumbnails. More...
 
EAPI void ethumb_thumb_size_get (const Ethumb *e, int *tw, int *th)
 Get the size of thumbnails. More...
 
EAPI void ethumb_thumb_format_set (Ethumb *e, Ethumb_Thumb_Format f)
 Set the fileformat of the thumbnails. More...
 
EAPI Ethumb_Thumb_Format ethumb_thumb_format_get (const Ethumb *e)
 Get the fileformat of the thumbnails. More...
 
EAPI void ethumb_thumb_aspect_set (Ethumb *e, Ethumb_Thumb_Aspect a)
 Set the aspect ratio policy. More...
 
EAPI Ethumb_Thumb_Aspect ethumb_thumb_aspect_get (const Ethumb *e)
 Get the aspect ratio policy. More...
 
EAPI void ethumb_thumb_orientation_set (Ethumb *e, Ethumb_Thumb_Orientation o)
 Set the thumbnail rotation or flip. More...
 
EAPI Ethumb_Thumb_Orientation ethumb_thumb_orientation_get (const Ethumb *e)
 Get the thumbnail rotation. More...
 
EAPI void ethumb_thumb_crop_align_set (Ethumb *e, float x, float y)
 
EAPI void ethumb_thumb_crop_align_get (const Ethumb *e, float *x, float *y)
 
EAPI void ethumb_thumb_quality_set (Ethumb *e, int quality)
 Set the thumbnail compression quality. More...
 
EAPI int ethumb_thumb_quality_get (const Ethumb *e)
 Get the thumbnail compression quality. More...
 
EAPI void ethumb_thumb_compress_set (Ethumb *e, int compress)
 Set the compression rate. More...
 
EAPI int ethumb_thumb_compress_get (const Ethumb *e)
 Get the compression rate. More...
 
EAPI Eina_Bool ethumb_frame_set (Ethumb *e, const char *theme_file, const char *group, const char *swallow)
 Set the Ethumb Frame. More...
 
EAPI void ethumb_frame_get (const Ethumb *e, const char **theme_file, const char **group, const char **swallow)
 Retreives the current ethumb frame of and Ethumb instance. More...
 
EAPI void ethumb_thumb_dir_path_set (Ethumb *e, const char *path)
 Set the ethumb thumbnails path. More...
 
EAPI const char * ethumb_thumb_dir_path_get (const Ethumb *e)
 Get the ethumb thumbnails path. More...
 
EAPI void ethumb_thumb_category_set (Ethumb *e, const char *category)
 Set the thumbnails category. More...
 
EAPI const char * ethumb_thumb_category_get (const Ethumb *e)
 Get the thumbnails category. More...
 
EAPI void ethumb_video_start_set (Ethumb *e, float start)
 set the video play start point More...
 
EAPI float ethumb_video_start_get (const Ethumb *e)
 get the video play start point More...
 
EAPI void ethumb_video_time_set (Ethumb *e, float t)
 Set the video time (duration) in seconds. More...
 
EAPI float ethumb_video_time_get (const Ethumb *e)
 Get the video time (duration) in seconds. More...
 
EAPI void ethumb_video_interval_set (Ethumb *e, float interval)
 Set the video frame interval, in seconds. More...
 
EAPI float ethumb_video_interval_get (const Ethumb *e)
 Get the video frame interval, in seconds. More...
 
EAPI void ethumb_video_ntimes_set (Ethumb *e, unsigned int ntimes)
 Set the number of times the video loops (if applicable). More...
 
EAPI unsigned int ethumb_video_ntimes_get (const Ethumb *e)
 Get the number of times the video loops (if applicable). More...
 
EAPI void ethumb_video_fps_set (Ethumb *e, unsigned int fps)
 Set the thumbnail framerate. More...
 
EAPI unsigned int ethumb_video_fps_get (const Ethumb *e)
 Get the thumbnail framerate. More...
 
EAPI void ethumb_document_page_set (Ethumb *e, unsigned int page)
 Set the page number to thumbnail in paged documents. More...
 
EAPI unsigned int ethumb_document_page_get (const Ethumb *e)
 Get the page number thumbnailed in paged documents. More...
 
EAPI Eina_Bool ethumb_file_set (Ethumb *e, const char *path, const char *key)
 Set the file for which to generate thumbnails. More...
 
EAPI void ethumb_file_get (const Ethumb *e, const char **path, const char **key)
 Get the file for which to generate thumbnails. More...
 
static const char * _ethumb_generate_hash (const char *file)
 
static int _ethumb_file_check_fdo (Ethumb *e)
 
static const char * _ethumb_file_generate_custom_category (Ethumb *e)
 
static void _ethumb_file_generate_path (Ethumb *e)
 
EAPI void ethumb_file_free (Ethumb *e)
 Reset the source file information. More...
 
EAPI void ethumb_thumb_path_set (Ethumb *e, const char *path, const char *key)
 
EAPI void ethumb_thumb_path_get (Ethumb *e, const char **path, const char **key)
 
EAPI void ethumb_thumb_hash (Ethumb *e)
 
EAPI void ethumb_thumb_hash_copy (Ethumb *dst, const Ethumb *src)
 
EAPI void ethumb_calculate_aspect_from_ratio (Ethumb *e, float ia, int *w, int *h)
 
EAPI void ethumb_calculate_aspect (Ethumb *e, int iw, int ih, int *w, int *h)
 
EAPI void ethumb_calculate_fill_from_ratio (Ethumb *e, float ia, int *fx, int *fy, int *fw, int *fh)
 
EAPI void ethumb_calculate_fill (Ethumb *e, int iw, int ih, int *fx, int *fy, int *fw, int *fh)
 
static Eina_Bool _ethumb_plugin_generate (Ethumb *e)
 
EAPI Eina_Bool ethumb_plugin_image_resize (Ethumb *e, int w, int h)
 
EAPI Eina_Bool ethumb_image_save (Ethumb *e)
 
static void _ethumb_image_orient (Ethumb *e, int orientation)
 
static int _ethumb_image_load (Ethumb *e)
 
static Eina_Bool _ethumb_finished_idler_cb (void *data)
 
EAPI void ethumb_finished_callback_call (Ethumb *e, int result)
 
EAPI Eina_Bool ethumb_generate (Ethumb *e, Ethumb_Generate_Cb finished_cb, const void *data, Eina_Free_Cb free_data)
 Generate the thumbnail. More...
 
EAPI Eina_Bool ethumb_exists (Ethumb *e)
 test if the thumbnailer exists More...
 
EAPI Evasethumb_evas_get (const Ethumb *e)
 
EAPI Ecore_Evas * ethumb_ecore_evas_get (const Ethumb *e)
 
EAPI Ethumbethumb_dup (const Ethumb *e)
 Duplicate an thumbnailer. More...
 
EAPI Eina_Bool ethumb_cmp (const Ethumb *e1, const Ethumb *e2)
 Compare two thumbnailers. More...
 
EAPI unsigned int ethumb_length (const void *key)
 
EAPI int ethumb_key_cmp (const void *key1, int key1_length, const void *key2, int key2_length)
 
EAPI int ethumb_hash (const void *key, int key_length)
 

Variables

static Ethumb_Version _version = { VMAJ, VMIN, VMIC, VREV }
 
EAPI Ethumb_Versionethumb_version = &_version
 
static int _log_dom = -1
 
static int initcount = 0
 
static Eina_Bool _plugins_loaded = EINA_FALSE
 
static const char * _home_thumb_dir = NULL
 
static const char * _thumb_category_normal = NULL
 
static const char * _thumb_category_large = NULL
 
static const int THUMB_SIZE_NORMAL = 128
 
static const int THUMB_SIZE_LARGE = 256
 
static Eina_Hash_plugins_ext = NULL
 
static Eina_Array_plugins = NULL
 
static Eina_Prefix_pfx = NULL
 
static const char ACCEPTABLE_URI_CHARS [96]
 

Detailed Description

Copyright (C) 2009 by ProFUSION embedded systems.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, see http://www.gnu.org/licenses/.

Author
Rafael Antognolli antog.nosp@m.noll.nosp@m.i@pro.nosp@m.fusi.nosp@m.on.mo.nosp@m.bi

Macro Definition Documentation

◆ CHECK_DELTA

#define CHECK_DELTA (   Param)
Value:
if (e1->Param != e2->Param) \
return EINA_TRUE;
#define EINA_TRUE
boolean value TRUE (numerical value 1)
Definition: eina_types.h:539

◆ CHECK_FLT_DELTA

#define CHECK_FLT_DELTA (   Param)
Value:
if (!EINA_FLT_EQ(e1->Param, e2->Param)) \
return EINA_TRUE;
#define EINA_FLT_EQ(a, b)
Safe comparison of float.
Definition: eina_util.h:81

◆ CMP_PARAM

#define CMP_PARAM (   Param)
Value:
if (e1->Param != e2->Param) \
return e1->Param - e2->Param;

◆ CMP_FLT_PARAM

#define CMP_FLT_PARAM (   Param)
Value:
if (!EINA_FLT_EQ(e1->Param, e2->Param)) \
return e1->Param - e2->Param;

Variable Documentation

◆ ACCEPTABLE_URI_CHARS

const char ACCEPTABLE_URI_CHARS[96]
static
Initial value:
= {
0x00,0x3F,0x20,0x20,0x28,0x00,0x2C,0x3F,0x3F,0x3F,0x3F,0x2A,0x28,0x3F,0x3F,0x1C,
0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x38,0x20,0x20,0x2C,0x20,0x20,
0x38,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,
0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x20,0x20,0x20,0x20,0x3F,
0x20,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,
0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x20,0x20,0x20,0x3F,0x20
}