diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-06-30 16:37:32 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-07-01 10:44:07 +0300 |
commit | 72b9e07cf26ddeb26ea8773004b951a7f1bff7c5 (patch) | |
tree | b76794bee925c8509ea1ba203938f51e671655e9 /source/blender/blenkernel/BKE_image.h | |
parent | dfa5bd689e470ad9b8fc7328927afdbe0159e0c1 (diff) |
Add helper function to replace buffer of a single-frame image
Very similar to BKE_image_add_from_imbuf with the exception that no
new image data-block is created, but instead the given one is modified.
Diffstat (limited to 'source/blender/blenkernel/BKE_image.h')
-rw-r--r-- | source/blender/blenkernel/BKE_image.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h index 1f131568900..e54932fbc4e 100644 --- a/source/blender/blenkernel/BKE_image.h +++ b/source/blender/blenkernel/BKE_image.h @@ -195,6 +195,14 @@ struct Image *BKE_image_add_generated(struct Main *bmain, struct Image *BKE_image_add_from_imbuf(struct Main *bmain, struct ImBuf *ibuf, const char *name); /** + * For a non-viewer single-buffer image (single frame file, or generated image) replace its image + * buffer with the given one. + * If an unsupported image type (multi-layer, image sequence, ...) the function will assert in the + * debug mode and will have an underfined behavior in the release mode. + */ +void BKE_image_replace_imbuf(struct Image *image, struct ImBuf *ibuf); + +/** * For reload, refresh, pack. */ void BKE_imageuser_default(struct ImageUser *iuser); |