MDL SDK API nvidia_logo_transpbg.gif Up
imdl_impexp_api.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2024 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IMDL_IMPEXP_API_H
8#define MI_NEURAYLIB_IMDL_IMPEXP_API_H
9
12
13namespace mi {
14
15class IMap;
16class IString;
17
18namespace neuraylib {
19
20class IBuffer;
21class IBsdf_isotropic_data;
22class ICanvas;
23class IDeserialized_function_name;
24class IDeserialized_module_name;
25class ILightprofile;
26class IMdl_execution_context;
27class IMdle_deserialization_callback;
28class IMdle_serialization_callback;
29class IReader;
30class ISerialized_function_name;
31class ITransaction;
32class IType;
33class IType_list;
34class IWriter;
35
41class IMdl_impexp_api : public
42 mi::base::Interface_declare<0xd8584ade,0xa400,0x486b,0xab,0x29,0x39,0xcd,0x87,0x55,0x14,0x5d>
43{
44public:
45
47
48
85 ITransaction* transaction, const char* argument, IMdl_execution_context* context = 0) = 0;
86
124 ITransaction* transaction,
125 const char* module_name,
126 const char* module_source,
127 IMdl_execution_context* context = 0) = 0;
128
130
132
164 ITransaction* transaction,
165 const char* module_name,
166 const char* filename,
167 IMdl_execution_context* context = 0) = 0;
168
200 ITransaction* transaction,
201 const char* module_name,
202 IString* exported_module,
203 IMdl_execution_context* context = 0) = 0;
204
235 const char* filename,
236 const ICanvas* canvas,
237 const IMap* export_options = 0) const = 0;
238
249 const char* filename, const ILightprofile* lightprofile) const = 0;
250
261 const char* filename,
262 const IBsdf_isotropic_data* reflection,
263 const IBsdf_isotropic_data* transmission) const = 0;
264
266
268
271 {
278 // Undocumented, for alignment only.
279 SEARCH_OPTION_FORCE_32_BIT = 0xffffffffU
280 };
281
297 const char* filename, Search_option option = SEARCH_OPTION_USE_FIRST) const = 0;
298
308 const char* marker, Size f, Sint32 u, Sint32 v) const = 0;
309
311
313
332 const char* definition_name,
333 const IType_list* argument_types,
334 const IType* return_type,
335 IMdle_serialization_callback* mdle_callback,
336 IMdl_execution_context* context) const = 0;
337
351 ITransaction* transaction,
352 const char* function_name,
353 IMdle_deserialization_callback* mdle_callback,
354 IMdl_execution_context* context) const = 0;
355
378 ITransaction* transaction,
379 const char* module_name,
380 const char* function_name_without_module_name,
381 IMdle_deserialization_callback* mdle_callback,
382 IMdl_execution_context* context) const = 0;
383
401 const char* module_name,
402 IMdle_deserialization_callback* mdle_callback,
403 IMdl_execution_context* context) const = 0;
404
406
408
410 virtual IReader* create_reader( const IBuffer* buffer) const = 0;
411
417 virtual IReader* create_reader( const char* filename) const = 0;
418
424 virtual IWriter* create_writer( const char* filename) const = 0;
425
427
428 virtual Sint32 deprecated_export_canvas(
429 const char* filename,
430 const ICanvas* canvas,
431 Uint32 quality,
432 bool force_default_gamma) const = 0;
433
434#ifdef MI_NEURAYLIB_DEPRECATED_15_0
435 inline Sint32 export_canvas(
436 const char* filename,
437 const ICanvas* canvas,
438 Uint32 quality,
439 bool force_default_gamma = false) const
440 { return deprecated_export_canvas( filename, canvas, quality, force_default_gamma); }
441#endif
442};
443
445
450 mi::base::Interface_declare<0x1b22f27d,0xf815,0x495f,0x96,0x71,0x64,0x08,0x5a,0xcc,0x8c,0x0d>
451{
452public:
459 virtual const char* get_function_name() const = 0;
460
467 virtual const char* get_module_name() const = 0;
468
475 virtual const char* get_function_name_without_module_name() const = 0;
476};
477
482 mi::base::Interface_declare<0x2bb03f26,0x3a73,0x499d,0x90,0x64,0x19,0x79,0xea,0x40,0xc1,0x49>
483{
484public:
486 virtual const char* get_db_name() const = 0;
487
494 virtual const IType_list* get_argument_types() const = 0;
495};
496
501 mi::base::Interface_declare<0xe2136899,0x0011,0x45d1,0xb0,0x45,0xa7,0xbb,0x03,0xa7,0xf4,0x0c>
502{
503public:
505 virtual const char* get_db_name() const = 0;
506
508 virtual const char* get_load_module_argument() const = 0;
509};
510
524 mi::base::Interface_declare<0x5888652a,0x79d6,0x49ba,0x87,0x90,0x0c,0x1b,0x32,0x83,0xf8,0x63>
525{
526public:
539 virtual const IString* get_serialized_filename( const char* filename) const = 0;
540};
541
556 mi::base::Interface_declare<0xe7f636eb,0x8d04,0x4e3b,0x97,0x67,0x3a,0x93,0x1c,0x90,0xc9,0x7e>
557{
558public:
568 virtual const IString* get_deserialized_filename( const char* serialized_filename) const = 0;
569};
570 // end group mi_neuray_mdl_misc
572
573} // namespace neuraylib
574
575} // namespace mi
576
577#endif // MI_NEURAYLIB_IMDL_IMPEXP_API_H
This interface represents maps, i.e., a key-value based data structure.
Definition: imap.h:41
A simple string class.
Definition: istring.h:22
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
Abstract interface for isotropic BSDF data.
Definition: ibsdf_isotropic_data.h:44
Abstract interface for a simple buffer with binary data.
Definition: ibuffer.h:25
Abstract interface for a canvas represented by a rectangular array of tiles.
Definition: icanvas.h:89
Represents a deserialized function name.
Definition: imdl_impexp_api.h:483
virtual const IType_list * get_argument_types() const =0
Returns the argument types of the serialized function call or material instance.
virtual const char * get_db_name() const =0
Returns the DB name of the function of material definition.
Represents a deserialized module name.
Definition: imdl_impexp_api.h:502
virtual const char * get_load_module_argument() const =0
Returns a string suitable for mi::neuraylib::IMdl_impexp_api::load_module().
virtual const char * get_db_name() const =0
Returns the DB name of the module.
This interface represents light profiles.
Definition: ilightprofile.h:73
The execution context can be used to query status information like error and warning messages concern...
Definition: imdl_execution_context.h:131
API component for MDL related import and export operations.
Definition: imdl_impexp_api.h:43
virtual IReader * create_reader(const char *filename) const =0
Returns a random-access reader for a given file.
virtual IReader * create_reader(const IBuffer *buffer) const =0
Creates a random-access reader for a given buffer.
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.
virtual IWriter * create_writer(const char *filename) const =0
Returns a random-access writer for a given file.
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).
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.
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.
virtual const IString * get_mdl_module_name(const char *filename, Search_option option=SEARCH_OPTION_USE_FIRST) const =0
Returns the MDL name for an MDL module identified by its filename.
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.
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.
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.
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.
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)
virtual Sint32 export_lightprofile(const char *filename, const ILightprofile *lightprofile) const =0
Exports a light profile to disk.
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.
Search_option
Controls the behavior of mi::neuraylib::IMdl_impexp_api::get_mdl_module_name().
Definition: imdl_impexp_api.h:271
@ SEARCH_OPTION_USE_FIRST
Derive module name from the first search path that matches.
Definition: imdl_impexp_api.h:273
@ SEARCH_OPTION_USE_LONGEST
Derive module name from the longest search path that matches.
Definition: imdl_impexp_api.h:277
@ SEARCH_OPTION_USE_SHORTEST
Derive module name from the shortest search path that matches.
Definition: imdl_impexp_api.h:275
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.
Callback to map references to MDLE modules during deserialization.
Definition: imdl_impexp_api.h:557
virtual const IString * get_deserialized_filename(const char *serialized_filename) const =0
Returns a the filename of an MDLE module given its serialized filename.
Callback to map references to MDLE modules during serialization.
Definition: imdl_impexp_api.h:525
virtual const IString * get_serialized_filename(const char *filename) const =0
Returns a serialized filename for the given MDLE filename.
A reader supports binary block reads and string-oriented line reads that zero-terminate the result.
Definition: ireader.h:27
Represents a serialized function name.
Definition: imdl_impexp_api.h:451
virtual const char * get_function_name_without_module_name() const =0
Returns the serialized function name (without the module name).
virtual const char * get_module_name() const =0
Returns the serialized module name.
virtual const char * get_function_name() const =0
Returns the serialized function name.
A transaction provides a consistent view on the database.
Definition: itransaction.h:82
An ordered collection of types identified by name or index.
Definition: itype.h:646
The interface to MDL types.
Definition: itype.h:151
A writer supports binary block writes and string-oriented line writes that accept a zero-terminated s...
Definition: iwriter.h:27
#define mi_static_assert(expr)
Compile time assertion that raises a compilation error if the constant expression expr evaluates to f...
Definition: assert.h:58
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
Uint64 Size
Unsigned integral type that is large enough to hold the size of all types.
Definition: types.h:112
signed int Sint32
32-bit signed integer.
Definition: types.h:46
Mixin class template for deriving new interface declarations.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5
Major and minor version number and an optional qualifier.