Castor3D 0.16.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)
 Constructor.
 
C3D_API MaterialImporter (Engine &engine, ImporterFile *file)
 Constructor.
 
C3D_API bool import (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) const
 Loads an image from a file.
 
C3D_API castor::ImageRPtr loadImage (castor::String const &name, castor::String type, castor::ByteArray data) 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) const
 Loads a texture.
 
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 bool convertToNormalMap (castor::Path &path, castor3d::TextureConfiguration &config) const
 Converts given height image file to a normal+height image.
 
ImporterFile const * getImporterFile () const noexcept
 
- Public Member Functions inherited from castor::OwnedBy< Engine >
Engine * getOwner () const
 

Static Public Member Functions

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

Protected Attributes

ImporterFilem_file {}
 
Parameters m_parameters
 
castor::Map< PassComponentTextureFlag, TextureConfigurationm_textureRemaps
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ ~MaterialImporter()

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

◆ MaterialImporter() [1/2]

C3D_API castor3d::MaterialImporter::MaterialImporter ( Engine & engine)
explicit

Constructor.

Parameters
[in]engineThe engine.

◆ MaterialImporter() [2/2]

C3D_API castor3d::MaterialImporter::MaterialImporter ( Engine & engine,
ImporterFile * file )
explicit

Constructor.

Parameters
[in]engineThe engine.
[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.

◆ import() [1/2]

static C3D_API bool castor3d::MaterialImporter::import ( 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.

◆ import() [2/2]

C3D_API bool castor3d::MaterialImporter::import ( 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/3]

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/3]

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() [3/3]

C3D_API castor::ImageRPtr castor3d::MaterialImporter::loadImage ( castor::String const & 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/4]

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/4]

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() [3/4]

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() [4/4]

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.

Member Data Documentation

◆ m_file

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

Referenced by getImporterFile().

◆ m_parameters

Parameters castor3d::MaterialImporter::m_parameters
protected

◆ m_textureRemaps

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

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