Fixed image decoding.

This commit is contained in:
Arron David Nelson 2024-02-19 21:12:03 -08:00
parent b4674bd94c
commit 27dfd430ad
3 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@ namespace ehs
public:
Glyph();
Glyph(Serializer<>& ser);
Glyph(Serializer<UInt_64>& ser);
Glyph(const Char_32 code);

View File

@ -330,7 +330,7 @@ namespace ehs
else if (colorType == 6)
channels = 4;
*out = Img(out->GetId(), bitDepth, channels, {width, height});
*out = Img(out->GetId(), bitDepth / 8, channels, {width, height});
UInt_8 compression = ihdrData->Read<UInt_8>();
if (compression)
@ -555,7 +555,7 @@ namespace ehs
UInt_64 size = width * channels * height;
*out = Img(out->GetId(), bitDepth, channels, {width, height});
*out = Img(out->GetId(), bitDepth / 8, channels, {width, height});
Byte prevPixel[4] = {0, 0, 0, 255};

View File

@ -7,7 +7,7 @@ namespace ehs
{
}
Glyph::Glyph(Serializer<>& ser)
Glyph::Glyph(Serializer<ehs::UInt_64>& ser)
: code(ser.Read<Char_32>()), pos(ser.ReadVec2<UInt_64>()), scale(ser.ReadVec2<UInt_64>()),
uv(ser.ReadRect<float>()), bearing(ser.ReadVec2<Int_64>()), advance(ser.ReadVec2<UInt_64>())
{