neuray API Programmer's Manual

imdl_impexp_api.h File Reference

Description

API component for MDL related import and export operations.

Code Example

imdl_impexp_api.h

‎/***************************************************************************************************
 * Copyright 2024 NVIDIA Corporation. All rights reserved.
 **************************************************************************************************/

#ifndef MI_NEURAYLIB_IMDL_IMPEXP_API_H
#define MI_NEURAYLIB_IMDL_IMPEXP_API_H

#include <mi/base/interface_declare.h>
#include <mi/neuraylib/version.h>

namespace mi {

class IMap;
class IString;

namespace neuraylib {

class IBuffer;
class IBsdf_isotropic_data;
class ICanvas;
class IDeserialized_function_name;
class IDeserialized_module_name;
class ILightprofile;
class IMdl_execution_context;
class IMdle_deserialization_callback;
class IMdle_serialization_callback;
class IReader;
class ISerialized_function_name;
class ITransaction;
class IType;
class IType_list;
class IWriter;


class IMdl_impexp_api : public
    mi::base::Interface_declare<0xd8584ade,0xa400,0x486b,0xab,0x29,0x39,0xcd,0x87,0x55,0x14,0x5d>
{
public:



    virtual Sint32 
               load_module(
        ITransaction* transaction, const char* argument, IMdl_execution_context* context = 0) = 0;

    virtual Sint32 
               load_module_from_string(
        ITransaction* transaction,
        const char* module_name,
        const char* module_source,
        IMdl_execution_context* context = 0) = 0;




    virtual Sint32 
               export_module(
        ITransaction* transaction,
        const char* module_name,
        const char* filename,
        IMdl_execution_context* context = 0) = 0;

    virtual Sint32 
               export_module_to_string(
        ITransaction* transaction,
        const char* module_name,
        IString* exported_module,
        IMdl_execution_context* context = 0) = 0;

    virtual Sint32 
               export_canvas(
        const char* filename,
        const ICanvas* canvas,
        const IMap* export_options = 0) const = 0;

    virtual Sint32 
               export_lightprofile(
        const char* filename, const ILightprofile* lightprofile) const = 0;

    virtual Sint32 
               export_bsdf_data(
        const char* filename,
        const IBsdf_isotropic_data* reflection,
        const IBsdf_isotropic_data* transmission) const = 0;




    enum Search_option
    {
        SEARCH_OPTION_USE_FIRST    = 0,
        SEARCH_OPTION_USE_SHORTEST = 1,
        SEARCH_OPTION_USE_LONGEST  = 2,
        //  Undocumented, for alignment only.
        SEARCH_OPTION_FORCE_32_BIT = 0xffffffffU
    };

    virtual const IString* get_mdl_module_name(
        const char* filename, Search_option option = SEARCH_OPTION_USE_FIRST) const = 0;

    virtual const IString* frame_uvtile_marker_to_string(
        const char* marker, Size f, Sint32 u, Sint32 v) const = 0;




    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;

    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;

    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;

    virtual const IDeserialized_module_name* deserialize_module_name(
        const char* module_name,
        IMdle_deserialization_callback* mdle_callback,
        IMdl_execution_context* context) const = 0;




    virtual IReader* create_reader( const IBuffer* buffer) const = 0;

    virtual IReader* create_reader( const char* filename) const = 0;

    virtual IWriter* create_writer( const char* filename) const = 0;


    virtual Sint32 deprecated_export_canvas(
        const char* filename,
        const ICanvas* canvas,
        Uint32 quality,
        bool force_default_gamma) const = 0;

#ifdef MI_NEURAYLIB_DEPRECATED_15_0
    inline Sint32 
               export_canvas(
        const char* filename,
        const ICanvas* canvas,
        Uint32 quality,
        bool force_default_gamma = false) const
    { return deprecated_export_canvas( filename, canvas, quality, force_default_gamma); }
#endif
};

mi_static_assert( sizeof( IMdl_impexp_api::Search_option) == sizeof( Uint32));

class ISerialized_function_name : public
    mi::base::Interface_declare<0x1b22f27d,0xf815,0x495f,0x96,0x71,0x64,0x08,0x5a,0xcc,0x8c,0x0d>
{
public:
    virtual const char* get_function_name() const = 0;

    virtual const char* get_module_name() const = 0;

    virtual const char* get_function_name_without_module_name() const = 0;
};

class IDeserialized_function_name : public
    mi::base::Interface_declare<0x2bb03f26,0x3a73,0x499d,0x90,0x64,0x19,0x79,0xea,0x40,0xc1,0x49>
{
public:
    virtual const char* get_db_name() const = 0;

    virtual const IType_list* get_argument_types() const = 0;
};

class IDeserialized_module_name : public
    mi::base::Interface_declare<0xe2136899,0x0011,0x45d1,0xb0,0x45,0xa7,0xbb,0x03,0xa7,0xf4,0x0c>
{
public:
    virtual const char* get_db_name() const = 0;

    virtual const char* get_load_module_argument() const = 0;
};

class IMdle_serialization_callback : public
    mi::base::Interface_declare<0x5888652a,0x79d6,0x49ba,0x87,0x90,0x0c,0x1b,0x32,0x83,0xf8,0x63>
{
public:
    virtual const IString* get_serialized_filename( const char* filename) const = 0;
};

class IMdle_deserialization_callback : public
    mi::base::Interface_declare<0xe7f636eb,0x8d04,0x4e3b,0x97,0x67,0x3a,0x93,0x1c,0x90,0xc9,0x7e>
{
public:
    virtual const IString* get_deserialized_filename( const char* serialized_filename) const = 0;
};
 // end group mi_neuray_mdl_misc

} // namespace neuraylib

} // namespace mi

#endif // MI_NEURAYLIB_IMDL_IMPEXP_API_H

Namespaces

namespace 
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH. More...
namespace 
Namespace for the neuray API. More...

Classes

class 
Represents a deserialized function name. More...
class 
Represents a deserialized module name. More...
class 
API component for MDL related import and export operations. More...
class 
Callback to map references to MDLE modules during deserialization. More...
class 
Callback to map references to MDLE modules during serialization. More...
class 
Represents a serialized function name. More...