Prepare new maemo release
[maemo-rb.git] / apps / plugins / imageviewer / image_decoder.h
blobc27ed33e8e531054a120a237c3b424d187eb4609
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * load image decoder.
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef _IMAGE_DECODER_H
23 #define _IMAGE_DECODER_H
25 #include "imageviewer.h"
27 enum image_type {
28 IMAGE_UNKNOWN = -1,
29 IMAGE_BMP = 0,
30 IMAGE_JPEG,
31 IMAGE_PNG,
32 #ifdef HAVE_LCD_COLOR
33 IMAGE_PPM,
34 #endif
35 IMAGE_GIF,
36 MAX_IMAGE_TYPES
39 struct loader_info {
40 enum image_type type;
41 const struct imgdec_api *iv;
42 unsigned char* buffer;
43 size_t size;
46 /* Check file type by magic number or file extension */
47 enum image_type get_image_type(const char *name, bool quiet);
48 /* Load image decoder */
49 const struct image_decoder *load_decoder(struct loader_info *loader_info);
50 /* Release the loaded decoder */
51 void release_decoder(void);
53 #endif /* _IMAGE_DECODER_H */