Blender  V2.93
IMB_thumbs.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2007 Blender Foundation
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 struct ImBuf;
31 
38 typedef enum ThumbSize {
43 
44 typedef enum ThumbSource {
50 
51 /* don't generate thumbs for images bigger than this (100mb) */
52 #define THUMB_SIZE_MAX (100 * 1024 * 1024)
53 
54 #define PREVIEW_RENDER_DEFAULT_HEIGHT 128
55 
56 /* Note this can also be used as versioning system,
57  * to force refreshing all thumbnails if e.g. we change some thumb generating code or so.
58  * Only used by fonts so far. */
59 #define THUMB_DEFAULT_HASH "00000000000000000000000000000000"
60 
61 /* create thumbnail for file and returns new imbuf for thumbnail */
62 struct ImBuf *IMB_thumb_create(const char *path,
64  ThumbSource source,
65  struct ImBuf *img);
66 
67 /* read thumbnail for file and returns new imbuf for thumbnail */
68 struct ImBuf *IMB_thumb_read(const char *path, ThumbSize size);
69 
70 /* delete all thumbs for the file */
71 void IMB_thumb_delete(const char *path, ThumbSize size);
72 
73 /* return the state of the thumb, needed to determine how to manage the thumb */
74 struct ImBuf *IMB_thumb_manage(const char *path, ThumbSize size, ThumbSource source);
75 
76 /* create the necessary dirs to store the thumbnails */
77 void IMB_thumb_makedirs(void);
78 
79 /* special function for loading a thumbnail embedded into a blend file */
80 struct ImBuf *IMB_thumb_load_blend(const char *blen_path,
81  const char *blen_group,
82  const char *blen_id);
83 
84 /* special function for previewing fonts */
85 struct ImBuf *IMB_thumb_load_font(const char *filename, unsigned int x, unsigned int y);
86 bool IMB_thumb_load_font_get_hash(char *r_hash);
89 
90 /* Threading */
91 void IMB_thumb_locks_acquire(void);
92 void IMB_thumb_locks_release(void);
93 void IMB_thumb_path_lock(const char *path);
94 void IMB_thumb_path_unlock(const char *path);
95 
96 #ifdef __cplusplus
97 }
98 #endif /* __cplusplus */
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
struct ImBuf * IMB_thumb_load_blend(const char *blen_path, const char *blen_group, const char *blen_id)
Definition: thumbs_blend.c:44
void IMB_thumb_makedirs(void)
Definition: thumbs.c:305
struct ImBuf * IMB_thumb_load_font(const char *filename, unsigned int x, unsigned int y)
Definition: thumbs_font.c:58
struct ImBuf * IMB_thumb_manage(const char *path, ThumbSize size, ThumbSource source)
Definition: thumbs.c:563
ThumbSize
Definition: IMB_thumbs.h:38
@ THB_FAIL
Definition: IMB_thumbs.h:41
@ THB_NORMAL
Definition: IMB_thumbs.h:39
@ THB_LARGE
Definition: IMB_thumbs.h:40
bool IMB_thumb_load_font_get_hash(char *r_hash)
Definition: thumbs_font.c:91
void IMB_thumb_locks_release(void)
Definition: thumbs.c:702
ThumbSource
Definition: IMB_thumbs.h:44
@ THB_SOURCE_IMAGE
Definition: IMB_thumbs.h:45
@ THB_SOURCE_FONT
Definition: IMB_thumbs.h:48
@ THB_SOURCE_BLEND
Definition: IMB_thumbs.h:47
@ THB_SOURCE_MOVIE
Definition: IMB_thumbs.h:46
void IMB_thumb_path_unlock(const char *path)
Definition: thumbs.c:733
void IMB_thumb_delete(const char *path, ThumbSize size)
Definition: thumbs.c:544
void IMB_thumb_path_lock(const char *path)
Definition: thumbs.c:717
void IMB_thumb_locks_acquire(void)
Definition: thumbs.c:686
struct ImBuf * IMB_thumb_create(const char *path, ThumbSize size, ThumbSource source, struct ImBuf *img)
Definition: thumbs.c:512
void IMB_thumb_clear_translations(void)
Definition: thumbs_font.c:44
void IMB_thumb_ensure_translations(void)
Definition: thumbs_font.c:51
struct ImBuf * IMB_thumb_read(const char *path, ThumbSize size)
Definition: thumbs.c:527
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52