You.i Engine
CYIAssetDecoderTemplate Class Reference

Detailed Description

Asset decoder for view templates from After Effects; these typically have a ".layout" file extension.

Note
When a template is decoded from memory, its associated timeline is not decoded. The associated timeline must be decoded separately and be assigned to the view template using the CYIViewTemplate::SetTimelineSource function.
Template files exported prior to You.i Engine 4.5.0 (AE filter version 2.10) lack magic numbers and cannot be decoded from memory when using the CYIAssetLoader class. They can, however, be decoded from memory when using this decoder directly.
See also
CYIAssetDecoderTimelineSource
CYIAssetLoader

#include <asset/YiAssetDecoderTemplate.h>

Inheritance diagram for CYIAssetDecoderTemplate:

Public Member Functions

 CYIAssetDecoderTemplate ()
 
virtual ~CYIAssetDecoderTemplate ()
 
virtual bool SupportsParams (const CYIAssetLoadParams *pDecodeParams) override
 
virtual std::shared_ptr< CYIAssetDecodeAsset (const CYIString &path, const CYIAssetLoadParams *pDecodeParams, CYITaskBase *pTask=nullptr) override
 
virtual std::shared_ptr< CYIAssetDecodeAsset (const uint8_t *pData, size_t dataSize, const CYIAssetLoadParams *pDecodeParams, CYITaskBase *pTask=nullptr) override
 
virtual bool DecodeAsset (const std::shared_ptr< CYIAsset > &pAsset, CYITaskBase *pTask=nullptr) override
 
virtual bool IsFormatSupported (const uint8_t *pData, size_t dataSize) override
 
virtual bool DecodeAsset (const std::shared_ptr< CYIAsset > &pAsset, const uint8_t *pData, size_t dataSize, CYITaskBase *pTask=nullptr) 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
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ CYIAssetDecoderTemplate()

CYIAssetDecoderTemplate::CYIAssetDecoderTemplate ( )

◆ ~CYIAssetDecoderTemplate()

virtual CYIAssetDecoderTemplate::~CYIAssetDecoderTemplate ( )
virtual

Member Function Documentation

◆ DecodeAsset() [1/4]

virtual std::shared_ptr<CYIAsset> CYIAssetDecoderTemplate::DecodeAsset ( const CYIString path,
const CYIAssetLoadParams pDecodeParams,
CYITaskBase pTask = nullptr 
)
overridevirtual

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

Implements CYIAssetDecoder.

◆ DecodeAsset() [2/4]

virtual std::shared_ptr<CYIAsset> CYIAssetDecoderTemplate::DecodeAsset ( const uint8_t *  pData,
size_t  dataSize,
const CYIAssetLoadParams pDecodeParams,
CYITaskBase pTask = nullptr 
)
overridevirtual

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

Implements CYIAssetDecoder.

◆ DecodeAsset() [3/4]

virtual bool CYIAssetDecoderTemplate::DecodeAsset ( const std::shared_ptr< CYIAsset > &  pAsset,
CYITaskBase pTask = nullptr 
)
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 &, CYIAsset::PathType)
CYIAsset::SetLoadParameters(std::unique_ptr<CYIAssetLoadParams>)

Implements CYIAssetDecoder.

◆ DecodeAsset() [4/4]

virtual bool CYIAssetDecoderTemplate::DecodeAsset ( const std::shared_ptr< CYIAsset > &  pAsset,
const uint8_t *  pData,
size_t  dataSize,
CYITaskBase pTask = nullptr 
)
overridevirtual

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

See also
CYIAsset::SetLoadParameters(std::unique_ptr<CYIAssetLoadParams>)

Implements CYIAssetDecoder.

◆ IsFormatSupported()

virtual bool CYIAssetDecoderTemplate::IsFormatSupported ( const uint8_t *  pData,
size_t  dataSize 
)
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 dataSize.

Implements CYIAssetDecoder.

◆ SupportsParams()

virtual bool CYIAssetDecoderTemplate::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: