ethumb.c File Reference

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

## Macros

#define | PATH_MAX 4096
#define | DBG(...)
#define | INF(...)
#define | WRN(...)
#define | ERR(...)
#define | _check_uri_char(c)
#define | CHECK_DELTA(Param)
#define | CHECK_FLT_DELTA(Param)
#define | CMP_PARAM(Param)
#define | CMP_FLT_PARAM(Param)
#define | HASH_PARAM_I(Param)
#define | HASH_PARAM_P(Param)
#define | HASH_PARAM_D(Param)
#define | HASH_PARAM_F(Param)

## 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.
EAPI int | ethumb_shutdown (void)
| Shutdown ethumb, unloading all currently-loaded modules.
EAPI Ethumb * | ethumb_new (void)
| Create a new ethumb object.
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.
EAPI void | ethumb_thumb_size_get (const Ethumb *e, int *tw, int *th)
| Get the size of thumbnails.
EAPI void | ethumb_thumb_format_set (Ethumb *e, Ethumb_Thumb_Format f)
| Set the fileformat of the thumbnails.
EAPI Ethumb_Thumb_Format | ethumb_thumb_format_get (const Ethumb *e)
| Get the fileformat of the thumbnails.
EAPI void | ethumb_thumb_aspect_set (Ethumb *e, Ethumb_Thumb_Aspect a)
| Set the aspect ratio policy.
EAPI Ethumb_Thumb_Aspect | ethumb_thumb_aspect_get (const Ethumb *e)
| Get the aspect ratio policy.
EAPI void | ethumb_thumb_orientation_set (Ethumb *e, Ethumb_Thumb_Orientation o)
| Set the thumbnail rotation or flip.
EAPI Ethumb_Thumb_Orientation | ethumb_thumb_orientation_get (const Ethumb *e)
| Get the thumbnail rotation.
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.
EAPI int | ethumb_thumb_quality_get (const Ethumb *e)
| Get the thumbnail compression quality.
EAPI void | ethumb_thumb_compress_set (Ethumb *e, int compress)
| Set the compression rate.
EAPI int | ethumb_thumb_compress_get (const Ethumb *e)
| Get the compression rate.
EAPI Eina_Bool | ethumb_frame_set (Ethumb *e, const char *theme_file, const char *group, const char *swallow)
| Set the Ethumb Frame.
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.
EAPI void | ethumb_thumb_dir_path_set (Ethumb *e, const char *path)
| Set the ethumb thumbnails path.
EAPI const char * | ethumb_thumb_dir_path_get (const Ethumb *e)
| Get the ethumb thumbnails path.
EAPI void | ethumb_thumb_category_set (Ethumb *e, const char *category)
| Set the thumbnails category.
EAPI const char * | ethumb_thumb_category_get (const Ethumb *e)
| Get the thumbnails category.
EAPI void | ethumb_video_start_set (Ethumb *e, float start)
| set the video play start point
EAPI float | ethumb_video_start_get (const Ethumb *e)
| get the video play start point
EAPI void | ethumb_video_time_set (Ethumb *e, float t)
| Set the video time (duration) in seconds.
EAPI float | ethumb_video_time_get (const Ethumb *e)
| Get the video time (duration) in seconds.
EAPI void | ethumb_video_interval_set (Ethumb *e, float interval)
| Set the video frame interval, in seconds.
EAPI float | ethumb_video_interval_get (const Ethumb *e)
| Get the video frame interval, in seconds.
EAPI void | ethumb_video_ntimes_set (Ethumb *e, unsigned int ntimes)
| Set the number of times the video loops (if applicable).
EAPI unsigned int | ethumb_video_ntimes_get (const Ethumb *e)
| Get the number of times the video loops (if applicable).
EAPI void | ethumb_video_fps_set (Ethumb *e, unsigned int fps)
| Set the thumbnail framerate.
EAPI unsigned int | ethumb_video_fps_get (const Ethumb *e)
| Get the thumbnail framerate.
EAPI void | ethumb_document_page_set (Ethumb *e, unsigned int page)
| Set the page number to thumbnail in paged documents.
EAPI unsigned int | ethumb_document_page_get (const Ethumb *e)
| Get the page number thumbnailed in paged documents.
EAPI Eina_Bool | ethumb_file_set (Ethumb *e, const char *path, const char *key)
| Set the file for which to generate thumbnails.
EAPI void | ethumb_file_get (const Ethumb *e, const char **path, const char **key)
| Get the file for which to generate thumbnails.
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.
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.
EAPI Eina_Bool | ethumb_exists (Ethumb *e)
| test if the thumbnailer exists
EAPI Evas * | ethumb_evas_get (const Ethumb *e)
EAPI Ecore_Evas * | ethumb_ecore_evas_get (const Ethumb *e)
EAPI Ethumb * | ethumb_dup (const Ethumb *e)
| Duplicate an thumbnailer.
EAPI Eina_Bool | ethumb_cmp (const Ethumb *e1, const Ethumb *e2)
| Compare two thumbnailers.
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_Version * | ethumb_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

