|
|
virtual Sint32 | load_module (ITransaction *transaction, const char *argument, IMdl_execution_context *context=0)=0 |
| Loads an MDL module from disk (or a builtin module) into the database. More...
|
|
virtual Sint32 | load_module_from_string (ITransaction *transaction, const char *module_name, const char *module_source, IMdl_execution_context *context=0)=0 |
| Loads an MDL module from memory into the database. More...
|
|
|
virtual Sint32 | export_module (ITransaction *transaction, const char *module_name, const char *filename, IMdl_execution_context *context=0)=0 |
| Exports an MDL module from the database to disk. More...
|
|
virtual Sint32 | export_module_to_string (ITransaction *transaction, const char *module_name, IString *exported_module, IMdl_execution_context *context=0)=0 |
| Exports an MDL module from the database to string. More...
|
|
virtual Sint32 | export_canvas (const char *filename, const ICanvas *canvas, const IMap *export_options=0) const =0 |
| Exports a canvas to a file on disk. More...
|
|
virtual Sint32 | export_lightprofile (const char *filename, const ILightprofile *lightprofile) const =0 |
| Exports a light profile to disk. More...
|
|
virtual Sint32 | export_bsdf_data (const char *filename, const IBsdf_isotropic_data *reflection, const IBsdf_isotropic_data *transmission) const =0 |
| Exports BSDF data to a file on disk. More...
|
|
|
virtual const ISerialized_function_name * | serialize_function_name (const char *definition_name, const IType_list *argument_types, const IType *return_type, IMdle_serialization_callback *mdle_callback, IMdl_execution_context *context) const =0 |
| Serializes the name of a function or material definition. More...
|
|
virtual const IDeserialized_function_name * | deserialize_function_name (ITransaction *transaction, const char *function_name, IMdle_deserialization_callback *mdle_callback, IMdl_execution_context *context) const =0 |
| Deserializes the serialized name of a function or material definition (first overload) More...
|
|
virtual const IDeserialized_function_name * | deserialize_function_name (ITransaction *transaction, const char *module_name, const char *function_name_without_module_name, IMdle_deserialization_callback *mdle_callback, IMdl_execution_context *context) const =0 |
| Deserializes the serialized name of a function or material definition (second overload). More...
|
|
virtual const IDeserialized_module_name * | deserialize_module_name (const char *module_name, IMdle_deserialization_callback *mdle_callback, IMdl_execution_context *context) const =0 |
| Deserializes the serialized name of a module. More...
|
|
|
virtual IReader * | create_reader (const IBuffer *buffer) const =0 |
| Creates a random-access reader for a given buffer. More...
|
|
virtual IReader * | create_reader (const char *filename) const =0 |
| Returns a random-access reader for a given file. More...
|
|
virtual IWriter * | create_writer (const char *filename) const =0 |
| Returns a random-access writer for a given file. More...
|
|
virtual Sint32 | deprecated_export_canvas (const char *filename, const ICanvas *canvas, Uint32 quality, bool force_default_gamma) 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...
|
|
API component for MDL related import and export operations.
virtual Sint32 mi::neuraylib::IMdl_impexp_api::export_canvas |
( |
const char * |
filename, |
|
|
const ICanvas * |
canvas, |
|
|
const IMap * |
export_options = 0 |
|
) |
| const |
|
pure virtual |
Exports a canvas to a file on disk.
If the image plugin that is selected for the export based on the filename
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
-
filename | The file name of the resource to export the canvas to. The ending of the file name 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. |
export_options | See Image export options for supported options. |
- Returns
- 0: Success.
- -1: Invalid file name.
- -2: Invalid canvas.
- -4: Unspecified failure.
Loads an MDL module from disk (or a builtin module) into the database.
The module is located on disk according to the module search paths (see mi::neuraylib::IMdl_configuration::add_mdl_path()), loaded, and compiled. If successful, the method creates DB elements for the module and all its imported modules, as well as for all material and function definitions contained in these modules.
The method can also be used for builtin modules for which the first step, locating the module on disk, is skipped.
- Parameters
-
transaction | The transaction to be used. |
argument | The MDL name of the module (for non-MDLE modules), or an MDLE file path (absolute or relative to the current working directory). |
context | The execution context can be used to pass options to control the behavior of the MDL compiler. The following options are supported by this operation:
- string "internal_space" = "coordinate_object"|"coordinate_world" (default = "coordinate_world")
During module loading, compiler messages like errors or warnings are stored in the context. Can be NULL . |
- Returns
- 1: Success (module exists already, loading from file was skipped).
- 0: Success (module was actually loaded from file or is a builtin module).
- -1: The MDL module name/MDLE file path
argument
is invalid or a NULL
pointer.
- -2: Failed to find or to compile the module
argument
.
- -3: The DB name for an imported module is already in use but is not an MDL module, or the DB name for a definition in this module is already in use.
- -4: Initialization of an imported module failed.
- See also
- mi::neuraylib::IMdl_impexp_api::get_mdl_module_name()