commits
tags
#include "wj_qrtexture.h"
#include "bitmap.h"
#include <cstring>
void WJQRTexture::SetImage(int width, int height, const uint8_t *rgba)
{
FTexture::SetSize(width, height);
Image.Resize(width * height * 4);
memcpy(Image.Data(), rgba, Image.Size());
}
FBitmap WJQRTexture::GetBgraBitmap(const PalEntry *remap, int *trans)
{
// R == G == B for every module (black or white), so the BGRA vs RGBA
// byte order FBitmap expects doesn't actually matter here.
return FBitmap(Image.Data(), Width * 4, Width, Height);
}