## DBG

#define DBG | ( |  | ... | ) |

Value:
EINA_LOG_DOM_DBG(_log_dom, __VA_ARGS__)
EINA_LOG_DOM_DBG
#define EINA_LOG_DOM_DBG(DOM, fmt,...)
Logs a message with level DEBUG on the specified domain and format.
Definition eina_log.h:350

## INF

#define INF | ( |  | ... | ) |

Value:
EINA_LOG_DOM_INFO(_log_dom, __VA_ARGS__)
EINA_LOG_DOM_INFO
#define EINA_LOG_DOM_INFO(DOM, fmt,...)
Logs a message with level INFO on the specified domain and format.
Definition eina_log.h:343

## WRN

#define WRN | ( |  | ... | ) |

Value:
EINA_LOG_DOM_WARN(_log_dom, __VA_ARGS__)
EINA_LOG_DOM_WARN
#define EINA_LOG_DOM_WARN(DOM, fmt,...)
Logs a message with level WARN on the specified domain and format.
Definition eina_log.h:357

## ERR

#define ERR | ( |  | ... | ) |

Value:
EINA_LOG_DOM_ERR(_log_dom, __VA_ARGS__)
EINA_LOG_DOM_ERR
#define EINA_LOG_DOM_ERR(DOM, fmt,...)
Logs a message with level ERROR on the specified domain and format.
Definition eina_log.h:336

## _check_uri_char

#define _check_uri_char | ( |  | c | ) |

Value:
((c) >= 32 && (c) < 128 && (ACCEPTABLE_URI_CHARS[(c) - 32] & 0x08))

## CHECK_DELTA

#define CHECK_DELTA | ( |  | Param | ) |

Value:
if (e1->Param != e2->Param) \
return EINA_TRUE;
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;
EINA_FLT_EQ
#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;

## HASH_PARAM_I

#define HASH_PARAM_I | ( |  | Param | ) |

Value:
r ^= eina_hash_int32((unsigned int*) &e->Param, 0);
eina_hash_int32
static int eina_hash_int32(const unsigned int *pkey, int len)
Hash function from http://web.archive.org/web/20071223173210/http://www.concentric....

## HASH_PARAM_P

#define HASH_PARAM_P | ( |  | Param | ) |

Value:
r ^= eina_hash_int32((unsigned int*) &e->Param, 0);

## HASH_PARAM_D

#define HASH_PARAM_D | ( |  | Param | ) |

Value:
r ^= eina_hash_int64((unsigned long long int*)&e->Param, 0);
eina_hash_int64
static int eina_hash_int64(const unsigned long long int *pkey, int len)
Hash function from http://web.archive.org/web/20071223173210/http://www.concentric....

## HASH_PARAM_F

#define HASH_PARAM_F | ( |  | Param | ) |

Value:
r ^= eina_hash_int32((unsigned int*) &e->Param, 0);

## 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
}