Blender  V2.59
IMB_thumbs.h
Go to the documentation of this file.
00001 /*
00002  * $Id: IMB_thumbs.h 36433 2011-05-02 10:22:49Z campbellbarton $ 
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version. 
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2007 Blender Foundation
00021  * All rights reserved.
00022  *
00023  * The Original Code is: all of this file.
00024  *
00025  * Contributor(s): Andrea Weikert.
00026  *
00027  * ***** END GPL LICENSE BLOCK *****
00028  */
00029 
00035 #ifndef _IMB_THUMBS_H
00036 #define _IMB_THUMBS_H
00037 
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041 
00042 struct ImBuf;
00043 
00050 typedef enum ThumbSize {
00051         THB_NORMAL,
00052         THB_LARGE,
00053         THB_FAIL
00054 } ThumbSize;
00055 
00056 typedef enum ThumbSource {
00057         THB_SOURCE_IMAGE,
00058         THB_SOURCE_MOVIE,
00059         THB_SOURCE_BLEND
00060 } ThumbSource;
00061 
00062 /* dont generate thumbs for images bigger then this (100mb) */
00063 #define THUMB_SIZE_MAX (100 * 1024*1024)
00064 
00065 // IB_metadata
00066 
00067 /* create thumbnail for file and returns new imbuf for thumbnail */
00068 ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, ImBuf *ibuf);
00069 
00070 /* read thumbnail for file and returns new imbuf for thumbnail */
00071 ImBuf* IMB_thumb_read(const char* path, ThumbSize size);
00072 
00073 /* delete all thumbs for the file */
00074 void IMB_thumb_delete(const char* path, ThumbSize size);
00075 
00076 /* return the state of the thumb, needed to determine how to manage the thumb */
00077 ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source);
00078 
00079 /* create the necessary dirs to store the thumbnails */
00080 void IMB_thumb_makedirs(void);
00081 
00082 /* special function for loading a thumbnail embedded into a blend file */
00083 ImBuf *IMB_loadblend_thumb(const char *path);
00084 void IMB_overlayblend_thumb(unsigned int *thumb, int width, int height, float aspect);
00085 
00086 #ifdef __cplusplus
00087 }
00088 #endif /* __cplusplus */
00089 
00090 #endif /* _IMB_THUMBS_H */
00091