4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * The Original Code is Copyright (C) 2007 Blender Foundation
21 * All rights reserved.
23 * The Original Code is: all of this file.
25 * Contributor(s): Andrea Weikert.
27 * ***** END GPL LICENSE BLOCK *****
30 /** \file blender/imbuf/IMB_thumbs.h
44 /** Thumbnail creation and retrieval according to the 'Thumbnail Management Standard'
45 * supported by Gimp, Gnome (Nautilus), KDE etc.
46 * Reference: http://jens.triq.net/thumbnail-spec/index.html
50 typedef enum ThumbSize {
56 typedef enum ThumbSource {
62 /* dont generate thumbs for images bigger then this (100mb) */
63 #define THUMB_SIZE_MAX (100 * 1024*1024)
67 /* create thumbnail for file and returns new imbuf for thumbnail */
68 ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, ImBuf *ibuf);
70 /* read thumbnail for file and returns new imbuf for thumbnail */
71 ImBuf* IMB_thumb_read(const char* path, ThumbSize size);
73 /* delete all thumbs for the file */
74 void IMB_thumb_delete(const char* path, ThumbSize size);
76 /* return the state of the thumb, needed to determine how to manage the thumb */
77 ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source);
79 /* create the necessary dirs to store the thumbnails */
80 void IMB_thumb_makedirs(void);
82 /* special function for loading a thumbnail embedded into a blend file */
83 ImBuf *IMB_loadblend_thumb(const char *path);
84 void IMB_overlayblend_thumb(unsigned int *thumb, int width, int height, float aspect);
88 #endif /* __cplusplus */
90 #endif /* _IMB_THUMBS_H */