diff options
author | Adrien Nader <adrien@notk.org> | 2014-10-17 16:53:40 +0200 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2014-10-20 18:28:19 +0200 |
commit | 19a35949dab9b3dfd44a1e063e59132b7ab4f424 (patch) | |
tree | 64791e31ff590c5340d5918c906d5c8541826201 /src/lib/ethumb/Ethumb.h | |
parent | d22917626c29249727844fd5eb98d81d164e450b (diff) |
ethumb: document most functions from ethumb.
Diffstat (limited to 'src/lib/ethumb/Ethumb.h')
-rw-r--r-- | src/lib/ethumb/Ethumb.h | 140 |
1 files changed, 138 insertions, 2 deletions
diff --git a/src/lib/ethumb/Ethumb.h b/src/lib/ethumb/Ethumb.h index 6a1bd4087f..46ab759ad6 100644 --- a/src/lib/ethumb/Ethumb.h +++ b/src/lib/ethumb/Ethumb.h | |||
@@ -144,10 +144,26 @@ typedef struct _Ethumb Ethumb; | |||
144 | */ | 144 | */ |
145 | typedef void (*Ethumb_Generate_Cb)(void *data, Ethumb *e, Eina_Bool success); | 145 | typedef void (*Ethumb_Generate_Cb)(void *data, Ethumb *e, Eina_Bool success); |
146 | 146 | ||
147 | /** | ||
148 | * @brief Initialize ethumb. | ||
149 | * @return 1 or greater on success, 0 otherwise. | ||
150 | */ | ||
147 | EAPI int ethumb_init(void); | 151 | EAPI int ethumb_init(void); |
152 | /** | ||
153 | * @brief Shutdown ethumb, unloading all currently-loaded modules. | ||
154 | * @return 0 if ethumb shuts down, an integer greater than 0 otherwise. | ||
155 | */ | ||
148 | EAPI int ethumb_shutdown(void); | 156 | EAPI int ethumb_shutdown(void); |
149 | 157 | ||
158 | /** | ||
159 | * @brief Create a new ethumb object. | ||
160 | * return The newly-created ethumb object | ||
161 | */ | ||
150 | EAPI Ethumb * ethumb_new(void) EINA_MALLOC EINA_WARN_UNUSED_RESULT; | 162 | EAPI Ethumb * ethumb_new(void) EINA_MALLOC EINA_WARN_UNUSED_RESULT; |
163 | |||
164 | /** | ||
165 | * @brief Free an ethumb object. | ||
166 | */ | ||
151 | EAPI void ethumb_free(Ethumb *e); | 167 | EAPI void ethumb_free(Ethumb *e); |
152 | 168 | ||
153 | /** | 169 | /** |
@@ -212,22 +228,91 @@ typedef enum _Ethumb_Thumb_Orientation | |||
212 | 228 | ||
213 | EAPI void ethumb_thumb_fdo_set(Ethumb *e, Ethumb_Thumb_FDO_Size s) EINA_ARG_NONNULL(1); | 229 | EAPI void ethumb_thumb_fdo_set(Ethumb *e, Ethumb_Thumb_FDO_Size s) EINA_ARG_NONNULL(1); |
214 | 230 | ||
231 | /** | ||
232 | * @brief Set the size of thumbnails. | ||
233 | * | ||
234 | * @param e A pointer to an Ethumb object. | ||
235 | * @param tw Thumbnail width. | ||
236 | * @param th Thumbnail height. | ||
237 | */ | ||
215 | EAPI void ethumb_thumb_size_set(Ethumb *e, int tw, int th) EINA_ARG_NONNULL(1); | 238 | EAPI void ethumb_thumb_size_set(Ethumb *e, int tw, int th) EINA_ARG_NONNULL(1); |
239 | /** | ||
240 | * @brief Get the size of thumbnails. | ||
241 | * | ||
242 | * @param e A pointer to an Ethumb object. | ||
243 | * @param[out] tw Pointer to an int to store the thumbnail width. | ||
244 | * @param[out] th Pointer to an int to store the thumbnail height. | ||
245 | */ | ||
216 | EAPI void ethumb_thumb_size_get(const Ethumb *e, int *tw, int *th) EINA_ARG_NONNULL(1); | 246 | EAPI void ethumb_thumb_size_get(const Ethumb *e, int *tw, int *th) EINA_ARG_NONNULL(1); |
217 | 247 | ||
248 | /** | ||
249 | * @brief Set the fileformat of the thumbnails | ||
250 | * | ||
251 | * Thumbnails are sent compressed; possible formats are PNG, JPEG and EET. | ||
252 | * | ||
253 | * @param e A pointer to an Ethumb object. | ||
254 | */ | ||
218 | EAPI void ethumb_thumb_format_set(Ethumb *e, Ethumb_Thumb_Format f) EINA_ARG_NONNULL(1); | 255 | EAPI void ethumb_thumb_format_set(Ethumb *e, Ethumb_Thumb_Format f) EINA_ARG_NONNULL(1); |
256 | /** | ||
257 | * @brief Get the fileformat of the thumbnails | ||
258 | * | ||
259 | * @param e A pointer to an Ethumb object. | ||
260 | * @return The thumbnail fileformat | ||
261 | * | ||
262 | * @see ethumb_thumb_format_set | ||
263 | */ | ||
219 | EAPI Ethumb_Thumb_Format ethumb_thumb_format_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; | 264 | EAPI Ethumb_Thumb_Format ethumb_thumb_format_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; |
220 | 265 | ||
221 | EAPI void ethumb_thumb_aspect_set(Ethumb *e, Ethumb_Thumb_Aspect a) EINA_ARG_NONNULL(1); | 266 | /** |
267 | * @brief Set the aspect ratio policy. | ||
268 | * | ||
269 | * When the source and thumbnail aspect ratios don't match, this policy sets | ||
270 | * how to adapt from the former to the latter: resize keeping source aspect | ||
271 | * ratio, resize ignoring it or crop. | ||
272 | * | ||
273 | * @param e A pointer to an Ethumb object. | ||
274 | * @param aspect The new aspect ratio policy. | ||
275 | */ | ||
276 | EAPI void ethumb_thumb_aspect_set(Ethumb *e, Ethumb_Thumb_Aspect aspect) EINA_ARG_NONNULL(1); | ||
277 | /** | ||
278 | * @brief Get the aspect ratio policy. | ||
279 | * | ||
280 | * @param e A pointer to an Ethumb object. | ||
281 | * @return The aspect ratio policy. | ||
282 | */ | ||
222 | EAPI Ethumb_Thumb_Aspect ethumb_thumb_aspect_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; | 283 | EAPI Ethumb_Thumb_Aspect ethumb_thumb_aspect_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; |
223 | 284 | ||
224 | EAPI void ethumb_thumb_orientation_set(Ethumb *e, Ethumb_Thumb_Orientation o) EINA_ARG_NONNULL(1); | 285 | /** |
286 | * @brief Set the thumbnail rotation or flip. | ||
287 | * | ||
288 | * @param e A pointer to an Ethumb object. | ||
289 | * @param orientation The new orientation. | ||
290 | */ | ||
291 | EAPI void ethumb_thumb_orientation_set(Ethumb *e, Ethumb_Thumb_Orientation orientation) EINA_ARG_NONNULL(1); | ||
292 | /** | ||
293 | * @brief Get the thumbnail rotation. | ||
294 | * | ||
295 | * @param e A pointer to an Ethumb object. | ||
296 | * @return The current rotation. | ||
297 | */ | ||
225 | EAPI Ethumb_Thumb_Orientation ethumb_thumb_orientation_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; | 298 | EAPI Ethumb_Thumb_Orientation ethumb_thumb_orientation_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; |
226 | 299 | ||
227 | EAPI void ethumb_thumb_crop_align_set(Ethumb *e, float x, float y) EINA_ARG_NONNULL(1); | 300 | EAPI void ethumb_thumb_crop_align_set(Ethumb *e, float x, float y) EINA_ARG_NONNULL(1); |
228 | EAPI void ethumb_thumb_crop_align_get(const Ethumb *e, float *x, float *y) EINA_ARG_NONNULL(1); | 301 | EAPI void ethumb_thumb_crop_align_get(const Ethumb *e, float *x, float *y) EINA_ARG_NONNULL(1); |
229 | 302 | ||
303 | /** | ||
304 | * @brief Set the thumbnail compression quality. | ||
305 | * | ||
306 | * @param e A pointer to an Ethumb object. | ||
307 | * @param quality Compression quality (from 0 to 100, 100 being the best; default is 80) | ||
308 | */ | ||
230 | EAPI void ethumb_thumb_quality_set(Ethumb *e, int quality) EINA_ARG_NONNULL(1); | 309 | EAPI void ethumb_thumb_quality_set(Ethumb *e, int quality) EINA_ARG_NONNULL(1); |
310 | /** | ||
311 | * @brief Get the thumbnail compression quality. | ||
312 | * | ||
313 | * @param e A pointer to an Ethumb object. | ||
314 | * @return The current compression quality (from 0 to 100, 100 being the best) | ||
315 | */ | ||
231 | EAPI int ethumb_thumb_quality_get(const Ethumb *e) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_PURE; | 316 | EAPI int ethumb_thumb_quality_get(const Ethumb *e) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_PURE; |
232 | 317 | ||
233 | EAPI void ethumb_thumb_compress_set(Ethumb *e, int compress) EINA_ARG_NONNULL(1); | 318 | EAPI void ethumb_thumb_compress_set(Ethumb *e, int compress) EINA_ARG_NONNULL(1); |
@@ -239,9 +324,35 @@ EAPI void ethumb_video_time_set(Ethumb *e, float time) EINA_ARG_NONNULL( | |||
239 | EAPI float ethumb_video_time_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; | 324 | EAPI float ethumb_video_time_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; |
240 | EAPI void ethumb_video_interval_set(Ethumb *e, float interval) EINA_ARG_NONNULL(1); | 325 | EAPI void ethumb_video_interval_set(Ethumb *e, float interval) EINA_ARG_NONNULL(1); |
241 | EAPI float ethumb_video_interval_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; | 326 | EAPI float ethumb_video_interval_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; |
327 | |||
328 | /** | ||
329 | * @brief Set the number of times the video loops (if applicable). | ||
330 | * | ||
331 | * @param e A pointer to an Ethumb object. | ||
332 | * @param ntimes The number of times the video loops. | ||
333 | */ | ||
242 | EAPI void ethumb_video_ntimes_set(Ethumb *e, unsigned int ntimes) EINA_ARG_NONNULL(1); | 334 | EAPI void ethumb_video_ntimes_set(Ethumb *e, unsigned int ntimes) EINA_ARG_NONNULL(1); |
335 | /** | ||
336 | * @brief Get the number of times the video loops (if applicable). | ||
337 | * | ||
338 | * @param e A pointer to an Ethumb object. | ||
339 | * @return The number of times the video loops. | ||
340 | */ | ||
243 | EAPI unsigned int ethumb_video_ntimes_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; | 341 | EAPI unsigned int ethumb_video_ntimes_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; |
342 | |||
343 | /** | ||
344 | * @brief Set the thumbnail framerate. | ||
345 | * | ||
346 | * @param e A pointer to an Ethumb object. | ||
347 | * @param fps New framerate of the thumbnail (default 10). | ||
348 | */ | ||
244 | EAPI void ethumb_video_fps_set(Ethumb *e, unsigned int fps) EINA_ARG_NONNULL(1); | 349 | EAPI void ethumb_video_fps_set(Ethumb *e, unsigned int fps) EINA_ARG_NONNULL(1); |
350 | /** | ||
351 | * @brief Get the thumbnail framerate. | ||
352 | * | ||
353 | * @param e A pointer to an Ethumb object. | ||
354 | * @return Current framerate of the thumbnail. | ||
355 | */ | ||
245 | EAPI unsigned int ethumb_video_fps_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; | 356 | EAPI unsigned int ethumb_video_fps_get(const Ethumb *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; |
246 | 357 | ||
247 | 358 | ||
@@ -255,8 +366,33 @@ EAPI unsigned int ethumb_document_page_get(const Ethumb *e) EINA_WARN_UNUSED_RES | |||
255 | * @addtogroup Ethumb_Basics Ethumb Basics | 366 | * @addtogroup Ethumb_Basics Ethumb Basics |
256 | * @{ | 367 | * @{ |
257 | */ | 368 | */ |
369 | |||
370 | /** | ||
371 | * @brief Set the file for which to generate thumbnails. | ||
372 | * | ||
373 | * @param e A pointer to an Ethumb object. | ||
374 | * @param path The file to use. | ||
375 | * @param key If @a path allows storing multiple resources in a single file | ||
376 | * (EET or Edje for instance), @a key is the key used to locate the | ||
377 | * right resource inside the file. NULL if not applicable. | ||
378 | */ | ||
258 | EAPI Eina_Bool ethumb_file_set(Ethumb *e, const char *path, const char *key) EINA_ARG_NONNULL(1, 2); | 379 | EAPI Eina_Bool ethumb_file_set(Ethumb *e, const char *path, const char *key) EINA_ARG_NONNULL(1, 2); |
380 | /** | ||
381 | * @brief Get the file for which to generate thumbnails. | ||
382 | * | ||
383 | * @param e A pointer to an Ethumb object. | ||
384 | * @param[out] path The file being used. | ||
385 | * @param[out] key The key used to locate the right resource in case the file | ||
386 | * can store several of them. NULL if not applicable. | ||
387 | * @see ethumb_file_set | ||
388 | */ | ||
259 | EAPI void ethumb_file_get(const Ethumb *e, const char **path, const char **key) EINA_ARG_NONNULL(1); | 389 | EAPI void ethumb_file_get(const Ethumb *e, const char **path, const char **key) EINA_ARG_NONNULL(1); |
390 | |||
391 | /** | ||
392 | * @brief Reset the source file information. | ||
393 | * | ||
394 | * @param e A pointer to an Ethumb object. | ||
395 | */ | ||
260 | EAPI void ethumb_file_free(Ethumb *e) EINA_ARG_NONNULL(1); | 396 | EAPI void ethumb_file_free(Ethumb *e) EINA_ARG_NONNULL(1); |
261 | 397 | ||
262 | EAPI Eina_Bool ethumb_generate(Ethumb *e, Ethumb_Generate_Cb finished_cb, const void *data, Eina_Free_Cb free_data) EINA_ARG_NONNULL(1, 2); | 398 | EAPI Eina_Bool ethumb_generate(Ethumb *e, Ethumb_Generate_Cb finished_cb, const void *data, Eina_Free_Cb free_data) EINA_ARG_NONNULL(1, 2); |