Castor3D 0.17.0
Multiplatform 3D engine
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
castor3d::MaterialImporter Class Referenceabstract

#include <MaterialImporter.hpp>

Inheritance diagram for castor3d::MaterialImporter:
Inheritance graph
[legend]
Collaboration diagram for castor3d::MaterialImporter:
Collaboration graph
[legend]

Public Member Functions

virtual ~MaterialImporter ()=default
 
C3D_API MaterialImporter (Engine &engine, castor::String const &prefix)
 Constructor.
 
C3D_API MaterialImporter (Engine &engine, castor::String const &prefix, ImporterFile *file)
 Constructor.
 
C3D_API MaterialPtr importData (castor::String const &name, ImporterFile *file, Parameters const &parameters, castor::Map< PassComponentTextureFlag, TextureConfiguration > const &textureRemaps)
 Material import Function.
 
C3D_API bool importData (Material &material, ImporterFile *file, Parameters const &parameters, castor::Map< PassComponentTextureFlag, TextureConfiguration > const &textureRemaps)
 Scene import Function.
 
C3D_API castor::ImageRPtr loadImage (castor::String const &name, castor::ImageCreateParams const &params) const
 Loads an image.
 
C3D_API castor::ImageRPtr loadImage (castor::Path const &path, castor::ImageLoaderConfig const &loadConfig) const
 Loads an image from a file.
 
C3D_API castor::ImageRPtr loadImage (castor::Path const &path) const
 Loads an image from a file.
 
C3D_API castor::ImageRPtr loadImage (castor::String const &name, castor::String type, castor::ByteArray data, castor::ImageLoaderConfig const &loadConfig) const
 Loads a texture.
 
C3D_API castor::ImageRPtr loadImage (castor::String name, castor::String type, castor::ByteArray data) const
 Loads a texture.
 
C3D_API TextureSourceInfo loadTexture (castor::Path const &path, TextureConfiguration const &config, castor::ImageLoaderConfig const &loadConfig) const
 Loads a texture.
 
C3D_API TextureSourceInfo loadTexture (castor::Path const &path, TextureConfiguration const &config) const
 Loads a texture.
 
C3D_API TextureSourceInfo loadTexture (castor::String name, castor::String type, castor::ByteArray data, TextureConfiguration const &config, castor::ImageLoaderConfig const &loadConfig) const
 Loads a texture.
 
C3D_API TextureSourceInfo loadTexture (castor::String name, castor::String type, castor::ByteArray data, TextureConfiguration const &config) const
 Loads a texture.
 
C3D_API void loadTexture (castor::Path const &path, TextureConfiguration const &config, PassTextureConfig const &passConfig, Pass &pass, castor::ImageLoaderConfig const &loadConfig) const
 Loads a texture and adds it to the given pass.
 
C3D_API void loadTexture (castor::Path const &path, TextureConfiguration const &config, PassTextureConfig const &passConfig, Pass &pass) const
 Loads a texture and adds it to the given pass.
 
C3D_API void loadTexture (castor::String name, castor::String type, castor::ByteArray data, TextureConfiguration const &config, PassTextureConfig const &passConfig, Pass &pass) const
 Loads a texture and adds it to the given pass.
 
C3D_API void loadTexture (castor::String name, castor::String type, castor::ByteArray data, TextureConfiguration const &config, PassTextureConfig const &passConfig, Pass &pass, castor::ImageLoaderConfig const &loadConfig) const
 Loads a texture and adds it to the given pass.
 
C3D_API bool convertToNormalMap (castor::Path &path, castor3d::TextureConfiguration &config) const
 Converts given height image file to a normal+height image.
 
ImporterFile const * getImporterFile () const noexcept
 
castor::StringView getPrefix () const noexcept
 
- Public Member Functions inherited from castor::OwnedBy< Engine >
Engine * getOwner () const noexcept
 
void setOwner (Engine &owner) noexcept
 

Static Public Member Functions

static C3D_API bool importData (Material &material, castor::Path const &pathFile, Parameters const &parameters, castor::Map< PassComponentTextureFlag, TextureConfiguration > const &textureRemaps)
 Scene import Function.
 

Protected Attributes

castor::String m_prefix
 
ImporterFilem_file {}
 
Parameters m_parameters
 
castor::Map< PassComponentTextureFlag, TextureConfigurationm_textureRemaps
 
castor::ImageLoaderConfig m_loadConfig { false, false, false }
 
float m_emissiveMult { 1.0f }
 

Additional Inherited Members

- Protected Member Functions inherited from castor::OwnedBy< Engine >
 OwnedBy (Engine &owner) noexcept
 Constructor.
 

Constructor & Destructor Documentation

