MDL SDK API nvidia_logo_transpbg.gif Up
imdl_impexp_api.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2022 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 IString;
16
17namespace neuraylib {
18
19class IBuffer;
20class IBsdf_isotropic_data;
21class ICanvas;
22class IDeserialized_function_name;
23class IDeserialized_module_name;
24class ILightprofile;
25class IMdl_execution_context;
26class IMdle_deserialization_callback;
27class IMdle_serialization_callback;
28class IReader;
29class ISerialized_function_name;
30class ITransaction;
31class IType;
32class IType_list;
33class IWriter;
34
40class IMdl_impexp_api : public
41 mi::base::Interface_declare<0xd8584ade,0xa400,0x486b,0xab,0x29,0x39,0xcd,0x87,0x55,0x14,0x5d>
42{
43public:
44
46
47
84 ITransaction* transaction, const char* argument, IMdl_execution_context* context = 0) = 0;
85
123 ITransaction* transaction,
124 const char* module_name,
125 const char* module_source,
126 IMdl_execution_context* context = 0) = 0;
127
129
131
163 ITransaction* transaction,
164 const char* module_name,
165 const char* filename,
166 IMdl_execution_context* context = 0) = 0;
167
199 ITransaction* transaction,
200 const char* module_name,
201 IString* exported_module,
202 IMdl_execution_context* context = 0) = 0;
203
240 const char* filename,
241 const ICanvas* canvas,
242 Uint32 quality = 100,
243 bool force_default_gamma = false) const = 0;
244
255 const char* filename, const ILightprofile* lightprofile) const = 0;
256
267 const char* filename,
268 const IBsdf_isotropic_data* reflection,
269 const IBsdf_isotropic_data* transmission) const = 0;
270
272
274
277 {
284 // Undocumented, for alignment only.
285 SEARCH_OPTION_FORCE_32_BIT = 0xffffffffU
286 };
287
303 const char* filename, Search_option option = SEARCH_OPTION_USE_FIRST) const = 0;
304
314 const char* marker, Size f, Sint32 u, Sint32 v) const = 0;
315
316#ifdef MI_NEURAYLIB_DEPRECATED_12_1
317 inline const IString* uvtile_marker_to_string( const char* marker, Sint32 u, Sint32 v)
318 { return frame_uvtile_marker_to_string( marker, 0, u, v); }
319#endif
320
322
324
344 const char* definition_name,
345 const IType_list* argument_types,
346 const IType* return_type,
347 IMdle_serialization_callback* mdle_callback,
348 IMdl_execution_context* context) const = 0;
349
364 ITransaction* transaction,
365 const char* function_name,
366 IMdle_deserialization_callback* mdle_callback,
367 IMdl_execution_context* context) const = 0;
368
392 ITransaction* transaction,
393 const char* module_name,
394 const char* function_name_without_module_name,
395 IMdle_deserialization_callback* mdle_callback,
396 IMdl_execution_context* context) const = 0;
397
416 const char* module_name,
417 IMdle_deserialization_callback* mdle_callback,
418 IMdl_execution_context* context) const = 0;
419
421
423
425 virtual IReader* create_reader( const IBuffer* buffer) const = 0;
426
432 virtual IReader* create_reader( const char* filename) const = 0;
433
439 virtual IWriter* create_writer( const char* filename) const = 0;
440
442
443 virtual const IString* MI_NEURAYLIB_DEPRECATED_METHOD_12_1(uvtile_string_to_marker)(
444 const char* str, const char* marker) const = 0;
445
446 virtual const IString* MI_NEURAYLIB_DEPRECATED_METHOD_12_1(frame_string_to_marker)(
447 const char* str, Size digits) const = 0;
448};
449
451
456 mi::base::Interface_declare<0x1b22f27d,0xf815,0x495f,0x96,0x71,0x64,0x08,0x5a,0xcc,0x8c,0x0d>
457{
458public:
465 virtual const char* get_function_name() const = 0;
466
473 virtual const char* get_module_name() const = 0;
474
481 virtual const char* get_function_name_without_module_name() const = 0;
482};
483
488 mi::base::Interface_declare<0x2bb03f26,0x3a73,0x499d,0x90,0x64,0x19,0x79,0xea,0x40,0xc1,0x49>
489{
490public:
492 virtual const char* get_db_name() const = 0;
493
500 virtual const IType_list* get_argument_types() const = 0;
501};
502
507 mi::base::Interface_declare<0xe2136899,0x0011,0x45d1,0xb0,0x45,0xa7,0xbb,0x03,0xa7,0xf4,0x0c>
508{
509public:
511 virtual const char* get_db_name() const = 0;
512
514 virtual const char* get_load_module_argument() const = 0;
515};
516
530 mi::base::Interface_declare<0x5888652a,0x79d6,0x49ba,0x87,0x90,0x0c,0x1b,0x32,0x83,0xf8,0x63>
531{
532public:
545 virtual const IString* get_serialized_filename( const char* filename) const = 0;
546};
547
562 mi::base::Interface_declare<0xe7f636eb,0x8d04,0x4e3b,0x97,0x67,0x3a,0x93,0x1c,0x90,0xc9,0x7e>
563{
564public:
574 virtual const IString* get_deserialized_filename( const char* serialized_filename) const = 0;
575};
576 // end group mi_neuray_mdl_misc
578
579} // namespace neuraylib
580
581} // namespace mi
582
583#endif // MI_NEURAYLIB_IMDL_IMPEXP_API_H
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:85
Represents a deserialized function name.
Definition: imdl_impexp_api.h:489
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:508
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:126
API component for MDL related import and export operations.
Definition: imdl_impexp_api.h:42
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 Sint32 export_canvas(const char *filename, const ICanvas *canvas, Uint32 quality=100, bool force_default_gamma=false) const =0
Exports a canvas to a file on disk.
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 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:277
@ SEARCH_OPTION_USE_FIRST
Derive module name from the first search path that matches.
Definition: imdl_impexp_api.h:279
@ SEARCH_OPTION_USE_LONGEST
Derive module name from the longest search path that matches.
Definition: imdl_impexp_api.h:283
@ SEARCH_OPTION_USE_SHORTEST
Derive module name from the shortest search path that matches.
Definition: imdl_impexp_api.h:281
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:563
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:531
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:457
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:84
An ordered collection of types identified by name or index.
Definition: itype.h:542
The interface to MDL types.
Definition: itype.h:51
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:65
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:47
Uint64 Size
Unsigned integral type that is large enough to hold the size of all types.
Definition: types.h:110
signed int Sint32
32-bit signed integer.
Definition: types.h:44
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.