Blender  V2.93
BKE_cryptomatte.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2020 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "BLI_sys_types.h"
27 #include "DNA_layer_types.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /* Forward declarations. */
34 struct CryptomatteSession;
35 struct Material;
36 struct Object;
37 struct RenderResult;
38 struct Scene;
39 
42  const struct RenderResult *render_result);
44 void BKE_cryptomatte_free(struct CryptomatteSession *session);
45 void BKE_cryptomatte_add_layer(struct CryptomatteSession *session, const char *layer_name);
46 
47 uint32_t BKE_cryptomatte_hash(const char *name, int name_len);
49  const char *layer_name,
50  const struct Object *object);
52  const char *layer_name,
53  const struct Material *material);
55  const char *layer_name,
56  const struct Object *object);
57 float BKE_cryptomatte_hash_to_float(uint32_t cryptomatte_hash);
58 bool BKE_cryptomatte_find_name(const struct CryptomatteSession *session,
59  const float encoded_hash,
60  char *r_name,
61  int name_len);
62 
63 char *BKE_cryptomatte_entries_to_matte_id(struct NodeCryptomatte *node_storage);
65  const char *matte_id);
66 
67 void BKE_cryptomatte_store_metadata(const struct CryptomatteSession *session,
68  struct RenderResult *render_result,
69  const ViewLayer *view_layer);
70 
71 #ifdef __cplusplus
72 }
73 #endif
void BKE_cryptomatte_add_layer(struct CryptomatteSession *session, const char *layer_name)
Definition: cryptomatte.cc:161
bool BKE_cryptomatte_find_name(const struct CryptomatteSession *session, const float encoded_hash, char *r_name, int name_len)
uint32_t BKE_cryptomatte_asset_hash(struct CryptomatteSession *session, const char *layer_name, const struct Object *object)
struct CryptomatteSession * BKE_cryptomatte_init_from_render_result(const struct RenderResult *render_result)
Definition: cryptomatte.cc:148
void BKE_cryptomatte_matte_id_to_entries(struct NodeCryptomatte *node_storage, const char *matte_id)
Definition: cryptomatte.cc:251
void BKE_cryptomatte_store_metadata(const struct CryptomatteSession *session, struct RenderResult *render_result, const ViewLayer *view_layer)
Definition: cryptomatte.cc:325
float BKE_cryptomatte_hash_to_float(uint32_t cryptomatte_hash)
Definition: cryptomatte.cc:210
struct CryptomatteSession * BKE_cryptomatte_init_from_scene(const struct Scene *scene)
Definition: cryptomatte.cc:155
uint32_t BKE_cryptomatte_object_hash(struct CryptomatteSession *session, const char *layer_name, const struct Object *object)
char * BKE_cryptomatte_entries_to_matte_id(struct NodeCryptomatte *node_storage)
Definition: cryptomatte.cc:230
uint32_t BKE_cryptomatte_material_hash(struct CryptomatteSession *session, const char *layer_name, const struct Material *material)
uint32_t BKE_cryptomatte_hash(const char *name, int name_len)
Definition: cryptomatte.cc:172
struct CryptomatteSession * BKE_cryptomatte_init(void)
Definition: cryptomatte.cc:142
void BKE_cryptomatte_free(struct CryptomatteSession *session)
Definition: cryptomatte.cc:166
Scene scene
Material material
unsigned int uint32_t
Definition: stdint.h:83