◆ ~MaterialImporter()

virtual castor3d::MaterialImporter::~MaterialImporter ( )
virtualdefault

◆ MaterialImporter() [1/2]

C3D_API castor3d::MaterialImporter::MaterialImporter ( Engine & engine,
castor::String const & prefix )
explicit

Constructor.

Parameters
[in]engineThe engine.
[in]prefixThe prefix used for logging.

◆ MaterialImporter() [2/2]

C3D_API castor3d::MaterialImporter::MaterialImporter ( Engine & engine,
castor::String const & prefix,
ImporterFile * file )
explicit

Constructor.

Parameters
[in]engineThe engine.
[in]prefixThe prefix used for logging.
[in]fileThe file to import.

Member Function Documentation

◆ convertToNormalMap()

C3D_API bool castor3d::MaterialImporter::convertToNormalMap ( castor::Path & path,
castor3d::TextureConfiguration & config ) const

Converts given height image file to a normal+height image.

Parameters
[in,out]pathThe image file path (can be relative or absolute), receives the resulting normal+height image file path.
[in,out]configThe texture unit configuration.
Returns
false if any error occured.

◆ getImporterFile()

ImporterFile const * castor3d::MaterialImporter::getImporterFile ( ) const
inlinenoexcept

References m_file.

◆ getPrefix()

castor::StringView castor3d::MaterialImporter::getPrefix ( ) const
inlinenoexcept

References m_prefix.

◆ importData() [1/3]

C3D_API MaterialPtr castor3d::MaterialImporter::importData ( castor::String const & name,
ImporterFile * file,
Parameters const & parameters,
castor::Map< PassComponentTextureFlag, TextureConfiguration > const & textureRemaps )

Material import Function.

Parameters
[out]nameThe Material name.
[in]fileThe file to import.
[in]parametersImport configuration parameters.
[in]textureRemapsThe imported textures remapping parameters.
Returns
The imported Material, nullptr if any problem occured.

◆ importData() [2/3]

static C3D_API bool castor3d::MaterialImporter::importData ( Material & material,
castor::Path const & pathFile,
Parameters const & parameters,
castor::Map< PassComponentTextureFlag, TextureConfiguration > const & textureRemaps )
static

Scene import Function.

Parameters
[out]materialReceives the imported data.
[in]pathFileThe location of the file to import.
[in]parametersImport configuration parameters.
[in]textureRemapsThe imported textures remapping parameters.
Returns
false if any problem occured.

◆ importData() [3/3]

C3D_API bool castor3d::MaterialImporter::importData ( Material & material,
ImporterFile * file,
Parameters const & parameters,
castor::Map< PassComponentTextureFlag, TextureConfiguration > const & textureRemaps )

Scene import Function.

Parameters
[out]materialReceives the imported data.
[in]fileThe file to import.
[in]parametersImport configuration parameters.
[in]textureRemapsThe imported textures remapping parameters.
Returns
false if any problem occured.

◆ loadImage() [1/5]

C3D_API castor::ImageRPtr castor3d::MaterialImporter::loadImage ( castor::Path const & path) const

Loads an image from a file.

Parameters
[in]pathThe image file path (can be relative or absolute).
Returns
The image.

◆ loadImage() [2/5]

C3D_API castor::ImageRPtr castor3d::MaterialImporter::loadImage ( castor::Path const & path,
castor::ImageLoaderConfig const & loadConfig ) const

Loads an image from a file.

Parameters
[in]pathThe image file path (can be relative or absolute).
[in]loadConfigLa configuration pour le loader d'image.
Returns
The image.

◆ loadImage() [3/5]

C3D_API castor::ImageRPtr castor3d::MaterialImporter::loadImage ( castor::String const & name,
castor::ImageCreateParams const & params ) const

Loads an image.

Parameters
[in]nameThe image name.
[in]paramsThe image creation parameters.
Returns
The image.

◆ loadImage() [4/5]

C3D_API castor::ImageRPtr castor3d::MaterialImporter::loadImage ( castor::String const & name,
castor::String type,
castor::ByteArray data,
castor::ImageLoaderConfig const & loadConfig ) const

Loads a texture.

Parameters
[in]nameThe image name.
[in]typeThe image data type.
[in]dataThe image data.
[in]loadConfigLa configuration pour le loader d'image.
Returns
The texture unit.

◆ loadImage() [5/5]

C3D_API castor::ImageRPtr castor3d::MaterialImporter::loadImage ( castor::String name,
castor::String type,
castor::ByteArray data ) const

Loads a texture.

Parameters
[in]nameThe image name.
[in]typeThe image data type.
[in]dataThe image data.
Returns
The texture unit.

