diff options
author | Aditya Y Jeppu <quantimoney> | 2021-09-21 11:38:15 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-09-21 11:55:04 +0300 |
commit | 997b5fe45dab8bd0e2976c8b673e56266134fc80 (patch) | |
tree | b8813b36decf96908507f6633cf909717bcfa534 /source/blender/sequencer/SEQ_render.h | |
parent | fa2c1698b077f510175e79adf3dbf3e1602b1030 (diff) |
VSE strip thumbnails
Draw thumbnails as strip overlay. This works for movie and image strips.
To draw thumbnails, this overlay has to be enabled and strips must be
tall enough.
The thumbnails are loaded from source file using separate thread and
stored in cache.
Drawing code uses only images stored in cache, and if any is missing,
background rendering job is started. If job can not render thumbnail,
to prevent endless loop of creating job for missing image it sets
`SEQ_FLAG_SKIP_THUMBNAILS` bit of `Sequence` flag.
To prevent visual glitches during timeline panning and zooming, `View2D`
flag `V2D_IS_NAVIGATING` is implemented. If bit is set, drawing code
will look for set of evenly distributed thumbnails that should be
guaranteed to exist and also set of previously displayed thumbnails.
Due to volatile nature of cache these thumbnails can be missing anyway,
in which case no new thumbnails will be drawn for particular strip.
Cache capacity is limited to 5000 thumbnails and performs cleanup of
non visible images when limit is reached.
ref T89143
Reviewed By: ISS
Differential Revision: https://developer.blender.org/D12266
Diffstat (limited to 'source/blender/sequencer/SEQ_render.h')
-rw-r--r-- | source/blender/sequencer/SEQ_render.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/sequencer/SEQ_render.h b/source/blender/sequencer/SEQ_render.h index c138daf1318..50280db55ff 100644 --- a/source/blender/sequencer/SEQ_render.h +++ b/source/blender/sequencer/SEQ_render.h @@ -27,6 +27,8 @@ extern "C" { #endif +#define SEQ_RENDER_THUMB_SIZE 256 + struct ListBase; struct Main; struct Scene; @@ -67,6 +69,25 @@ struct ImBuf *SEQ_render_give_ibuf(const SeqRenderData *context, struct ImBuf *SEQ_render_give_ibuf_direct(const SeqRenderData *context, float timeline_frame, struct Sequence *seq); +void SEQ_render_thumbnails(const struct SeqRenderData *context, + struct Sequence *seq, + struct Sequence *seq_orig, + float start_frame, + float frame_step, + rctf *view_area, + short *stop); +struct ImBuf *SEQ_get_thumbnail(const struct SeqRenderData *context, + struct Sequence *seq, + float timeline_frame, + rcti *crop, + bool clipped); +int SEQ_render_thumbnails_guaranteed_set_frame_step_get(const struct Sequence *seq); +void SEQ_render_thumbnails_base_set(const struct SeqRenderData *context, + struct Sequence *seq, + struct Sequence *seq_orig, + rctf *view_area, + short *stop); + void SEQ_render_init_colorspace(struct Sequence *seq); void SEQ_render_new_render_data(struct Main *bmain, struct Depsgraph *depsgraph, |