diff options
author | Jeroen Bakker <jeroen@blender.org> | 2021-03-02 12:14:10 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-03-02 12:14:10 +0300 |
commit | 8dec6452f22013ee98246ea6d7631c2201a6de3a (patch) | |
tree | 4f16308508f8f76654c796483de7fc2d547c0a21 /source/blender/blenkernel/BKE_cryptomatte.hh | |
parent | c4ef90f5a0b1d05b16187eb6e32323defe6461c0 (diff) |
Cryptomatte: Session from Existing Render Result.
Utility to construct a cryptomatte session from a render result or
openexr file. This will allow D3959 to be more aware of the context
it is working on and would also support external render engines in
the cryptomatte color picker.
Diffstat (limited to 'source/blender/blenkernel/BKE_cryptomatte.hh')
-rw-r--r-- | source/blender/blenkernel/BKE_cryptomatte.hh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_cryptomatte.hh b/source/blender/blenkernel/BKE_cryptomatte.hh index 16f4da18e1e..f10b4c1f7c4 100644 --- a/source/blender/blenkernel/BKE_cryptomatte.hh +++ b/source/blender/blenkernel/BKE_cryptomatte.hh @@ -86,4 +86,21 @@ struct CryptomatteLayer { std::optional<std::string> operator[](float encoded_hash) const; }; +struct CryptomatteStampDataCallbackData { + struct CryptomatteSession *session; + blender::Map<std::string, std::string> hash_to_layer_name; + + /** + * Extract the hash from a stamp data key. + * + * Cryptomatte keys are formatted as "cryptomatte/{layer_hash}/{attribute}". + */ + static blender::StringRef extract_layer_hash(blender::StringRefNull key); + + /* C type callback function (StampCallback). */ + static void extract_layer_names(void *_data, const char *propname, char *propvalue, int len); + /* C type callback function (StampCallback). */ + static void extract_layer_manifest(void *_data, const char *propname, char *propvalue, int len); +}; + } // namespace blender::bke::cryptomatte |