- changed return value of CreatePalettedPixels.

The new struct will allpw return of static pixel data without reallocation and copying.
This commit is contained in:
Christoph Oelckers 2023-01-07 17:55:55 +01:00
commit 1a0aa95ff4
24 changed files with 103 additions and 84 deletions

View file

@ -109,7 +109,7 @@ class FHexFontChar : public FImageSource
public:
FHexFontChar(uint8_t *sourcedata, int swidth, int width, int height);
TArray<uint8_t> CreatePalettedPixels(int conversion) override;
PalettedPixels CreatePalettedPixels(int conversion) override;
int CopyPixels(FBitmap* bmp, int conversion);
protected:
@ -144,10 +144,10 @@ FHexFontChar::FHexFontChar (uint8_t *sourcedata, int swidth, int width, int heig
//
//==========================================================================
TArray<uint8_t> FHexFontChar::CreatePalettedPixels(int)
PalettedPixels FHexFontChar::CreatePalettedPixels(int)
{
int destSize = Width * Height;
TArray<uint8_t> Pixels(destSize, true);
PalettedPixels Pixels(destSize);
uint8_t *dest_p = Pixels.Data();
const uint8_t *src_p = SourceData;
@ -190,7 +190,7 @@ class FHexFontChar2 : public FHexFontChar
public:
FHexFontChar2(uint8_t *sourcedata, int swidth, int width, int height);
TArray<uint8_t> CreatePalettedPixels(int conversion) override;
PalettedPixels CreatePalettedPixels(int conversion) override;
int CopyPixels(FBitmap* bmp, int conversion);
};
@ -216,10 +216,10 @@ FHexFontChar2::FHexFontChar2(uint8_t *sourcedata, int swidth, int width, int hei
//
//==========================================================================
TArray<uint8_t> FHexFontChar2::CreatePalettedPixels(int)
PalettedPixels FHexFontChar2::CreatePalettedPixels(int)
{
int destSize = Width * Height;
TArray<uint8_t> Pixels(destSize, true);
PalettedPixels Pixels(destSize);
uint8_t *dest_p = Pixels.Data();
assert(SourceData);