Katana Plug-in APIs 0.1

FnRenderOutputUtilsSuite.h

00001 // Copyright (c) 2013 The Foundry Visionmongers Ltd. All Rights Reserved.
00002 
00003 #ifndef FNRENDEROUTPUTUTILS_RENDEROUTPUTUTILSSUITE_H
00004 #define FNRENDEROUTPUTUTILS_RENDEROUTPUTUTILSSUITE_H
00005 
00006 #include <FnAttribute/suite/FnAttributeSuite.h>
00007 #include <FnScenegraphIterator/suite/FnScenegraphIteratorSuite.h>
00008 #include <FnRender/suite/FnRenderPluginSuite.h>
00009 
00010 #include <stdlib.h>
00011 #include <stdint.h>
00012 
00013 extern "C"
00014 {
00015     typedef struct CameraInfoStruct*                        CameraInfoHandle;
00016 
00017     typedef struct ShadingNodeDescriptionStruct*            ShadingNodeDescriptionHandle;
00018     typedef struct ShadingNodeConnectionDescriptionStruct*  ShadingNodeConnectionDescriptionHandle;
00019     typedef struct ShadingNodeDescriptionMapStruct*         FnShadingNodeDescriptionMapHandle;
00020 
00021     typedef enum
00022     {
00023         kFnKatProceduralArgsClassic         = 1,
00024         kFnKatProceduralArgsScenegraphAttr  = 2,
00025     } FnKatProceduralArgsType;
00026 
00027     #define kFnKatArbAttrScopePrimitive     "primitive"
00028     #define kFnKatArbAttrScopeFace          "face"
00029     #define kFnKatArbAttrScopePoint         "point"
00030     #define kFnKatArbAttrScopeVertex        "vertex"
00031 
00032     #define kFnKatArbAttrBaseTypeFloat      "float"
00033     #define kFnKatArbAttrBaseTypeDouble     "double"
00034     #define kFnKatArbAttrBaseTypeInt        "int"
00035     #define kFnKatArbAttrBaseTypeString     "string"
00036 
00037     #define kFnKatArbAttrTypeFloat          "float"
00038     #define kFnKatArbAttrTypeDouble         "double"
00039     #define kFnKatArbAttrTypeInt            "int"
00040     #define kFnKatArbAttrTypeString         "string"
00041     #define kFnKatArbAttrTypeColor3         "color3"
00042     #define kFnKatArbAttrTypeColor4         "color4"
00043     #define kFnKatArbAttrTypeNormal2        "normal2"
00044     #define kFnKatArbAttrTypeNormal3        "normal3"
00045     #define kFnKatArbAttrTypeVector2        "vector2"
00046     #define kFnKatArbAttrTypeVector3        "vector3"
00047     #define kFnKatArbAttrTypeVector4        "vector4"
00048     #define kFnKatArbAttrTypePoint2         "point2"
00049     #define kFnKatArbAttrTypePoint3         "point3"
00050     #define kFnKatArbAttrTypePoint4         "point4"
00051     #define kFnKatArbAttrTypeMatrix9        "matrix9"
00052     #define kFnKatArbAttrTypeMatrix16       "matrix16"
00053     #define kFnKatArbAttrTypeUInt           "uint"
00054     #define kFnKatArbAttrTypeBool           "bool"
00055     #define kFnKatArbAttrTypeByte           "byte"
00056 
00057     #define RenderOutputUtilsSuite_version 3
00058 
00059     struct RenderOutputUtilsSuite_v2
00060     {
00061         FnAttributeHandle   (*buildProceduralArgsString)(
00062                                 FnSgIteratorHandle sgIteratorHandle,
00063                                 FnKatProceduralArgsType type,
00064                                 const char *argsAttrName,
00065                                 int frameNumber,
00066                                 float shutterOpen,
00067                                 float shutterClose,
00068                                 float cropWindowXMin,
00069                                 float cropWindowXMax,
00070                                 float cropWindowYMin,
00071                                 float cropWindowYMax,
00072                                 int xres,
00073                                 int yres);
00074 
00075         void                (*flushProceduralDsoCaches)();
00076 
00077         int                 (*getPixelAreaThroughCamera)(
00078                                 FnSgIteratorHandle sgIteratorHandle,
00079                                 const char* cameraLocation,
00080                                 const char* resolution);
00081 
00082         FnAttributeHandle   (*findSampleTimesRelevantToShutterRange)(
00083                                 const float *inputSamples,
00084                                 unsigned int inputSamplesCount,
00085                                 float shutterOpen,
00086                                 float shutterClose);
00087 
00088         FnAttributeHandle   (*getRenderResolution)(
00089                                 FnSgIteratorHandle rootIteratorHandle,
00090                                 int *width,
00091                                 int *height);
00092 
00093         FnAttributeHandle   (*getCameraPath)(
00094                                 FnSgIteratorHandle rootIteratorHandle);
00095 
00096         // Textures
00097         FnAttributeHandle   (*convertTexturesToArbitraryAttr)(
00098                                 FnAttributeHandle texturesAttrHandle);
00099 
00100         // Architecture
00101         FnAttributeHandle   (*getArchString)();
00102         FnAttributeHandle   (*expandArchPath)(
00103                                 const char *path);
00104 
00105         // ShadingNetworks
00106         FnAttributeHandle   (*getFlattenedMaterialAttr)(
00107                                 FnSgIteratorHandle sgIteratorHandle,
00108                                 FnAttributeHandle terminalNamesAttrHandle);
00109 
00110         void                (*emptyFlattenedMaterialCache)();
00111 
00112         FnShadingNodeDescriptionMapHandle (*getShadingNetworkNodes)(
00113                                 FnAttributeHandle materialAttrHandle);
00114 
00115         FnShadingNodeDescriptionMapHandle (*getShadingNetworkNodesFromSgIterator)(
00116                                 FnSgIteratorHandle sgIteratorHandle);
00117 
00118         void                (*destroyShadingNodeDescriptionMap)(
00119                                 FnShadingNodeDescriptionMapHandle handle);
00120 
00121         void                (*retainShadingNodeDescription)(
00122                                 ShadingNodeDescriptionHandle handle);
00123 
00124         void                (*releaseShadingNodeDescription)(
00125                                 ShadingNodeDescriptionHandle handle);
00126 
00127         void                (*retainShadingNodeConnectionDescription)(
00128                                 ShadingNodeConnectionDescriptionHandle handle);
00129 
00130         void                (*releaseShadingNodeConnectionDescription)(
00131                                 ShadingNodeConnectionDescriptionHandle handle);
00132 
00133         ShadingNodeDescriptionHandle (*getShadingNodeDescriptionByName)(
00134                                 FnShadingNodeDescriptionMapHandle handle,
00135                                 const char *name);
00136 
00137         const char *        (*getShadingNodeDescriptionName)(
00138                                 ShadingNodeDescriptionHandle handle);
00139 
00140         const char *        (*getShadingNodeDescriptionType)(
00141                                 ShadingNodeDescriptionHandle handle);
00142 
00143         unsigned int        (*getShadingNodeDescriptionNumberOfParameterNames)(
00144                                 ShadingNodeDescriptionHandle handle);
00145 
00146         const char *        (*getShadingNodeDescriptionParameterName)(
00147                                 ShadingNodeDescriptionHandle handle,
00148                                 unsigned int index);
00149 
00150         FnAttributeHandle   (*getShadingNodeDescriptionParameter)(
00151                                 ShadingNodeDescriptionHandle handle,
00152                                 const char *name);
00153 
00154         unsigned int        (*getShadingNodeDescriptionNumberOfConnectionNames)(
00155                                 ShadingNodeDescriptionHandle handle);
00156         const char *        (*getShadingNodeDescriptionConnectionName)(
00157                                 ShadingNodeDescriptionHandle handle,
00158                                 unsigned int index);
00159 
00160         ShadingNodeConnectionDescriptionHandle (*getShadingNodeDescriptionConnection)(
00161                                 ShadingNodeDescriptionHandle handle,
00162                                 const char *name);
00163 
00164         bool                (*isShadingNodeDescriptionValid)(
00165                                 ShadingNodeDescriptionHandle handle);
00166 
00167         const char *        (*getShadingNodeConnectionDescriptionName)(
00168                                 ShadingNodeConnectionDescriptionHandle handle);
00169 
00170         const char *        (*getShadingNodeConnectionDescriptionConnectedNodeName)(
00171                                 ShadingNodeConnectionDescriptionHandle handle);
00172 
00173         const char *        (*getShadingNodeConnectionDescriptionConnectedPortName)(
00174                                 ShadingNodeConnectionDescriptionHandle handle);
00175 
00176         bool                (*isShadingNodeConnectionDescriptionValid)(
00177                                 ShadingNodeConnectionDescriptionHandle handle);
00178 
00179         // CameraInfo object
00180         CameraInfoHandle    (*getCameraInfo)(
00181                                 FnSgIteratorHandle rootIteratorHandle,
00182                                 const char* cameraInfoPath);
00183 
00184         void                (*retainCameraInfo)(
00185                                 CameraInfoHandle cameraInfoHandle);
00186 
00187         void                (*releaseCameraInfo)(
00188                                 CameraInfoHandle cameraInfoHandle);
00189 
00190         float               (*getCameraInfoFov)(
00191                                 CameraInfoHandle cameraInfoHandle);
00192 
00193         float               (*getCameraInfoNear)(
00194                                 CameraInfoHandle cameraInfoHandle);
00195 
00196         float               (*getCameraInfoFar)(
00197                                 CameraInfoHandle cameraInfoHandle);
00198 
00199         float               (*getCameraInfoLeft)(
00200                                 CameraInfoHandle cameraInfoHandle);
00201 
00202         float               (*getCameraInfoRight)(
00203                                 CameraInfoHandle cameraInfoHandle);
00204 
00205         float               (*getCameraInfoTop)(
00206                                 CameraInfoHandle cameraInfoHandle);
00207 
00208         float               (*getCameraInfoBottom)(
00209                                 CameraInfoHandle cameraInfoHandle);
00210 
00211         int                 (*getCameraInfoOrtho)(
00212                                 CameraInfoHandle cameraInfoHandle);
00213 
00214         float               (*getCameraInfoOrthoWidth)(
00215                                 CameraInfoHandle cameraInfoHandle);
00216 
00217         double *            (*getCameraInfoXForm)(
00218                                 CameraInfoHandle cameraInfoHandle);
00219 
00220         bool                (*processLocation)(
00221                                 FnSgIteratorHandle sgIteratorHandle,
00222                                 const char* rendererName,
00223                                 const char* locationName,
00224                                 void* optionalInput,
00225                                 void** optionalOutput);
00226 
00227         FnAttributeHandle   (*fillDelegateHandledLocationTypesList)(
00228                                 const char* rendererName);
00229 
00230         FnAttributeHandle   (*buildTempRenderLocation)(
00231                                 FnSgIteratorHandle sgIteratorHandle,
00232                                 const char* outputName,
00233                                 const char* prefix,
00234                                 const char* fileExtension,
00235                                 float frameTime);
00236 
00237         FnAttributeHandle   (*buildTileLocation)(
00238                                 FnSgIteratorHandle sgIteratorHandle,
00239                                 const char* outputPath);
00240 
00241     };
00242 
00243     struct RenderOutputUtilsSuite_v3
00244         {
00245             FnAttributeHandle   (*buildProceduralArgsString)(
00246                                     FnSgIteratorHandle sgIteratorHandle,
00247                                     FnKatProceduralArgsType type,
00248                                     const char *argsAttrName,
00249                                     int frameNumber,
00250                                     float shutterOpen,
00251                                     float shutterClose,
00252                                     float cropWindowXMin,
00253                                     float cropWindowXMax,
00254                                     float cropWindowYMin,
00255                                     float cropWindowYMax,
00256                                     int xres,
00257                                     int yres);
00258 
00259             void                (*flushProceduralDsoCaches)(const char* apiName);
00260 
00261             int                 (*getPixelAreaThroughCamera)(
00262                                     FnSgIteratorHandle sgIteratorHandle,
00263                                     const char* cameraLocation,
00264                                     const char* resolution);
00265 
00266             FnAttributeHandle   (*findSampleTimesRelevantToShutterRange)(
00267                                     const float *inputSamples,
00268                                     unsigned int inputSamplesCount,
00269                                     float shutterOpen,
00270                                     float shutterClose);
00271 
00272             FnAttributeHandle   (*getRenderResolution)(
00273                                     FnSgIteratorHandle rootIteratorHandle,
00274                                     int *width,
00275                                     int *height);
00276 
00277             FnAttributeHandle   (*getCameraPath)(
00278                                     FnSgIteratorHandle rootIteratorHandle);
00279 
00280             // Textures
00281             FnAttributeHandle   (*convertTexturesToArbitraryAttr)(
00282                                     FnAttributeHandle texturesAttrHandle);
00283 
00284             // Architecture
00285             FnAttributeHandle   (*getArchString)();
00286             FnAttributeHandle   (*expandArchPath)(
00287                                     const char *path);
00288 
00289             // ShadingNetworks
00290             FnAttributeHandle   (*getFlattenedMaterialAttr)(
00291                                     FnSgIteratorHandle sgIteratorHandle,
00292                                     FnAttributeHandle terminalNamesAttr);
00293 
00294             void                (*emptyFlattenedMaterialCache)();
00295 
00296             FnShadingNodeDescriptionMapHandle (*getShadingNetworkNodes)(
00297                                     FnAttributeHandle materialAttrHandle);
00298 
00299             FnShadingNodeDescriptionMapHandle (*getShadingNetworkNodesFromSgIterator)(
00300                                     FnSgIteratorHandle sgIteratorHandle);
00301 
00302             void                (*destroyShadingNodeDescriptionMap)(
00303                                     FnShadingNodeDescriptionMapHandle handle);
00304 
00305             void                (*retainShadingNodeDescription)(
00306                                     ShadingNodeDescriptionHandle handle);
00307 
00308             void                (*releaseShadingNodeDescription)(
00309                                     ShadingNodeDescriptionHandle handle);
00310 
00311             void                (*retainShadingNodeConnectionDescription)(
00312                                     ShadingNodeConnectionDescriptionHandle handle);
00313 
00314             void                (*releaseShadingNodeConnectionDescription)(
00315                                     ShadingNodeConnectionDescriptionHandle handle);
00316 
00317             ShadingNodeDescriptionHandle (*getShadingNodeDescriptionByName)(
00318                                     FnShadingNodeDescriptionMapHandle handle,
00319                                     const char *name);
00320 
00321             const char *        (*getShadingNodeDescriptionName)(
00322                                     ShadingNodeDescriptionHandle handle);
00323 
00324             const char *        (*getShadingNodeDescriptionType)(
00325                                     ShadingNodeDescriptionHandle handle);
00326 
00327             unsigned int        (*getShadingNodeDescriptionNumberOfParameterNames)(
00328                                     ShadingNodeDescriptionHandle handle);
00329 
00330             const char *        (*getShadingNodeDescriptionParameterName)(
00331                                     ShadingNodeDescriptionHandle handle,
00332                                     unsigned int index);
00333 
00334             FnAttributeHandle   (*getShadingNodeDescriptionParameter)(
00335                                     ShadingNodeDescriptionHandle handle,
00336                                     const char *name);
00337 
00338             unsigned int        (*getShadingNodeDescriptionNumberOfConnectionNames)(
00339                                     ShadingNodeDescriptionHandle handle);
00340             const char *        (*getShadingNodeDescriptionConnectionName)(
00341                                     ShadingNodeDescriptionHandle handle,
00342                                     unsigned int index);
00343 
00344             ShadingNodeConnectionDescriptionHandle (*getShadingNodeDescriptionConnection)(
00345                                     ShadingNodeDescriptionHandle handle,
00346                                     const char *name);
00347 
00348             bool                (*isShadingNodeDescriptionValid)(
00349                                     ShadingNodeDescriptionHandle handle);
00350 
00351             const char *        (*getShadingNodeConnectionDescriptionName)(
00352                                     ShadingNodeConnectionDescriptionHandle handle);
00353 
00354             const char *        (*getShadingNodeConnectionDescriptionConnectedNodeName)(
00355                                     ShadingNodeConnectionDescriptionHandle handle);
00356 
00357             const char *        (*getShadingNodeConnectionDescriptionConnectedPortName)(
00358                                     ShadingNodeConnectionDescriptionHandle handle);
00359 
00360             bool                (*isShadingNodeConnectionDescriptionValid)(
00361                                     ShadingNodeConnectionDescriptionHandle handle);
00362 
00363             // CameraInfo object
00364             CameraInfoHandle    (*getCameraInfo)(
00365                                     FnSgIteratorHandle rootIteratorHandle,
00366                                     const char* cameraInfoPath);
00367 
00368             void                (*retainCameraInfo)(
00369                                     CameraInfoHandle cameraInfoHandle);
00370 
00371             void                (*releaseCameraInfo)(
00372                                     CameraInfoHandle cameraInfoHandle);
00373 
00374             float               (*getCameraInfoFov)(
00375                                     CameraInfoHandle cameraInfoHandle);
00376 
00377             float               (*getCameraInfoNear)(
00378                                     CameraInfoHandle cameraInfoHandle);
00379 
00380             float               (*getCameraInfoFar)(
00381                                     CameraInfoHandle cameraInfoHandle);
00382 
00383             float               (*getCameraInfoLeft)(
00384                                     CameraInfoHandle cameraInfoHandle);
00385 
00386             float               (*getCameraInfoRight)(
00387                                     CameraInfoHandle cameraInfoHandle);
00388 
00389             float               (*getCameraInfoTop)(
00390                                     CameraInfoHandle cameraInfoHandle);
00391 
00392             float               (*getCameraInfoBottom)(
00393                                     CameraInfoHandle cameraInfoHandle);
00394 
00395             int                 (*getCameraInfoOrtho)(
00396                                     CameraInfoHandle cameraInfoHandle);
00397 
00398             float               (*getCameraInfoOrthoWidth)(
00399                                     CameraInfoHandle cameraInfoHandle);
00400 
00401             double *            (*getCameraInfoXForm)(
00402                                     CameraInfoHandle cameraInfoHandle);
00403 
00404             bool                (*processLocation)(
00405                                     FnSgIteratorHandle sgIteratorHandle,
00406                                     const char* rendererName,
00407                                     const char* locationName,
00408                                     void* optionalInput,
00409                                     void** optionalOutput);
00410 
00411             FnAttributeHandle   (*fillDelegateHandledLocationTypesList)(
00412                                     const char* rendererName);
00413 
00414             FnAttributeHandle   (*buildTempRenderLocation)(
00415                                     FnSgIteratorHandle sgIteratorHandle,
00416                                     const char* outputName,
00417                                     const char* prefix,
00418                                     const char* fileExtension,
00419                                     float frameTime);
00420 
00421             FnAttributeHandle   (*buildTileLocation)(
00422                                     FnSgIteratorHandle sgIteratorHandle,
00423                                     const char* outputPath);
00424 
00425         };
00426 
00427 } // external "C"
00428 
00429 #endif
 All Classes Functions Variables Typedefs Enumerations Enumerator