Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarley Acheson <harley.acheson@gmail.com>2022-05-05 02:55:59 +0300
committerHarley Acheson <harley.acheson@gmail.com>2022-05-05 02:55:59 +0300
commit8960c6e06017a3c3fc90c5745433009c00e64c1b (patch)
tree89f12f886c8d9b7b6f2412a47daf45053695c2d0 /source/blender/imbuf/intern/IMB_filetype.h
parented0964c97623a7542dab900ebda900f3953db4bb (diff)
IMBUF: Faster JPEG Thumbnails
Make preview thumbnails of JPEG files in less time and with less RAM. See D14727 for more details. Differential Revision: https://developer.blender.org/D14727 Reviewed by Brecht Van Lommel
Diffstat (limited to 'source/blender/imbuf/intern/IMB_filetype.h')
-rw-r--r--source/blender/imbuf/intern/IMB_filetype.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/imbuf/intern/IMB_filetype.h b/source/blender/imbuf/intern/IMB_filetype.h
index 31f8b3a9505..bcca6f9fd85 100644
--- a/source/blender/imbuf/intern/IMB_filetype.h
+++ b/source/blender/imbuf/intern/IMB_filetype.h
@@ -36,6 +36,15 @@ typedef struct ImFileType {
char colorspace[IM_MAX_SPACE]);
/** Load an image from a file. */
struct ImBuf *(*load_filepath)(const char *filepath, int flags, char colorspace[IM_MAX_SPACE]);
+ /** Load/Create a thumbnail image from a filepath. `max_thumb_size` is maximum size of either
+ * dimension, so can return less on either or both. Should, if possible and performant, return
+ * dimensions of the full-size image in width_r & height_r. */
+ struct ImBuf *(*load_filepath_thumbnail)(const char *filepath,
+ const int flags,
+ const size_t max_thumb_size,
+ size_t *width_r,
+ size_t *height_r,
+ char colorspace[IM_MAX_SPACE]);
/** Save to a file (or memory if #IB_mem is set in `flags` and the format supports it). */
bool (*save)(struct ImBuf *ibuf, const char *filepath, int flags);
void (*load_tile)(struct ImBuf *ibuf,
@@ -143,6 +152,12 @@ struct ImBuf *imb_load_jpeg(const unsigned char *buffer,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
+struct ImBuf *imb_thumbnail_jpeg(const char *filepath,
+ const int flags,
+ const size_t max_thumb_size,
+ size_t *width_r,
+ size_t *height_r,
+ char colorspace[IM_MAX_SPACE]);
/** \} */