|
|
virtual const IExport_result * | export_scene (ITransaction *transaction, const char *uri, const char *rootgroup, const char *caminst=0, const char *options=0, const IMap *exporter_options=0) const =0 |
| Exports a scene. More...
|
|
virtual const IExport_result * | export_elements (ITransaction *transaction, const char *uri, const IArray *elements, const IMap *exporter_options=0) const =0 |
| Exports scene elements. More...
|
|
virtual const IExport_result * | export_elements_to_string (ITransaction *transaction, const IArray *elements, const char *file_extension, IString *result_string, const IMap *exporter_options=0) const =0 |
| Exports scene elements to string. More...
|
|
virtual Sint32 | export_canvas (const char *uri, const ICanvas *canvas, Uint32 quality=100, bool force_default_gamma=false) const =0 |
| Exports a canvas to a file on disk. More...
|
|
virtual Sint32 | export_lightprofile (const char *uri, const ILightprofile *lightprofile) const =0 |
| Exports a light profile to disk. More...
|
|
virtual Sint32 | export_bsdf_data (const char *uri, const IBsdf_isotropic_data *reflection, const IBsdf_isotropic_data *transmission) const =0 |
| Exports BSDF data to a file on disk. More...
|
|
virtual Sint32 | export_volume_data (const char *uri, const char *selectors[], const IVolume_data *data[], Size count) const =0 |
| Exports a number of volume data sets to a file. More...
|
|
|
virtual Size | get_exporter_length () const =0 |
| Returns the number of registered exporters. More...
|
|
virtual const IExporter * | get_exporter (Size index) const =0 |
| Returns a registered exporter. More...
|
|
virtual const IExporter * | select_exporter_by_extension (const char *extension) const =0 |
| Returns the exporter that would be used for a particular file name extension. More...
|
|
virtual IWriter * | get_writer (const char *uri) const =0 |
| Returns a random-access writer that can be used to export to the given resource. More...
|
|
|
virtual const IString * | convert_filename_to_uri (const char *filename) const =0 |
| Converts a filename into a URI. More...
|
|
virtual const IString * | convert_uri_to_filename (const char *uri) const =0 |
| Converts a URI into a filename. More...
|
|
virtual const IArray * | get_export_dependencies (ITransaction *transaction, const char *rootgroup, const char *caminst, const char *options) const =0 |
| Returns scene dependencies suitable for an export operation. More...
|
|
virtual const IString * | frame_uvtile_marker_to_string (const char *marker, Size f, Sint32 u, Sint32 v) const =0 |
| Replaces a frame and/or uv-tile marker by coordinates of a given uv-tile. More...
|
|
virtual const IString *MI_NEURAYLIB_DEPRECATED_METHOD_12_1() | uvtile_string_to_marker (const char *str, const char *marker) const =0 |
|
virtual Uint32 | retain () const =0 |
| Increments the reference count. More...
|
|
virtual Uint32 | release () const =0 |
| Decrements the reference count. More...
|
|
virtual const IInterface * | get_interface (const Uuid &interface_id) const =0 |
| Acquires a const interface from another. More...
|
|
template<class T> |
const T * | get_interface () const |
| Acquires a const interface from another. More...
|
|
virtual IInterface * | get_interface (const Uuid &interface_id)=0 |
| Acquires a mutable interface from another. More...
|
|
template<class T> |
T * | get_interface () |
| Acquires a mutable interface from another. More...
|
|
virtual Uuid | get_iid () const =0 |
| Returns the interface ID of the most derived interface. More...
|
|
|
typedef Interface_declare< id1, ... > | Self |
| Own type. More...
|
|
typedef Uuid_t< id1, ... > | IID |
| Declares the interface ID (IID) of this interface. More...
|
|
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> | IID |
| Declares the interface ID (IID) of this interface. More...
|
|
static bool | compare_iid (const Uuid &iid) |
| Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
|
|
static bool | compare_iid (const Uuid &iid) |
| Compares the interface ID iid against the interface ID of this interface. More...
|
|
This interface is used to export files.
virtual Sint32 mi::neuraylib::IExport_api::export_canvas |
( |
const char * |
uri, |
|
|
const ICanvas * |
canvas, |
|
|
Uint32 |
quality = 100 , |
|
|
bool |
force_default_gamma = false |
|
) |
| const |
|
pure virtual |
Exports a canvas to a file on disk.
See Importer and Exporter for the URI naming conventions supported for the uri
parameter.
If the image plugin that is selected for the export based on the uri
parameter is not capable of handling the pixel type of canvas
, the canvas is internally converted into one of the pixel types supported by that image plugin for export. If the image plugin supports multiple pixel types for export, the "best" of them (w.r.t. the pixel type of the canvas) is chosen.
The "best" pixel type is determined by attempting to apply the following conversions in the given order to the pixel type of the canvas:
- use an equivalent pixel type (
"Color"
instead of "Float32<4>"
and vice versa, similar for "Rgb_fp"
/ "Float32<3>"
and "Rgba"
/ "Sint32"
),
- add an alpha channel (if not already present),
- increase bits per channel (smaller increase preferred),
- add additional channels (if possible),
- decrease bits per channel (smaller decrease preferred), and
- drop one or more channels.
- Parameters
-
uri | The URI of the resource to export the canvas to. The ending of the URI determines the image format, e.g., ".jpg" . Note that support for a given image format requires an image plugin capable of handling that format. |
canvas | The canvas to export. |
quality | The compression quality is an integer in the range from 0 to 100, where 0 is the lowest quality, and 100 is the highest quality. |
force_default_gamma | If enabled, adjusts the gamma value of the exported pixel data according to the pixel type chosen for export (1.0 for HDR pixel types, 2.2 for LDR pixel types). |
- Returns
- 0: Success.
- -1: Invalid URI.
- -2: Invalid canvas.
- -3: Invalid quality.
- -4: Unspecified failure.
virtual const IExport_result * mi::neuraylib::IExport_api::export_elements |
( |
ITransaction * |
transaction, |
|
|
const char * |
uri, |
|
|
const IArray * |
elements, |
|
|
const IMap * |
exporter_options = 0 |
|
) |
| const |
|
pure virtual |
Exports scene elements.
This method is equivalent to export_scene(), except that all named elements in the string array elements
are exported to the file. If the recurse
option is true
, any elements referenced by those elements are written as well.
In addition to exporter-specific options, every exporter supports the following standard options:
"strip_prefix"
of type mi::IString: This prefix is stripped from the names of all exported elements if they have the same prefix. This option can be used to undo the effect of the "prefix"
option for import operations. Default: the empty string.
"recurse"
of type mi::IBoolean: If true
, any elements referenced by the elements in the elements
array are exported as well, similar to the automatic recursion applied by export_scene(). Default: true
.
"time_stamp"
of type mi::IString: If not empty only the passed list of elements along with elements referenced by those that have been changed or added since the time identified by the time stamp are written. Other elements are omitted from the file, but not from recursion: an old element referencing an edited sub-element is not written, but the sub-element is. You can use the method mi::neuraylib::ITransaction::get_time_stamp() to get a time stamp. Default: the empty string.
You can use export_elements() to write incremental changes to be appended to an existing file, which is for example supported with the .mi
file format. The elements listed in the elements array are supposed to be independent entry points into the scene graph that need to be visited for the export. In the case that the "recurse"
option is true
, the export can handle duplicate entries and possible dependencies correctly. If the "recurse"
option is false
, the export cannot detect duplicates or dependencies automatically, in which case you should avoid duplicates and list in the elements
array elements that are referenced before the elements that reference them.
- Parameters
-
transaction | The transaction to be used. |
uri | The URI of the file to export to. See Importer and Exporter for the supported URI naming conventions. |
elements | A static or dynamic array of strings containing the names of elements to be exported. |
exporter_options | The exporter options (see above). |
- Returns
- The export result uses the following error codes.
- 0: The export operation was successful.
- 1: The passed URI is invalid (malformed).
- 2: The Iray SDK failed to create an instance of mi::neuraylib::IWriter for the given URI, most probably because it was unable to open the specified file, e.g., because the directory does not exist, or the user has insufficient permissions.
- 3: There is no appropriate exporter for the requested file format.
- 4: The exporter failed to create the instance of mi::neuraylib::IImpexp_state.
- 5: The exporter did not return a valid instance of mi::neuraylib::IExport_result.
- 6: The option '...' has an invalid type.
- 7: The option '...' has an invalid value.
- 8: The array
elements
is empty, contains elements that are not strings, or for at least one of the given names there is no DB element with that name.
- 6000-7999: Reserved for exporter-specific error codes.
The severity of all listed errors (excluding the exporter-specific error codes) is mi::base::details::MESSAGE_SEVERITY_ERROR. There might be other undocumented error codes.
virtual const IArray * mi::neuraylib::IExport_api::get_export_dependencies |
( |
ITransaction * |
transaction, |
|
|
const char * |
rootgroup, |
|
|
const char * |
caminst, |
|
|
const char * |
options |
|
) |
| const |
|
pure virtual |
Returns scene dependencies suitable for an export operation.
This method is intended for implementers of mi::neuraylib::IExporter::export_scene(). Given a root group, a camera instance, and the scene options, it computes the list of dependent scene elements. The list is ordered such that referenced scene elements appear before they are referenced.
The result is similar to the result of mi::neuraylib::ITransaction::list_elements(), except that the result is ordered (see above) and might be optimized for export operations. For example, dependencies of mi::neuraylib::IModule are not reported since an exporter does not have to deal with them -- importing the module itself is sufficient. Similarly, MDL material and function definitions are replaced by the corresponding module.
- Parameters
-
transaction | The transaction to be used. |
rootgroup | The root group, or NULL to ignore this parameter. |
caminst | The camera instance, or NULL to ignore this parameter. |
options | The scene options, or NULL to ignore this parameter. |
- Returns
- The ordered list of dependencies of
rootgroup
, caminst
, and options
, or NULL
in case of errors (invalid transaction
or non-existing rootgroup
, caminst
, or options
).