Initial WIC image writing.

This commit is contained in:
jmsgrogan 2023-01-11 17:34:40 +00:00
parent 53a9f7bd15
commit 8c814ce89f
6 changed files with 72 additions and 3 deletions

View file

@ -15,6 +15,10 @@
#include "ByteUtils.h"
#ifdef _WIN32
#include "Win32WicImageWriter.h"
#endif
#include <iostream>
PngWriter::PngWriter()
@ -157,8 +161,20 @@ void PngWriter::writeDataChunks(const BufferBitStream& buffer)
}
}
void PngWriter::writePlatform(Image* image)
{
mPlatformWriter = std::make_unique<Win32WicImageWriter>();
mPlatformWriter->write(mPath, image, PlatformImageWriter::ImgFormat::PNG);
}
void PngWriter::write(Image* image)
{
if (image->getPlatformImage())
{
writePlatform(image);
return;
}
if (!mPath.empty())
{
mWorkingFile = std::make_unique<File>(mPath);

View file

@ -33,6 +33,8 @@ public:
void write(Image* image);
private:
void writePlatform(Image* image);
void writeSignature();
void writeHeader();