You.i Engine
CYIAssetDecoderImage Class Reference

Detailed Description

Base class for all specialized raster image decoders.

Programmers must extend this class for any specific raster image asset file formats.

#include <asset/YiAssetDecoderImage.h>

Inheritance diagram for CYIAssetDecoderImage:

Public Member Functions

 CYIAssetDecoderImage ()
 
virtual ~CYIAssetDecoderImage ()
 
virtual bool SupportsParams (const CYIAssetLoadParams *pDecodeParams) override
 
virtual bool IsFormatSupported (const uint8_t *pData, uint32_t nDataSize) override
 
virtual std::shared_ptr< CYIAssetDecodeAsset (const CYIString &path, const CYIAssetLoadParams *pDecodeParams) override
 
virtual std::shared_ptr< CYIAssetDecodeAsset (const uint8_t *pData, uint32_t nDataSize, const CYIAssetLoadParams *pDecodeParams) override
 
virtual bool DecodeAsset (const std::shared_ptr< CYIAsset > &pAsset) override
 
virtual bool DecodeAsset (const std::shared_ptr< CYIAsset > &pAsset, const uint8_t *pData, uint32_t uDataSize) override
 
- Public Member Functions inherited from CYIAssetDecoder
 CYIAssetDecoder (const CYIRuntimeTypeInfo &assetType)
 
virtual ~CYIAssetDecoder ()
 
virtual bool IsExtensionSupported (const CYIString &extension)
 
virtual bool SupportsType (const CYIRuntimeTypeInfo &assetType)
 
CYIString GetExtension () const
 
const std::vector< CYIString > & GetExtensions () const
 

Protected Member Functions

 CYIAssetDecoderImage (const CYIRuntimeTypeInfo &assetType)
 
void SetDecoder (std::unique_ptr< CYIImageDecoder > pDecoder)
 
bool PopulateTexture (const std::shared_ptr< CYIAssetTexture > &pAsset, const CYIString &path, const CYIAssetLoadParams *pDecodeParams)
 
bool PopulateTexture (const std::shared_ptr< CYIAssetTexture > &pAsset, const uint8_t *pData, uint32_t nDataSize, const CYIAssetLoadParams *pDecodeParams)
 

Additional Inherited Members

- Protected Attributes inherited from CYIAssetDecoder
std::vector< CYIStringm_SupportedExtensions
 
const CYIRuntimeTypeInfom_AssetType
 

Constructor & Destructor Documentation

CYIAssetDecoderImage::CYIAssetDecoderImage ( )
virtual CYIAssetDecoderImage::~CYIAssetDecoderImage ( )
virtual
CYIAssetDecoderImage::CYIAssetDecoderImage ( const CYIRuntimeTypeInfo assetType)
protected

Member Function Documentation

virtual std::shared_ptr<CYIAsset> CYIAssetDecoderImage::DecodeAsset ( const CYIString path,
const CYIAssetLoadParams pDecodeParams 
)
overridevirtual

Decode an asset at the specified path using the optional decoding parameters pDecodeParams. The pDecodeParams can be nullptr.

Implements CYIAssetDecoder.

virtual std::shared_ptr<CYIAsset> CYIAssetDecoderImage::DecodeAsset ( const uint8_t *  pData,
uint32_t  nDataSize,
const CYIAssetLoadParams pDecodeParams 
)
overridevirtual

Decode an asset using pre-loaded file data pData, nDataSize, and the optional decoding parameters pDecodeParams. The pDecodeParams can be nullptr.

Implements CYIAssetDecoder.

virtual bool CYIAssetDecoderImage::DecodeAsset ( const std::shared_ptr< CYIAsset > &  pAsset)
overridevirtual

Decode an asset using an existing asset instance. The path must be set through CYIAsset::SetPath, and the optional decoding parameters may be set through CYIAsset::SetLoadParameters. Returns true if the decoding was successful, false otherwise.

See also
CYIAsset::SetPath(const CYIString &path)
CYIAsset::SetLoadParameters(CYIAssetLoadParams *pParams)

Implements CYIAssetDecoder.

virtual bool CYIAssetDecoderImage::DecodeAsset ( const std::shared_ptr< CYIAsset > &  pAsset,
const uint8_t *  pData,
uint32_t  uDataSize 
)
overridevirtual

Decode an asset using an existing asset instance, and pre-loaded file data pData and uDataSize. The optional decoding parameters may be set through CYIAsset::SetLoadParameters. Returns true if the decoding was successful, false otherwise.

See also
CYIAsset::SetLoadParameters(CYIAssetLoadParams *pParams)

Implements CYIAssetDecoder.

virtual bool CYIAssetDecoderImage::IsFormatSupported ( const uint8_t *  pData,
uint32_t  nDataSize 
)
overridevirtual

Returns true if the file format is supported. The file contents are supplied through pData and the size of the buffer must be given through nDataSize.

Implements CYIAssetDecoder.

bool CYIAssetDecoderImage::PopulateTexture ( const std::shared_ptr< CYIAssetTexture > &  pAsset,
const CYIString path,
const CYIAssetLoadParams pDecodeParams 
)
protected

These helper functions contain code that are shared between all three DecodeAsset APIs

bool CYIAssetDecoderImage::PopulateTexture ( const std::shared_ptr< CYIAssetTexture > &  pAsset,
const uint8_t *  pData,
uint32_t  nDataSize,
const CYIAssetLoadParams pDecodeParams 
)
protected
void CYIAssetDecoderImage::SetDecoder ( std::unique_ptr< CYIImageDecoder pDecoder)
protected
virtual bool CYIAssetDecoderImage::SupportsParams ( const CYIAssetLoadParams pDecodeParams)
overridevirtual

Returns true if the decoder supports a specialized parameter type.

Reimplemented from CYIAssetDecoder.


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