You.i Engine
YiAssetDecoderImage.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2017. All rights reserved.
2 #ifndef _YI_ASSET_DECODER_IMAGE_H_
3 #define _YI_ASSET_DECODER_IMAGE_H_
4 
5 #include "asset/YiAssetDecoder.h"
6 #include "utility/YiRtti.h"
7 
8 class CYIAssetTexture;
9 class CYIImageDecoder;
10 
22 {
23 public:
25  virtual ~CYIAssetDecoderImage();
26 
27  virtual bool SupportsParams(const CYIAssetLoadParams *pDecodeParams) override;
28 
29  virtual bool IsFormatSupported(const uint8_t *pData, uint32_t nDataSize) override;
30 
31  virtual std::shared_ptr<CYIAsset> DecodeAsset(const CYIString &path, const CYIAssetLoadParams *pDecodeParams) override;
32 
33  virtual std::shared_ptr<CYIAsset> DecodeAsset(const uint8_t *pData, uint32_t nDataSize, const CYIAssetLoadParams *pDecodeParams) override;
34 
35  virtual bool DecodeAsset(const std::shared_ptr<CYIAsset> &pAsset) override;
36 
37  virtual bool DecodeAsset(const std::shared_ptr<CYIAsset> &pAsset, const uint8_t *pData, uint32_t uDataSize) override;
38 
39 protected:
40  CYIAssetDecoderImage(const CYIRuntimeTypeInfo &assetType);
41 
42  void SetDecoder(std::unique_ptr<CYIImageDecoder> pDecoder);
43 
47  bool PopulateTexture(const std::shared_ptr<CYIAssetTexture> &pAsset, const CYIString &path, const CYIAssetLoadParams *pDecodeParams);
48  bool PopulateTexture(const std::shared_ptr<CYIAssetTexture> &pAsset, const uint8_t *pData, uint32_t nDataSize, const CYIAssetLoadParams *pDecodeParams);
49 
50 private:
51  std::unique_ptr<CYIImageDecoder> pImageDecoder;
52 
55 };
56 
59 #endif // _YI_ASSET_DECODER_IMAGE_H_
#define YI_DISALLOW_COPY_AND_ASSIGN(TypeName)
Delete the copy constructor and assignment operator (and consequently the move constructor as well) ...
Definition: YiPredef.h:114
Base class for all specialized raster image decoders.
Definition: YiAssetDecoderImage.h:21
virtual ~CYIAssetDecoderImage()
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:35
A texture asset representing an image which will be loaded into the GPU.
Definition: YiAssetTexture.h:23
virtual bool SupportsParams(const CYIAssetLoadParams *pDecodeParams) override
#define YI_TYPE_BASES(...)
Definition: YiRtti.h:350
virtual bool IsFormatSupported(const uint8_t *pData, uint32_t nDataSize) override
Base class for decoders which can accept specialized parameter objects.
Definition: YiAssetLoadParams.h:16
The abstract runtime representation of a C++ type.
Definition: YiRtti.h:48
Base class for all specialized decoders.
Definition: YiAssetDecoder.h:22
This file contains the classes and macros used to implement RTTI in You.i Engine. ...
Raster image decoder base class; all raster image decoders should sub-type this class.
Definition: YiImageDecoder.h:41
virtual std::shared_ptr< CYIAsset > DecodeAsset(const CYIString &path, const CYIAssetLoadParams *pDecodeParams) override
void SetDecoder(std::unique_ptr< CYIImageDecoder > pDecoder)
bool PopulateTexture(const std::shared_ptr< CYIAssetTexture > &pAsset, const CYIString &path, const CYIAssetLoadParams *pDecodeParams)