Blender V4.3
blender::bke::cryptomatte::CryptomatteHash Struct Reference

#include <BKE_cryptomatte.hh>

Public Member Functions

 CryptomatteHash (uint32_t hash)
 
 CryptomatteHash (const char *name, int name_len)
 
std::string hex_encoded () const
 
float float_encoded () const
 

Static Public Member Functions

static CryptomatteHash from_hex_encoded (blender::StringRef hex_encoded)
 

Public Attributes

uint32_t hash
 

Detailed Description

Definition at line 56 of file BKE_cryptomatte.hh.

Constructor & Destructor Documentation

◆ CryptomatteHash() [1/2]

blender::bke::cryptomatte::CryptomatteHash::CryptomatteHash ( uint32_t hash)

Definition at line 524 of file cryptomatte.cc.

◆ CryptomatteHash() [2/2]

blender::bke::cryptomatte::CryptomatteHash::CryptomatteHash ( const char * name,
int name_len )
inline

Definition at line 60 of file BKE_cryptomatte.hh.

References BLI_hash_mm3(), and hash.

Member Function Documentation

◆ float_encoded()

float blender::bke::cryptomatte::CryptomatteHash::float_encoded ( ) const
inline

Convert a cryptomatte hash to a float.

Cryptomatte hashes are stored in float textures and images. The conversion is taken from the cryptomatte specification. See Floating point conversion section in https://github.com/Psyop/Cryptomatte/blob/master/specification/cryptomatte_specification.pdf.

The conversion uses as many 32 bit floating point values as possible to minimize hash collisions. Unfortunately not all 32 bits can be used as NaN and Inf can be problematic.

Note that this conversion assumes to be running on a L-endian system.

Definition at line 80 of file BKE_cryptomatte.hh.

References hash.

Referenced by BKE_cryptomatte_hash_to_float().

◆ from_hex_encoded()

CryptomatteHash blender::bke::cryptomatte::CryptomatteHash::from_hex_encoded ( blender::StringRef hex_encoded)
static

Definition at line 526 of file cryptomatte.cc.

References hex_encoded(), and result.

Referenced by blender::bke::cryptomatte::manifest::from_manifest().

◆ hex_encoded()

std::string blender::bke::cryptomatte::CryptomatteHash::hex_encoded ( ) const

Definition at line 533 of file cryptomatte.cc.

References hash.

Referenced by from_hex_encoded().

Member Data Documentation

◆ hash

uint32_t blender::bke::cryptomatte::CryptomatteHash::hash

Definition at line 57 of file BKE_cryptomatte.hh.

Referenced by CryptomatteHash(), float_encoded(), and hex_encoded().


The documentation for this struct was generated from the following files: