Raster image decoder base class; all raster image decoders should sub-type this class.
#include <asset/YiImageDecoder.h>

Public Member Functions | |
| CYIImageDecoder (bool bIsAnimationSupported, bool bIsPreallocatedBitmapSupported) | |
| virtual | ~CYIImageDecoder () |
| bool | IsAnimationSupported () |
| bool | IsPreAllocatedBitmapSupported () |
| virtual bool | IsFormatSupported (const uint8_t *pData, uint32_t nDataSize) |
| std::unique_ptr< CYIBitmap > | Decode (const uint8_t *pData, uint32_t nDataSize, YI_DECODER_BITMAP_PARAMS *pParams=nullptr) |
| std::unique_ptr< CYIBitmap > | Decode (const CYIString &path, YI_DECODER_BITMAP_PARAMS *pParams=nullptr) |
| virtual bool | GetImageDimensions (const CYIString &path, uint32_t *pnWidth, uint32_t *pnHeight) |
Protected Member Functions | |
| virtual std::unique_ptr< CYIBitmap > | DecodeImpl (const uint8_t *pData, uint32_t nDataSize, YI_DECODER_BITMAP_PARAMS *pParams)=0 |
| virtual std::unique_ptr< CYIBitmap > | DecodeImpl (const CYIString &path, YI_DECODER_BITMAP_PARAMS *pParams)=0 |
| void | SetMagicByteInformation (uint32_t uMagicByteOffset, const std::vector< const char * > &possibleSequences) |
Friends | |
| class | CYIAssetDecoderImage |
| CYIImageDecoder::CYIImageDecoder | ( | bool | bIsAnimationSupported, |
| bool | bIsPreallocatedBitmapSupported | ||
| ) |
|
virtual |
| std::unique_ptr<CYIBitmap> CYIImageDecoder::Decode | ( | const uint8_t * | pData, |
| uint32_t | nDataSize, | ||
| YI_DECODER_BITMAP_PARAMS * | pParams = nullptr |
||
| ) |
Decode an asset using pre-loaded file data pData and the nDataSize; additional parameters can be supplied to the decoder via the pParams object.
| std::unique_ptr<CYIBitmap> CYIImageDecoder::Decode | ( | const CYIString & | path, |
| YI_DECODER_BITMAP_PARAMS * | pParams = nullptr |
||
| ) |
Decode an asset at the specified path; additional parameters can be supplied to the decoder via the pParams object.
|
protectedpure virtual |
Decode an asset using pre-loaded file data pData and the nDataSize.
Implemented in CYIImageDecoderTGA, CYIImageDecoderWEBP, CYIImageDecoderJPG, CYIImageDecoderPNG, CYIImageDecoderSTU, and CYIImageDecoderGIF.
|
protectedpure virtual |
Decode an asset at the specified path.
Implemented in CYIImageDecoderTGA, CYIImageDecoderWEBP, CYIImageDecoderPNG, CYIImageDecoderJPG, CYIImageDecoderSTU, and CYIImageDecoderGIF.
|
virtual |
Returns true if the image information can be loaded via the asset package path; the width and height of the asset will be returned through the pnWidth and pnHeight parameters.
Reimplemented in CYIImageDecoderPNG, CYIImageDecoderJPG, CYIImageDecoderSTU, CYIImageDecoderTGA, CYIImageDecoderGIF, and CYIImageDecoderWEBP.
| bool CYIImageDecoder::IsAnimationSupported | ( | ) |
Returns true if image frame animation is supported by the image decoder.
|
virtual |
Partially decodes the file content referred to by pData and returns true if the decoder can decode it.
Reimplemented in CYIImageDecoderTGA, and CYIImageDecoderWEBP.
| bool CYIImageDecoder::IsPreAllocatedBitmapSupported | ( | ) |
Returns true if the decoder support using a pre-allocated bitmap.
|
protected |
Subclasses can set magic byte information (if any) in their consutrctors, and this will be used by the default implementation of IsFormatSupported.
|
friend |