Added IsBGR utility function

This commit is contained in:
Chuck Walbourn
2022-05-07 15:10:55 -07:00
parent 55a7bb03c4
commit 178753de4a
4 changed files with 28 additions and 2 deletions

View File

@@ -1443,7 +1443,9 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
}
else if (_wcsicmp(ext, L".tga") == 0)
{
hr = LoadFromTGAFile(pConv->szSrc, TGA_FLAGS_NONE, &info, *image);
TGA_FLAGS tgaFlags = (IsBGR(format)) ? TGA_FLAGS_BGR : TGA_FLAGS_NONE;
hr = LoadFromTGAFile(pConv->szSrc, tgaFlags, &info, *image);
if (FAILED(hr))
{
wprintf(L" FAILED (%08X%ls)\n", static_cast<unsigned int>(hr), GetErrorDesc(hr));