◆ loadTexture() [1/8]

C3D_API TextureSourceInfo castor3d::MaterialImporter::loadTexture ( castor::Path const & path,
TextureConfiguration const & config ) const

Loads a texture.

Parameters
[in]pathThe image file path (can be relative or absolute).
[in]configThe texture unit configuration.
Returns
The texture unit.

◆ loadTexture() [2/8]

C3D_API TextureSourceInfo castor3d::MaterialImporter::loadTexture ( castor::Path const & path,
TextureConfiguration const & config,
castor::ImageLoaderConfig const & loadConfig ) const

Loads a texture.

Parameters
[in]pathThe image file path (can be relative or absolute).
[in]configThe texture unit configuration.
[in]loadConfigThe image loader configuration.
Returns
The texture unit.

◆ loadTexture() [3/8]

C3D_API void castor3d::MaterialImporter::loadTexture ( castor::Path const & path,
TextureConfiguration const & config,
PassTextureConfig const & passConfig,
Pass & pass ) const

Loads a texture and adds it to the given pass.

Parameters
[in]pathThe image file path (can be relative or absolute).
[in]passConfigThe texture configuration.
[in]configThe texture unit configuration.
[in,out]passReceives the loaded image.

◆ loadTexture() [4/8]

C3D_API void castor3d::MaterialImporter::loadTexture ( castor::Path const & path,
TextureConfiguration const & config,
PassTextureConfig const & passConfig,
Pass & pass,
castor::ImageLoaderConfig const & loadConfig ) const

Loads a texture and adds it to the given pass.

Parameters
[in]pathThe image file path (can be relative or absolute).
[in]passConfigThe texture configuration.
[in]configThe texture unit configuration.
[in,out]passReceives the loaded image.
[in]loadConfigThe image loader configuration.

◆ loadTexture() [5/8]

C3D_API TextureSourceInfo castor3d::MaterialImporter::loadTexture ( castor::String name,
castor::String type,
castor::ByteArray data,
TextureConfiguration const & config ) const

Loads a texture.

Parameters
[in]nameThe image name.
[in]typeThe image data type.
[in]dataThe image data.
[in]configThe texture unit configuration.
Returns
The texture unit.

◆ loadTexture() [6/8]

C3D_API TextureSourceInfo castor3d::MaterialImporter::loadTexture ( castor::String name,
castor::String type,
castor::ByteArray data,
TextureConfiguration const & config,
castor::ImageLoaderConfig const & loadConfig ) const

Loads a texture.

Parameters
[in]nameThe image name.
[in]typeThe image data type.
[in]dataThe image data.
[in]configThe texture unit configuration.
[in]loadConfigThe image loader configuration.
Returns
The texture unit.

◆ loadTexture() [7/8]

C3D_API void castor3d::MaterialImporter::loadTexture ( castor::String name,
castor::String type,
castor::ByteArray data,
TextureConfiguration const & config,
PassTextureConfig const & passConfig,
Pass & pass ) const

Loads a texture and adds it to the given pass.

Parameters
[in]nameThe image name.
[in]typeThe image data type.
[in]dataThe image data.
[in]configThe texture configuration.
[in]passConfigThe texture unit configuration.
[in,out]passReceives the loaded image.

◆ loadTexture() [8/8]

C3D_API void castor3d::MaterialImporter::loadTexture ( castor::String name,
castor::String type,
castor::ByteArray data,
TextureConfiguration const & config,
PassTextureConfig const & passConfig,
Pass & pass,
castor::ImageLoaderConfig const & loadConfig ) const

Loads a texture and adds it to the given pass.

Parameters
[in]nameThe image name.
[in]typeThe image data type.
[in]dataThe image data.
[in]configThe texture configuration.
[in]passConfigThe texture unit configuration.
[in,out]passReceives the loaded image.
[in]loadConfigThe image loader configuration.

Member Data Documentation

◆ m_emissiveMult

float castor3d::MaterialImporter::m_emissiveMult { 1.0f }
protected

◆ m_file

ImporterFile* castor3d::MaterialImporter::m_file {}
protected

Referenced by getImporterFile().

◆ m_loadConfig

castor::ImageLoaderConfig castor3d::MaterialImporter::m_loadConfig { false, false, false }
protected

◆ m_parameters

Parameters castor3d::MaterialImporter::m_parameters
protected

◆ m_prefix

castor::String castor3d::MaterialImporter::m_prefix
protected

Referenced by getPrefix().

◆ m_textureRemaps

castor::Map< PassComponentTextureFlag, TextureConfiguration > castor3d::MaterialImporter::m_textureRemaps
protected

The documentation for this class was generated from the following file: