ai_drivers.h
Go to the documentation of this file.
1// Copyright 2022 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_nodes.h"
14#include "ai_api.h"
15#include "ai_bbox.h"
16#include "ai_output_iterator.h"
17#include <stdint.h> // uint32_t etc
18
19// forward declaration
20struct AtOutputIterator;
21struct AtAOVSampleIterator;
22
47 bool (*DriverSupportsPixelType)(const AtNode*, uint8_t);
48 const char** (*DriverExtension)();
49 void (*DriverOpen)(AtNode*, struct AtOutputIterator*, AtBBox2, AtBBox2, int);
50 bool (*DriverNeedsBucket)(AtNode*, int, int, int, int, uint16_t);
51 void (*DriverPrepareBucket)(AtNode*, int, int, int, int, uint16_t);
52 void (*DriverProcessBucket)(AtNode*, struct AtOutputIterator*, struct AtAOVSampleIterator*, int, int, int, int, uint16_t);
53 void (*DriverWriteBucket)(AtNode*, struct AtOutputIterator*, struct AtAOVSampleIterator*, int, int, int, int);
54 void (*DriverClose)(AtNode*, struct AtOutputIterator*);
55};
56
58#define AI_DRIVER_NODE_EXPORT_METHODS(tag) \
59AI_INSTANCE_COMMON_METHODS \
60driver_supports_pixel_type; \
61driver_extension; \
62driver_open; \
63driver_needs_bucket; \
64driver_prepare_bucket; \
65driver_process_bucket; \
66driver_write_bucket; \
67driver_close; \
68static AtDriverNodeMethods ai_driver_mtds = { \
69 DriverSupportsPixelType, \
70 DriverExtension, \
71 DriverOpen, \
72 DriverNeedsBucket, \
73 DriverPrepareBucket, \
74 DriverProcessBucket, \
75 DriverWriteBucket, \
76 DriverClose, \
77}; \
78static AtNodeMethods ai_node_mtds = { \
79 &ai_common_mtds, \
80 &ai_driver_mtds \
81}; \
82const AtNodeMethods *tag = &ai_node_mtds;
83
96#define driver_supports_pixel_type \
97static bool DriverSupportsPixelType(const AtNode* node, uint8_t pixel_type)
98
113#define driver_extension \
114static const char** DriverExtension()
115
128#define driver_open \
129static void DriverOpen(AtNode* node, struct AtOutputIterator* iterator, AtBBox2 display_window, AtBBox2 data_window, int bucket_size)
130
146#define driver_needs_bucket \
147static bool DriverNeedsBucket(AtNode* node, int bucket_xo, int bucket_yo, int bucket_size_x, int bucket_size_y, uint16_t tid)
148
165#define driver_prepare_bucket \
166static void DriverPrepareBucket(AtNode* node, int bucket_xo, int bucket_yo, int bucket_size_x, int bucket_size_y, uint16_t tid)
167
186#define driver_process_bucket \
187static void DriverProcessBucket(AtNode* node, struct AtOutputIterator* iterator, struct AtAOVSampleIterator* sample_iterator, int bucket_xo, int bucket_yo, int bucket_size_x, int bucket_size_y, uint16_t tid)
188
205#define driver_write_bucket \
206static void DriverWriteBucket(AtNode* node, struct AtOutputIterator* iterator, struct AtAOVSampleIterator* sample_iterator, int bucket_xo, int bucket_yo, int bucket_size_x, int bucket_size_y)
207
216#define driver_close \
217static void DriverClose(AtNode* node, struct AtOutputIterator* iterator)
218/* \}*/
219
225AI_API void AiDriverInitialize(AtNode* node, bool supports_multiple_outputs);
226AI_API void AiRawDriverInitialize(AtNode* node, const char** required_aovs, bool requires_depth);
227AI_API void AiDriverGetMatrices(AtMatrix& world_to_camera, AtMatrix& world_to_screen);
228AI_API const char** AiDriverExtension(const AtNodeEntry* node_entry);
229
230AI_API const AtNodeEntry* AiFindDriverType(const char* extension);
231
232/* \}*/
233
234/*\}*/
DLL export prefix for API functions (necessary for multi-platform development)
Axis-aligned bounding box types and utilities.
AtNode struct and methods.
AtOutputIterator type and methods.
AI_API const AtNodeEntry * AiFindDriverType(const char *extension)
Get correct driver node type from an extension.
Definition: ai_drivers.cpp:121
AI_API const char ** AiDriverExtension(const AtNodeEntry *node_entry)
Invokes a driver's driver_extension method which returns a NULL-terminated array of filename extensio...
Definition: ai_drivers.cpp:26
AI_API void AiRawDriverInitialize(AtNode *node, const char **required_aovs, bool requires_depth)
Allocates and initializes the driver structure.
Definition: ai_drivers.cpp:60
AI_API void AiDriverInitialize(AtNode *node, bool supports_multiple_outputs)
Allocates and initializes the driver structure.
Definition: ai_drivers.cpp:39
AI_API void AiDriverGetMatrices(AtMatrix &world_to_camera, AtMatrix &world_to_screen)
Get Renderman compliant matrices from the active camera for use in file headers.
Definition: ai_drivers.cpp:80
2D axis-aligned bounding box (uses integers)
Definition: ai_bbox.h:169
Driver Node methods structure.
Definition: ai_drivers.h:46
Definition: ai_matrix.h:30
This represents a node type in Arnold.
This represents a node in Arnold.
This represents an iterator that is used to iterate over group of ouputs in Arnold.

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