mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-18 23:32:45 +00:00
a19d58c5f6
R16G16_UNORM stores a red and a green channel (https://learn.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format), but craft-dds read it as gray and alpha, so a two-channel normal map opened with its green channel as transparency. It now reads as RGB with blue 0, as BC5 and G16R16 channel masks already do. encode16 still writes two-channel 16-bit pixels as R16G16; they read back as red and green. craft-image-codecs decoded every DDS at 8 bits. Texture::bits_per_channel gives the widest stored channel, and textures wider than 8 bits (R16, R16G16, R16G16B16A16, legacy FourCC 36, and channel masks with a 10- or 16-bit field) now open as U16 through decode16. craft-raster-codecs' decode_levels does the same for every mip level.