diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-04-02 14:50:06 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-04-02 14:54:30 +0400 |
commit | 11ee2d8b97ddbdde9ef5a7b77df2b9f9eb2d0e91 (patch) | |
tree | 45c8792b3bd4efa9567a730a324efb2491284dbe /source/blender/blenkernel | |
parent | 6cd717e0a3c6151f6dc578dcfc27cc269b172c99 (diff) |
implement cache line for image editor
It works exactly the same as a cache line in movie clip editor.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 76643678a0b..c0c028632cf 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -133,6 +133,15 @@ static int imagecache_hashcmp(const void *a_v, const void *b_v) return a->index - b->index; } +static void imagecache_keydata(void *userkey, int *framenr, int *proxy, int *render_flags) +{ + ImageCacheKey *key = (ImageCacheKey *)userkey; + + *framenr = IMA_INDEX_FRAME(key->index); + *proxy = IMB_PROXY_NONE; + *render_flags = 0; +} + static void imagecache_put(Image *image, int index, ImBuf *ibuf) { ImageCacheKey key; @@ -143,6 +152,7 @@ static void imagecache_put(Image *image, int index, ImBuf *ibuf) image->cache = IMB_moviecache_create("Image Datablock Cache", sizeof(ImageCacheKey), imagecache_hashhash, imagecache_hashcmp); + IMB_moviecache_set_getdata_callback(image->cache, imagecache_keydata); } key.index = index; |