2 #include "AssetEntity.h" 31 bool LoadFromMemory(
const unsigned char * data,
size_t dataLen,
bool bOwnData =
true);
34 bool LoadFromRawData(
const unsigned char * data,
size_t dataLen,
int width,
int height,
int bitsPerComponent,
bool preMulti =
false);
37 inline unsigned char * getData() {
return _data; }
38 inline size_t getDataLen() {
return _dataLen; }
39 inline DWORD getFileType() {
return _fileType; }
40 inline D3DFORMAT getRenderFormat() {
return _renderFormat; }
41 inline int getWidth() {
return _width; }
42 inline int getHeight() {
return _height; }
43 inline int getNumberOfMipmaps() {
return _numberOfMipmaps; }
44 inline bool hasPremultipliedAlpha() {
return false; }
55 bool SaveToFile(
const std::string &filename,
bool isToRGB =
true);
66 D3DFORMAT _renderFormat;
68 bool _hasPremultipliedAlpha;
69 std::string _filePath;
AssetType
each asset type has a unique asset type number
Definition: AssetEntity.h:82
different physics engine has different winding order.
Definition: EventBinding.h:32
bool LoadFromFile(const std::string &path)
Load the image from the specified path.
Definition: ImageEntity.cpp:40
bool SaveToFile(const std::string &filename, bool isToRGB=true)
Save Image data to the specified file, with specified format.
Definition: ImageEntity.cpp:99
bool m_bIsOwnData
whether we own the data buffer
Definition: ImageEntity.h:59
bool LoadFromRawData(const unsigned char *data, size_t dataLen, int width, int height, int bitsPerComponent, bool preMulti=false)
currently only support RGBA8 32bits data, such as from render target
Definition: ImageEntity.cpp:71
Unlike TextureEntity, ImageEntity is a device independent entity in memory.
Definition: ImageEntity.h:9
Base class for managed asset entity in ParaEngine.
Definition: AssetEntity.h:25
bool LoadFromMemory(const unsigned char *data, size_t dataLen, bool bOwnData=true)
Load image from stream buffer.
Definition: ImageEntity.cpp:45