Portable PixMap reader/writers for texconv (#180)

This commit is contained in:
Chuck Walbourn
2020-06-04 20:07:21 -07:00
committed by GitHub
parent 09fc5fe957
commit 0539287324
10 changed files with 1232 additions and 497 deletions

View File

@@ -296,9 +296,9 @@ const SValue g_pExtFileTypes[] =
namespace
{
inline HANDLE safe_handle(HANDLE h) { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
inline HANDLE safe_handle(HANDLE h) noexcept { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
struct find_closer { void operator()(HANDLE h) { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } };
struct find_closer { void operator()(HANDLE h) noexcept { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } };
using ScopedFindHandle = std::unique_ptr<void, find_closer>;
@@ -543,6 +543,7 @@ namespace
PrintList(13, g_pFilters);
}
HRESULT SaveImageFile(const Image& img, DWORD fileType, const wchar_t* szOutputFile)
{
switch (fileType)
@@ -566,6 +567,7 @@ namespace
}
}
enum
{
DM_UNDEFINED = 0,
@@ -574,6 +576,7 @@ namespace
DM_PREVIOUS = 3
};
void FillRectangle(const Image& img, const RECT& destRect, uint32_t color)
{
RECT clipped =
@@ -598,6 +601,7 @@ namespace
}
}
void BlendRectangle(const Image& composed, const Image& raw, const RECT& destRect)
{
using namespace DirectX::PackedVector;
@@ -636,6 +640,7 @@ namespace
}
}
HRESULT LoadAnimatedGif(const wchar_t* szFile, std::vector<std::unique_ptr<ScratchImage>>& loadedImages, bool usebgcolor)
{
// https://code.msdn.microsoft.com/windowsapps/Windows-Imaging-Component-65abbc6a/