ai_shader_message.h
Go to the documentation of this file.
1 // Copyright 2020 Autodesk, Inc. All rights reserved.
2 //
3 // Use of this software is subject to the terms of the Autodesk license
4 // agreement provided at the time of installation or download, or which
5 // otherwise accompanies this software in either electronic or hard copy form.
6 
12 #pragma once
13 #include "ai_array.h"
14 #include "ai_color.h"
15 #include "ai_string.h"
16 #include "ai_vector.h"
17 #include <stdint.h> // uint32_t etc
18 
19 // forward declaration
20 struct AtShaderGlobals;
21 
58 #define AiStateGetMsgByte(name,val) AiMessageGetByteFunc (sg,name,val)
59 #define AiStateGetMsgBool(name,val) AiMessageGetBoolFunc (sg,name,val)
60 #define AiStateGetMsgInt(name,val) AiMessageGetIntFunc (sg,name,val)
61 #define AiStateGetMsgUInt(name,val) AiMessageGetUIntFunc (sg,name,val)
62 #define AiStateGetMsgFlt(name,val) AiMessageGetFltFunc (sg,name,val)
63 #define AiStateGetMsgRGB(name,val) AiMessageGetRGBFunc (sg,name,val)
64 #define AiStateGetMsgRGBA(name,val) AiMessageGetRGBAFunc (sg,name,val)
65 #define AiStateGetMsgVec(name,val) AiMessageGetVecFunc (sg,name,val)
66 #define AiStateGetMsgVec2(name,val) AiMessageGetVec2Func (sg,name,val)
67 #define AiStateGetMsgStr(name,val) AiMessageGetStrFunc (sg,name,val)
68 #define AiStateGetMsgPtr(name,val) AiMessageGetPtrFunc (sg,name,val)
69 #define AiStateGetMsgArray(name,val) AiMessageGetArrayFunc(sg,name,val)
70 /*\}*/
71 
85 #define AiStateSetMsgByte(name,val) AiMessageSetByteFunc (sg,name,val)
86 #define AiStateSetMsgBool(name,val) AiMessageSetBoolFunc (sg,name,val)
87 #define AiStateSetMsgInt(name,val) AiMessageSetIntFunc (sg,name,val)
88 #define AiStateSetMsgUInt(name,val) AiMessageSetUIntFunc (sg,name,val)
89 #define AiStateSetMsgFlt(name,val) AiMessageSetFltFunc (sg,name,val)
90 #define AiStateSetMsgRGB(name,val) AiMessageSetRGBFunc (sg,name,val)
91 #define AiStateSetMsgRGBA(name,val) AiMessageSetRGBAFunc (sg,name,val)
92 #define AiStateSetMsgVec(name,val) AiMessageSetVecFunc (sg,name,val)
93 #define AiStateSetMsgVec2(name,val) AiMessageSetVec2Func (sg,name,val)
94 #define AiStateSetMsgStr(name,val) AiMessageSetStrFunc (sg,name,val)
95 #define AiStateSetMsgPtr(name,val) AiMessageSetPtrFunc (sg,name,val)
96 #define AiStateSetMsgArray(name,val) AiMessageSetArrayFunc(sg,name,val)
97 /*\}*/
98 
110 #define AiStateUnsetMsgByte(name) AiMessageUnsetByteFunc (sg,name)
111 #define AiStateUnsetMsgBool(name) AiMessageUnsetBoolFunc (sg,name)
112 #define AiStateUnsetMsgInt(name) AiMessageUnsetIntFunc (sg,name)
113 #define AiStateUnsetMsgUInt(name) AiMessageUnsetUIntFunc (sg,name)
114 #define AiStateUnsetMsgFlt(name) AiMessageUnsetFltFunc (sg,name)
115 #define AiStateUnsetMsgRGB(name) AiMessageUnsetRGBFunc (sg,name)
116 #define AiStateUnsetMsgRGBA(name) AiMessageUnsetRGBAFunc (sg,name)
117 #define AiStateUnsetMsgVec(name) AiMessageUnsetVecFunc (sg,name)
118 #define AiStateUnsetMsgVec2(name) AiMessageUnsetVec2Func (sg,name)
119 #define AiStateUnsetMsgStr(name) AiMessageUnsetStrFunc (sg,name)
120 #define AiStateUnsetMsgPtr(name) AiMessageUnsetPtrFunc (sg,name)
121 #define AiStateUnsetMsgArray(name) AiMessageUnsetArrayFunc(sg,name)
122 /*\}*/
123 
137 struct AtMessageIterator;
138 
139 AI_API AtMessageIterator* AiMessageIterator(const AtShaderGlobals* sg);
140 AI_API bool AiMessageIteratorGetNext(AtMessageIterator* iterator, AtString* msg_name, int* msg_type);
141 /*\}*/
142 
143 /*\}*/
144 
145 
146 #define AiCreateFuncs(_name, _type) \
147 AI_API bool AiMessageGet##_name##Func (const AtShaderGlobals*, const AtString, _type*); \
148 AI_API bool AiMessageSet##_name##Func (AtShaderGlobals*, const AtString, _type); \
149 AI_API bool AiMessageUnset##_name##Func (AtShaderGlobals*, const AtString);
150 
151 AiCreateFuncs(Bool, bool)
152 AiCreateFuncs(Byte, uint8_t)
153 AiCreateFuncs(Int, int)
154 AiCreateFuncs(UInt, unsigned int)
155 AiCreateFuncs(Flt, float)
156 AiCreateFuncs(RGB, AtRGB)
157 AiCreateFuncs(RGBA, AtRGBA)
158 AiCreateFuncs(Vec, AtVector)
159 AiCreateFuncs(Vec2, AtVector2)
160 AiCreateFuncs(Str, AtString)
161 AiCreateFuncs(Ptr, void*)
162 AiCreateFuncs(Array, AtArray*)
163 #undef AiCreateFuncs
RGB color.
Definition: ai_color.h:31
AI_API bool AiMessageIteratorGetNext(AtMessageIterator *iterator, AtString *msg_name, int *msg_type)
Fetch the next available message (if it exists) and return its name and type.
Definition: ai_message_passing.cpp:101
Vector math types, operators and utilities.
Arnold String allows for fast string comparisons.
Definition: ai_string.h:46
3D point (single precision)
Definition: ai_vector.h:29
Color types and utilities.
2D point
Definition: ai_vector.h:254
Shader globals data structure.
Definition: ai_shaderglobals.h:45
Generic array data type and methods.
AI_API AtMessageIterator * AiMessageIterator(const AtShaderGlobals *sg)
Create a new message iterator.
Definition: ai_message_passing.cpp:84
RGB color + alpha.
Definition: ai_color.h:266
AtString class for fast comparisons.

© 2020 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com