public static DDSMetadata GetMetadataFromDDSMemory(byte[] buffer) { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { var md = TexconvNative.GetMetadataFromDDSMemory(buffer, DDSFLAGS.DDS_FLAGS_NONE); var bpp = TexconvNative.BitsPerPixel(md.format); return(new DDSMetadata(md, (uint)bpp, true)); } else { throw new NotImplementedException(); } }
public static DDSMetadata GetMetadataFromTGAFile(string path) { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { var md = TexconvNative.GetMetadataFromTGAFile(path, TGA_FLAGS.TGA_FLAGS_NONE); var bpp = TexconvNative.BitsPerPixel(md.format); return(new DDSMetadata(md, (uint)bpp, true)); } else { //using (var image = Image.Load(path)) //{ //} throw new NotImplementedException(); } }