Blender  V3.3
Classes | Namespaces | Functions | Variables
cryptomatte.cc File Reference
#include "BKE_cryptomatte.h"
#include "BKE_cryptomatte.hh"
#include "BKE_image.h"
#include "BKE_main.h"
#include "DNA_layer_types.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BLI_compiler_attrs.h"
#include "BLI_dynstr.h"
#include "BLI_hash_mm3.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "RE_pipeline.h"
#include "MEM_guardedalloc.h"
#include <cctype>
#include <cstring>
#include <iomanip>
#include <sstream>
#include <string>
#include <string_view>

Go to the source code of this file.

Classes

struct  CryptomatteSession
 

Namespaces

 blender
 
 blender::bke
 
 blender::bke::cryptomatte
 
 blender::bke::cryptomatte::manifest
 

Functions

CryptomatteSessionBKE_cryptomatte_init ()
 
struct CryptomatteSessionBKE_cryptomatte_init_from_render_result (const struct RenderResult *render_result)
 
struct CryptomatteSessionBKE_cryptomatte_init_from_scene (const struct Scene *scene)
 
void BKE_cryptomatte_add_layer (struct CryptomatteSession *session, const char *layer_name)
 
void BKE_cryptomatte_free (CryptomatteSession *session)
 
uint32_t BKE_cryptomatte_hash (const char *name, const int name_len)
 
uint32_t BKE_cryptomatte_object_hash (CryptomatteSession *session, const char *layer_name, const Object *object)
 
uint32_t BKE_cryptomatte_material_hash (CryptomatteSession *session, const char *layer_name, const Material *material)
 
uint32_t BKE_cryptomatte_asset_hash (CryptomatteSession *session, const char *layer_name, const Object *object)
 
float BKE_cryptomatte_hash_to_float (uint32_t cryptomatte_hash)
 
bool BKE_cryptomatte_find_name (const CryptomatteSession *session, const float encoded_hash, char *r_name, int name_len)
 
char * BKE_cryptomatte_entries_to_matte_id (NodeCryptomatte *node_storage)
 
void BKE_cryptomatte_matte_id_to_entries (NodeCryptomatte *node_storage, const char *matte_id)
 
static std::string cryptomatte_determine_name (const ViewLayer *view_layer, const blender::StringRefNull cryptomatte_layer_name)
 
static uint32_t cryptomatte_determine_identifier (const blender::StringRef name)
 
static void add_render_result_meta_data (RenderResult *render_result, const blender::StringRef layer_name, const blender::StringRefNull key_name, const blender::StringRefNull value)
 
void BKE_cryptomatte_store_metadata (const struct CryptomatteSession *session, RenderResult *render_result, const ViewLayer *view_layer)
 
static constexpr blender::StringRef blender::bke::cryptomatte::manifest::skip_whitespaces_ (blender::StringRef ref)
 
static constexpr int blender::bke::cryptomatte::manifest::quoted_string_len_ (blender::StringRef ref)
 
static std::string blender::bke::cryptomatte::manifest::unquote_ (const blender::StringRef ref)
 
static bool blender::bke::cryptomatte::manifest::from_manifest (CryptomatteLayer &layer, blender::StringRefNull manifest)
 
static std::string blender::bke::cryptomatte::manifest::to_manifest (const CryptomatteLayer *layer)
 
static std::string blender::bke::cryptomatte::cryptomatte_layer_name_hash (const StringRef layer_name)
 
std::string blender::bke::cryptomatte::BKE_cryptomatte_meta_data_key (const StringRef layer_name, const StringRefNull key_name)
 
StringRef blender::bke::cryptomatte::BKE_cryptomatte_extract_layer_name (const StringRef render_pass_name)
 
const blender::Vector< std::string > & blender::bke::cryptomatte::BKE_cryptomatte_layer_names_get (const CryptomatteSession &session)
 

Variables

constexpr StringRef blender::bke::cryptomatte::manifest::WHITESPACES = " \t\n\v\f\r"
 

Function Documentation

◆ add_render_result_meta_data()

static void add_render_result_meta_data ( RenderResult render_result,
const blender::StringRef  layer_name,
const blender::StringRefNull  key_name,
const blender::StringRefNull  value 
)
static

◆ BKE_cryptomatte_add_layer()

void BKE_cryptomatte_add_layer ( struct CryptomatteSession session,
const char *  layer_name 
)

Definition at line 145 of file cryptomatte.cc.

References CryptomatteSession::add_layer().

Referenced by EEVEE_cryptomatte_renderpasses_init().

◆ BKE_cryptomatte_asset_hash()

uint32_t BKE_cryptomatte_asset_hash ( CryptomatteSession session,
const char *  layer_name,
const Object object 
)

Definition at line 183 of file cryptomatte.cc.

References BKE_cryptomatte_object_hash(), and Object::parent.

◆ BKE_cryptomatte_entries_to_matte_id()

char* BKE_cryptomatte_entries_to_matte_id ( NodeCryptomatte node_storage)

◆ BKE_cryptomatte_find_name()

bool BKE_cryptomatte_find_name ( const CryptomatteSession session,
const float  encoded_hash,
char *  r_name,
int  name_len 
)

Definition at line 199 of file cryptomatte.cc.

References BLI_strncpy().

◆ BKE_cryptomatte_free()

void BKE_cryptomatte_free ( CryptomatteSession session)

◆ BKE_cryptomatte_hash()

uint32_t BKE_cryptomatte_hash ( const char *  name,
const int  name_len 
)

◆ BKE_cryptomatte_hash_to_float()

float BKE_cryptomatte_hash_to_float ( uint32_t  cryptomatte_hash)

◆ BKE_cryptomatte_init()

CryptomatteSession* BKE_cryptomatte_init ( void  )

Definition at line 126 of file cryptomatte.cc.

Referenced by EEVEE_cryptomatte_renderpasses_init().

◆ BKE_cryptomatte_init_from_render_result()

struct CryptomatteSession* BKE_cryptomatte_init_from_render_result ( const struct RenderResult render_result)

◆ BKE_cryptomatte_init_from_scene()

struct CryptomatteSession* BKE_cryptomatte_init_from_scene ( const struct Scene scene)

Definition at line 139 of file cryptomatte.cc.

References CryptomatteSession::CryptomatteSession(), and scene.

Referenced by cryptomatte_init_from_node_render().

◆ BKE_cryptomatte_material_hash()

uint32_t BKE_cryptomatte_material_hash ( CryptomatteSession session,
const char *  layer_name,
const Material material 
)

◆ BKE_cryptomatte_matte_id_to_entries()

void BKE_cryptomatte_matte_id_to_entries ( NodeCryptomatte node_storage,
const char *  matte_id 
)

◆ BKE_cryptomatte_object_hash()

uint32_t BKE_cryptomatte_object_hash ( CryptomatteSession session,
const char *  layer_name,
const Object object 
)

◆ BKE_cryptomatte_store_metadata()

void BKE_cryptomatte_store_metadata ( const struct CryptomatteSession session,
RenderResult render_result,
const ViewLayer view_layer 
)

◆ cryptomatte_determine_identifier()

static uint32_t cryptomatte_determine_identifier ( const blender::StringRef  name)
static

◆ cryptomatte_determine_name()

static std::string cryptomatte_determine_name ( const ViewLayer view_layer,
const blender::StringRefNull  cryptomatte_layer_name 
)
static

Definition at line 283 of file cryptomatte.cc.

References BLI_strnlen(), and ViewLayer::name.

Referenced by BKE_cryptomatte_store_metadata().