Blender V5.3
IMB_cache.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
5#pragma once
6
10
11#include "BLI_ghash.hh"
12struct ImBufCacheIter;
13namespace blender {
14
15/* Cache system for movie data - now supports storing ImBufs only
16 * Supposed to provide unified cache system for movie clips, sequencer and
17 * other movie-related areas */
18
19struct ImBuf;
20struct ImBufCache;
21
22using ImBufCacheGetKeyDataFP = void (*)(void *userkey,
23 int *framenr,
24 int *proxy,
25 int *render_flags);
26
27using ImBufCacheGetPriorityDataFP = void *(*)(void *userkey);
28using ImBufCacheGetItemPriorityFP = int (*)(void *last_userkey, void *priority_data);
29using ImBufCachePriorityDeleterFP = void (*)(void *priority_data);
30
31void IMB_cache_init();
33
34ImBufCache *IMB_cache_create(const char *name, int keysize, GHashHashFP hashfp, GHashCmpFP cmpfp);
37 ImBufCacheGetPriorityDataFP getprioritydatafp,
38 ImBufCacheGetItemPriorityFP getitempriorityfp,
39 ImBufCachePriorityDeleterFP prioritydeleterfp);
40
41void IMB_cache_put(ImBufCache *cache, void *userkey, ImBuf *ibuf);
42bool IMB_cache_put_if_possible(ImBufCache *cache, void *userkey, ImBuf *ibuf);
43ImBuf *IMB_cache_get(ImBufCache *cache, void *userkey, bool *r_is_cached_empty);
44void IMB_cache_remove(ImBufCache *cache, void *userkey);
45bool IMB_cache_has_frame(ImBufCache *cache, void *userkey);
46void IMB_cache_free(ImBufCache *cache);
47
49 bool(cleanup_check_cb)(ImBuf *ibuf, void *userkey, void *userdata),
50 void *userdata);
51
56 ImBufCache *cache, int proxy, int render_flags, int *r_totseg, int **r_points);
57
58ImBufCacheIter *IMB_cacheIter_new(ImBufCache *cache);
59void IMB_cacheIter_free(ImBufCacheIter *iter);
60bool IMB_cacheIter_done(ImBufCacheIter *iter);
61void IMB_cacheIter_step(ImBufCacheIter *iter);
62ImBuf *IMB_cacheIter_getImBuf(ImBufCacheIter *iter);
63void *IMB_cacheIter_getUserKey(ImBufCacheIter *iter);
64
65} // namespace blender
BMesh Iterators.
void IMB_cacheIter_step(ImBufCacheIter *iter)
Definition cache.cc:597
void * IMB_cacheIter_getUserKey(ImBufCacheIter *iter)
Definition cache.cc:609
void IMB_cache_get_cache_segments(ImBufCache *cache, int proxy, int render_flags, int *r_totseg, int **r_points)
Definition cache.cc:491
unsigned int(*) GHashHashFP(const void *key)
Definition BLI_ghash.hh:33
void IMB_cache_free(ImBufCache *cache)
Definition cache.cc:446
ImBuf * IMB_cacheIter_getImBuf(ImBufCacheIter *iter)
Definition cache.cc:602
ImBufCache * IMB_cache_create(const char *name, int keysize, GHashHashFP hashfp, GHashCmpFP cmpfp)
Definition cache.cc:270
void IMB_cache_put(ImBufCache *cache, void *userkey, ImBuf *ibuf)
Definition cache.cc:369
void(*)(void *priority_data) ImBufCachePriorityDeleterFP
Definition IMB_cache.hh:29
ImBuf * IMB_cache_get(ImBufCache *cache, void *userkey, bool *r_is_cached_empty)
Definition cache.cc:403
bool(*) GHashCmpFP(const void *a, const void *b)
Definition BLI_ghash.hh:35
void IMB_cache_cleanup(ImBufCache *cache, bool(cleanup_check_cb)(ImBuf *ibuf, void *userkey, void *userdata), void *userdata)
Definition cache.cc:467
ImBufCacheIter * IMB_cacheIter_new(ImBufCache *cache)
Definition cache.cc:577
void *(*)(void *userkey) ImBufCacheGetPriorityDataFP
Definition IMB_cache.hh:27
bool IMB_cacheIter_done(ImBufCacheIter *iter)
Definition cache.cc:592
int(*)(void *last_userkey, void *priority_data) ImBufCacheGetItemPriorityFP
Definition IMB_cache.hh:28
void IMB_cache_set_priority_callback(ImBufCache *cache, ImBufCacheGetPriorityDataFP getprioritydatafp, ImBufCacheGetItemPriorityFP getitempriorityfp, ImBufCachePriorityDeleterFP prioritydeleterfp)
Definition cache.cc:299
bool IMB_cache_has_frame(ImBufCache *cache, void *userkey)
Definition cache.cc:434
void IMB_cache_set_getdata_callback(ImBufCache *cache, ImBufCacheGetKeyDataFP getdatafp)
Definition cache.cc:294
bool IMB_cache_put_if_possible(ImBufCache *cache, void *userkey, ImBuf *ibuf)
Definition cache.cc:374
void IMB_cache_destruct()
Definition cache.cc:262
void(*)(void *userkey, int *framenr, int *proxy, int *render_flags) ImBufCacheGetKeyDataFP
Definition IMB_cache.hh:22
void IMB_cache_remove(ImBufCache *cache, void *userkey)
Definition cache.cc:395
void IMB_cacheIter_free(ImBufCacheIter *iter)
Definition cache.cc:587
void IMB_cache_init()
Definition cache.cc:254