Cleanup: Subdiv: Remove common_ prefix
[blender.git] / source / blender / sequencer / SEQ_thumbnail_cache.hh
blobc431c9c3c0331edc78253ea9810656e477704d04
1 /* SPDX-FileCopyrightText: 2024 Blender Authors
3 * SPDX-License-Identifier: GPL-2.0-or-later */
5 /** \file
6 * \ingroup sequencer
7 */
9 #pragma once
11 struct bContext;
12 struct ImBuf;
13 struct rctf;
14 struct Strip;
15 struct Scene;
17 namespace blender::seq {
19 static constexpr int SEQ_THUMB_SIZE = 256;
21 /**
22 * Get a thumbnail image for given strip `seq` at `timeline_frame`.
24 * The function can return null if a strip type does not have a thumbnail, a source media file is
25 * not found, or the thumbnail has not been loaded yet.
27 * A "closest" thumbnail if there is no exact match can also be returned, e.g. for a movie strip
28 * the closest frame that has a thumbnail already.
30 * When there is no exact match, a request to load a thumbnail will be internally added and
31 * processed in the background. */
32 ImBuf *thumbnail_cache_get(const bContext *C,
33 Scene *scene,
34 const Strip *strip,
35 float timeline_frame);
37 /**
38 * If total amount of resident thumbnails is too large, try to remove oldest-used ones to
39 * keep the cache size in check.
41 void thumbnail_cache_maintain_capacity(Scene *scene);
43 void thumbnail_cache_invalidate_strip(Scene *scene, const Strip *strip);
45 /**
46 * Discard in-flight thumbnail loading requests that are outside of the given view (X coordinate:
47 * timeline frames, Y coordinate: channels).
49 void thumbnail_cache_discard_requests_outside(Scene *scene, const rctf &rect);
51 void thumbnail_cache_clear(Scene *scene);
52 void thumbnail_cache_destroy(Scene *scene);
54 bool strip_can_have_thumbnail(const Scene *scene, const Strip *strip);
56 } // namespace blender::seq