84 exponent = std::max(exponent,
uint32_t(1));
85 exponent = std::min(exponent,
uint32_t(254));
86 exponent = exponent << 23;
89 uint32_t float_bits = sign | exponent | mantissa;
91 memcpy(&f, &float_bits,
sizeof(
uint32_t));
99#ifdef WITH_CXX_GUARDEDALLOC
100 MEM_CXX_CLASS_ALLOC_FUNCS(
"cryptomatte:CryptomatteLayer")
108 std::optional<std::string>
operator[](
float encoded_hash)
const;
124 const char *propname,
126 int propvalue_maxncpy);
129 const char *propname,
131 int propvalue_maxncpy);
void BKE_cryptomatte_free(struct CryptomatteSession *session)
uint32_t BLI_hash_mm3(const unsigned char *data, size_t len, uint32_t seed)
CryptomatteLayer * BKE_cryptomatte_layer_get(CryptomatteSession &session, const StringRef layer_name)
std::unique_ptr< CryptomatteSession, CryptomatteSessionDeleter > CryptomatteSessionPtr
StringRef BKE_cryptomatte_extract_layer_name(const StringRef render_pass_name)
std::string BKE_cryptomatte_meta_data_key(const StringRef layer_name, const StringRefNull key_name)
const blender::Vector< std::string > & BKE_cryptomatte_layer_names_get(const CryptomatteSession &session)
static CryptomatteHash from_hex_encoded(blender::StringRef hex_encoded)
CryptomatteHash(const char *name, int name_len)
CryptomatteHash(uint32_t hash)
std::string hex_encoded() const
float float_encoded() const
void add_hash(blender::StringRef name, CryptomatteHash cryptomatte_hash)
blender::Map< std::string, CryptomatteHash > hashes
static std::unique_ptr< CryptomatteLayer > read_from_manifest(blender::StringRefNull manifest)
std::optional< std::string > operator[](float encoded_hash) const
std::string manifest() const
uint32_t add_ID(const ID &id)
void operator()(CryptomatteSession *session)
static void extract_layer_manifest(void *_data, const char *propname, char *propvalue, int propvalue_maxncpy)
static blender::StringRef extract_layer_hash(blender::StringRefNull key)
static void extract_layer_names(void *_data, const char *propname, char *propvalue, int propvalue_maxncpy)
blender::Map< std::string, std::string > hash_to_layer_name
CryptomatteSession * session