mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-09 22:26:13 +01:00
Portable PixMap reader/writers for texconv (#180)
This commit is contained in:
@@ -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/
|
||||
|
||||
Reference in New Issue
Block a user