mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
51 lines
993 B
C
51 lines
993 B
C
![]() |
#pragma once
|
||
|
|
||
|
#include "../Common.h"
|
||
|
|
||
|
NS_BF_BEGIN;
|
||
|
|
||
|
enum
|
||
|
{
|
||
|
HWBITS_UNKNOWN,
|
||
|
HWBITS_PVRTC_2BPPV1,
|
||
|
HWBITS_PVRTC_4BPPV1,
|
||
|
HWBITS_PVRTC_2X4BPPV1
|
||
|
};
|
||
|
|
||
|
class ImageData
|
||
|
{
|
||
|
public:
|
||
|
int mX;
|
||
|
int mY;
|
||
|
int mWidth;
|
||
|
int mHeight;
|
||
|
void* mHWBits;
|
||
|
int mHWBitsLength;
|
||
|
int mHWBitsType;
|
||
|
uint32* mBits;
|
||
|
uint8* mSrcData;
|
||
|
int mSrcDataLen;
|
||
|
bool mKeepSrcDataValid;
|
||
|
bool mOwnsSrcData;
|
||
|
|
||
|
bool mWantsAlphaPremultiplied;
|
||
|
bool mAlphaPremultiplied;
|
||
|
bool mIsAdditive;
|
||
|
|
||
|
public:
|
||
|
ImageData();
|
||
|
virtual ~ImageData();
|
||
|
|
||
|
void SwapRAndB();
|
||
|
void CreateNew(int x, int y, int width, int height, bool clear = true);
|
||
|
void CreateNew(int width, int height, bool clear = true);
|
||
|
void Fill(uint32 color);
|
||
|
virtual ImageData* Duplicate();
|
||
|
void SetSrcData(uint8* data, int dataLen);
|
||
|
virtual bool LoadFromFile(const StringImpl& path);
|
||
|
virtual bool ReadData() { return false; }
|
||
|
virtual void PremultiplyAlpha();
|
||
|
};
|
||
|
|
||
|
NS_BF_END;
|