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