beastapi/beastapitypes.h Source File

beastapitypes.h
Go to the documentation of this file.
1 /*
2 Copyright 2014 Autodesk, Inc. All rights reserved.
3 Use of this software is subject to the terms of the Autodesk license agreement
4 provided at the time of installation or download, or which otherwise
5 accompanies this software in either electronic or hard copy form.
6 */
7 
8 
13 #ifndef BEASTAPITYPES_H
14 #define BEASTAPITYPES_H
15 
16 #ifdef __GNUC__
17 #include <stdint.h>
18 #endif // __GNUC__
19 
20 // To enforce a certain string encoding use any of
21 //#define ILB_STRING_UTF8
22 //#define ILB_STRING_UTF16
23 //#define ILB_STRING_UTF32
24 //#define ILB_STRING_ANSI
25 
29 typedef enum {
39 
44 
51 
67 // Try to auto detect a string encoding if no was supplied
69 #if !(defined(ILB_STRING_UTF8) || defined(ILB_STRING_UTF16) || defined(ILB_STRING_UTF32) || defined(ILB_STRING_ANSI))
70 #if defined(WIN32)
71 #ifdef UNICODE
72 #define ILB_STRING_UTF16
73 #else // UNICODE
74 #define ILB_STRING_ANSI
75 #endif // UNICODE
76 #else // WIN32
77 #define ILB_STRING_UTF8
78 #endif // WIN32
79 #endif // !(defined(ILB_STRING_UTF8) || defined(ILB_STRING_UTF16) || defined(ILB_STRING_UTF32) || defined(ILB_STRING_ANSI))
80 
85 typedef char ILBChar8;
86 
87 #if defined(WIN32)
88 
91 typedef wchar_t ILBChar16;
92 #else // defined(WIN32)
93 
96 typedef unsigned short ILBChar16;
97 #endif // defined(WIN32)
98 
104 typedef unsigned int ILBChar32;
105 
106 #ifdef beastapi_EXPORTS
107 // This is for inside the API. By setting char type
108 // to ILBDummyChar we guarantee that someone accidentially
109 // converts strings or string constants to ILBString
110 // or ILBConstString without thinking about encoding
111 struct ILBDummyChar {
112  int unused;
113 };
114 
120 typedef ILBDummyChar ILBCharType;
122 #define ILB_STRING_ENCODING ILB_SE_ANSI
123 #else // beastapi_EXPORTS
125 
126 #if defined(ILB_STRING_ANSI)
127 typedef ILBChar8 ILBCharType;
128 #if defined(WIN32)
129 #define ILB_STRING_ENCODING ILB_SE_ANSI
130 #else // WIN32
131 #error ANSI strings only supported on Windows platforms
132 #endif // WIN32
133 #elif defined(ILB_STRING_UTF8)
134 typedef ILBChar8 ILBCharType;
135 #define ILB_STRING_ENCODING ILB_SE_UTF8
136 #elif defined(ILB_STRING_UTF16)
137 typedef ILBChar16 ILBCharType;
138 #define ILB_STRING_ENCODING ILB_SE_UTF16
139 #elif defined(ILB_STRING_UTF32)
140 #error UTF32 currently not supported
141 typedef ILBChar32 ILBCharType;
142 #define ILB_STRING_ENCODING ILB_SE_UTF32
143 #else
144 #error No string type defined
145 #endif //ILB_STRING_UTF8
146 
147 #endif //beastapi_EXPORTS
148 
149 
153 typedef enum {
158 
164 
169 
174 
179 
185 
190 
196 
201 
206 
211 
216 
221 
226 
231 } ILBStatus;
232 
238 typedef ILBCharType* ILBString;
239 
245 typedef const ILBCharType* ILBConstString;
246 
247 
248 #ifdef WIN32
249 
252 typedef __int32 int32;
253 
257 typedef __int64 int64;
258 
262 typedef unsigned __int32 uint32;
263 
267 typedef unsigned __int64 uint64;
268 
269 #elif defined(__GNUC__)
270 
271 typedef int32_t int32;
272 typedef int64_t int64;
273 typedef uint32_t uint32;
274 typedef uint64_t uint64;
275 typedef uint32 DWORD;
276 #else
277 #error Could not define int32 and friends.
278 #endif
279 
284 typedef int32 ILBBool;
285 
290 typedef struct ILBVec2 {
292  float x;
294  float y;
295 #ifdef __cplusplus
296  ILBVec2() {}
297  ILBVec2(float _x, float _y): x(_x), y(_y) {}
298 #endif // __cplusplus
299 } ILBVec2;
300 
304 typedef struct ILBVec2i {
306  int x;
308  int y;
309 #ifdef __cplusplus
310  ILBVec2i() {}
311  ILBVec2i(int _x, int _y): x(_x), y(_y) {}
312 #endif // __cplusplus
313 } ILBVec2i;
314 
320 typedef struct ILBVec3 {
322  float x;
324  float y;
326  float z;
327 #ifdef __cplusplus
328  ILBVec3() {}
329  ILBVec3(float _x, float _y, float _z): x(_x), y(_y), z(_z) {}
330 #endif // __cplusplus
331 } ILBVec3;
332 
338 typedef struct ILBLinearRGB {
340  float r;
342  float g;
344  float b;
345 #ifdef __cplusplus
346  ILBLinearRGB() {}
347  ILBLinearRGB(float _r, float _g, float _b): r(_r), g(_g), b(_b) {}
348 #endif // __cplusplus
349 } ILBLinearRGB;
350 
356 typedef struct ILBLinearRGBA {
358  float r;
360  float g;
362  float b;
364  float a;
365 #ifdef __cplusplus
366  ILBLinearRGBA() {}
367  ILBLinearRGBA(float _r, float _g, float _b, float _a): r(_r), g(_g), b(_b), a(_a) {}
368 #endif // __cplusplus
369 } ILBLinearRGBA;
370 
383 typedef struct {
387  float m[16];
388 } ILBMatrix4x4;
389 
390 /*
391  * Macro to define handle types.
392  * Inspired by windows headers
393  */
394 #define ILB_DECLARE_HANDLE(name) struct name##__{int unused;}; typedef struct name##__ *name;
395 
401 ILB_DECLARE_HANDLE(ILBManagerHandle)
402 
403 
408 ILB_DECLARE_HANDLE(ILBMeshHandle);
409 
415 ILB_DECLARE_HANDLE(ILBSceneHandle);
416 
422 ILB_DECLARE_HANDLE(ILBSceneInfoHandle);
423 
429 ILB_DECLARE_HANDLE(ILBInstanceHandle);
430 
436 ILB_DECLARE_HANDLE(ILBCameraHandle);
437 
443 ILB_DECLARE_HANDLE(ILBLightHandle);
444 
450 ILB_DECLARE_HANDLE(ILBMaterialHandle);
451 
457 ILB_DECLARE_HANDLE(ILBTextureHandle);
458 
464 ILB_DECLARE_HANDLE(ILBJobHandle);
465 
471 ILB_DECLARE_HANDLE(ILBJobUpdateHandle);
472 
478 ILB_DECLARE_HANDLE(ILBStringHandle);
479 
485 ILB_DECLARE_HANDLE(ILBTargetHandle);
486 
487 
493 ILB_DECLARE_HANDLE(ILBFramebufferHandle);
494 
495 
501 ILB_DECLARE_HANDLE(ILBTargetEntityHandle);
502 
508 ILB_DECLARE_HANDLE(ILBRenderPassHandle);
509 
515 ILB_DECLARE_HANDLE(ILBLightPassEntryHandle);
516 
522 ILB_DECLARE_HANDLE(ILBPointCloudHandle);
523 
528 ILB_DECLARE_HANDLE(ILBShaderHandle);
529 
535 ILB_DECLARE_HANDLE(ILBUVLayerHandle);
536 
540 typedef enum {
545 
551 
552 /*
553  * Setup for getting functions exported or imported from the DLL
554  * on windows
555  */
556 #ifdef WIN32
557 #ifdef beastapi_EXPORTS
558 #define ILB_DLL_FUNCTION __declspec(dllexport)
559 #else
560 #define ILB_DLL_FUNCTION __declspec(dllimport)
561 #endif // beastapi_EXPORTS
562 #else // WIN32
563 #define ILB_DLL_FUNCTION
564 #endif // WIN32
565 
566 #ifdef WIN32
567 typedef void* ILBFileHandle;
568 #define ILB_INVALID_FILE_HANDLE ((void*)(((unsigned char*)(0)) - 1))
569 #else // WIN32
570 typedef int32 ILBFileHandle;
571 #define ILB_INVALID_FILE_HANDLE -1
572 #endif // WIN32
573 
574 #endif //BEASTAPITYPES_H
575 
576 
Handle for Beast scene information node Intentionally hidden implementation.
Definition: beastapitypes.h:415
unsigned short ILBChar16
Character type for 16 bit strings.
Definition: beastapitypes.h:96
The api generated an exception we didn't expect.
Definition: beastapitypes.h:210
Includes the supplied lights/objects.
Definition: beastapitypes.h:549
float g
Green component.
Definition: beastapitypes.h:360
Color with alpha definition All colors are expressed in linear space as opposed to gamma corrected...
Definition: beastapitypes.h:356
UTF-8 encoding.
Definition: beastapitypes.h:38
int x
x
Definition: beastapitypes.h:306
Two dimensional geometric vector type with unsigned int members.
Definition: beastapitypes.h:304
float g
Green component.
Definition: beastapitypes.h:342
Dummy entry to be able to loop over all errors.
Definition: beastapitypes.h:230
Ansi encoding, the one used by default for windows source files.
Definition: beastapitypes.h:34
const ILBCharType * ILBConstString
Beast api const string type.
Definition: beastapitypes.h:245
Handle for Beast cameras Intentionally hidden implementation.
Definition: beastapitypes.h:429
Handle for Beast jobs Intentionally hidden implementation.
Definition: beastapitypes.h:457
float b
Blue component.
Definition: beastapitypes.h:344
float z
z
Definition: beastapitypes.h:326
Handle for updates from Ernst jobs Intentionally hidden implementation.
Definition: beastapitypes.h:464
Two dimensional geometric vector type.
Definition: beastapitypes.h:290
float r
Red component.
Definition: beastapitypes.h:340
Handle for Beast uv layers Intentionally hidden implementation.
Definition: beastapitypes.h:528
float r
Red component.
Definition: beastapitypes.h:358
Handle for Beast meshes Intentionally hidden implementation.
The requested functionality is not supported in the current configuration.
Definition: beastapitypes.h:205
UTF-32 encoding.
Definition: beastapitypes.h:49
float b
Blue component.
Definition: beastapitypes.h:362
Matrix for transformations.
Definition: beastapitypes.h:383
int y
y
Definition: beastapitypes.h:308
float y
y
Definition: beastapitypes.h:324
Handle for Beast point clouds Intentionally hidden implementation.
Definition: beastapitypes.h:515
Three dimensional geometric vector type.
Definition: beastapitypes.h:320
Handle for Beast instance Intentionally hidden implementation.
Definition: beastapitypes.h:422
Handle for Beast render pass Intentionally hidden implementation.
Definition: beastapitypes.h:501
Handle for Light pass entry Intentionally hidden implementation.
Definition: beastapitypes.h:508
Handle for Beast materials Intentionally hidden implementation.
Definition: beastapitypes.h:443
ILBCharType * ILBString
Beast api string type.
Definition: beastapitypes.h:238
Handle for Beast textures Intentionally hidden implementation.
Definition: beastapitypes.h:450
ILBLightLinkMode
Enum defining if a light link is inclusive or exclusive.
Definition: beastapitypes.h:540
The object handle used is not valid.
Definition: beastapitypes.h:189
float x
x
Definition: beastapitypes.h:292
A license error occurred.
Definition: beastapitypes.h:225
float a
Alpha.
Definition: beastapitypes.h:364
char ILBChar8
Character type for 8 bit strings.
Definition: beastapitypes.h:85
Excludes the supplied lights/objects.
Definition: beastapitypes.h:544
float y
y
Definition: beastapitypes.h:294
UTF-16 encoding.
Definition: beastapitypes.h:43
Handle for Beast target entities Intentionally hidden implementation.
Definition: beastapitypes.h:493
unsigned int ILBChar32
Character type for 32 bit strings.
Definition: beastapitypes.h:104
There was some kind of file problem (invalid filename, permission etc).
Definition: beastapitypes.h:195
Handle for Beast light sources Intentionally hidden implementation.
Definition: beastapitypes.h:436
Atlasing failed.
Definition: beastapitypes.h:220
An object with the same name already existed.
Definition: beastapitypes.h:173
Handle for Beast managers Intentionally hidden implementation.
Handle for an OSL shader.
Definition: beastapitypes.h:522
A handle to an unknown object was requested.
Definition: beastapitypes.h:200
Color definition All colors are expressed in linear space as opposed to gamma corrected.
Definition: beastapitypes.h:338
This function is not implemented yet.
Definition: beastapitypes.h:178
Beast failed to allocate memory somewhere down the line of this call.
Definition: beastapitypes.h:168
float x
x
Definition: beastapitypes.h:322
int32 ILBBool
Bool type with a well defined size to avoid compatibility-problems.
Definition: beastapitypes.h:284
Handle for Beast framebuffers Intentionally hidden implementation.
Definition: beastapitypes.h:485
An external tool returned an error.
Definition: beastapitypes.h:215
The call was successfully completed!
Definition: beastapitypes.h:157
Handle for Beast scenes Intentionally hidden implementation.
Definition: beastapitypes.h:408
ILBStatus
Status codes for Beast API calls.
Definition: beastapitypes.h:153
The object the function was called on was in a state where the function isn't valid to call...
Definition: beastapitypes.h:184
One or more parameters were not in valid range or in some other way not valid for this call...
Definition: beastapitypes.h:163
Handle for Beast target specification Intentionally hidden implementation.
Definition: beastapitypes.h:478
ILBStringEncoding
Defines the different supported string encodings.
Definition: beastapitypes.h:29
Handle for Beast strings Intentionally hidden implementation.
Definition: beastapitypes.h:471