Blender V4.3
IMB_thumbs.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11struct ImBuf;
12
24
32
36#define THUMB_SIZE_MAX (100 * 1024 * 1024)
37
38#define PREVIEW_RENDER_DEFAULT_HEIGHT 128
39#define PREVIEW_RENDER_LARGE_HEIGHT 256
40
46#define THUMB_DEFAULT_HASH "00000000000000000000000000000000"
47
52ImBuf *IMB_thumb_create(const char *filepath, ThumbSize size, ThumbSource source, ImBuf *img);
53
59ImBuf *IMB_thumb_read(const char *file_or_lib_path, ThumbSize size);
60
66void IMB_thumb_delete(const char *file_or_lib_path, ThumbSize size);
67
76ImBuf *IMB_thumb_manage(const char *file_or_lib_path, ThumbSize size, ThumbSource source);
77
82
86ImBuf *IMB_thumb_load_blend(const char *blen_path, const char *blen_group, const char *blen_id);
87
91ImBuf *IMB_thumb_load_font(const char *filepath, unsigned int x, unsigned int y);
92bool IMB_thumb_load_font_get_hash(char *r_hash);
93
94ImBuf *IMB_font_preview(const char *filepath, unsigned int width, const float color[4]);
95
96/* Threading */
97
100void IMB_thumb_path_lock(const char *path);
101void IMB_thumb_path_unlock(const char *path);
ImBuf * IMB_thumb_create(const char *filepath, ThumbSize size, ThumbSource source, ImBuf *img)
Definition thumbs.cc:485
ImBuf * IMB_font_preview(const char *filepath, unsigned int width, const float color[4])
ImBuf * IMB_thumb_read(const char *file_or_lib_path, ThumbSize size)
Definition thumbs.cc:499
void IMB_thumb_delete(const char *file_or_lib_path, ThumbSize size)
Definition thumbs.cc:515
ThumbSize
Definition IMB_thumbs.hh:19
@ THB_FAIL
Definition IMB_thumbs.hh:22
@ THB_NORMAL
Definition IMB_thumbs.hh:20
@ THB_LARGE
Definition IMB_thumbs.hh:21
bool IMB_thumb_load_font_get_hash(char *r_hash)
void IMB_thumb_path_unlock(const char *path)
Definition thumbs.cc:718
ThumbSource
Definition IMB_thumbs.hh:25
@ THB_SOURCE_IMAGE
Definition IMB_thumbs.hh:26
@ THB_SOURCE_FONT
Definition IMB_thumbs.hh:29
@ THB_SOURCE_BLEND
Definition IMB_thumbs.hh:28
@ THB_SOURCE_MOVIE
Definition IMB_thumbs.hh:27
@ THB_SOURCE_OBJECT_IO
Definition IMB_thumbs.hh:30
void IMB_thumb_locks_acquire()
Definition thumbs.cc:671
ImBuf * IMB_thumb_manage(const char *file_or_lib_path, ThumbSize size, ThumbSource source)
Definition thumbs.cc:533
void IMB_thumb_path_lock(const char *path)
Definition thumbs.cc:702
ImBuf * IMB_thumb_load_blend(const char *blen_path, const char *blen_group, const char *blen_id)
ImBuf * IMB_thumb_load_font(const char *filepath, unsigned int x, unsigned int y)
void IMB_thumb_locks_release()
Definition thumbs.cc:687
void IMB_thumb_makedirs()
Definition thumbs.cc:298
signed char int8_t
Definition stdint.h:75
char filepath[IMB_FILEPATH_SIZE]