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