Initial WIC image writing.
This commit is contained in:
parent
53a9f7bd15
commit
8c814ce89f
6 changed files with 72 additions and 3 deletions
|
@ -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);
|
||||
|
|
|
@ -33,6 +33,8 @@ public:
|
|||
void write(Image* image);
|
||||
|
||||
private:
|
||||
void writePlatform(Image* image);
|
||||
|
||||
void writeSignature();
|
||||
void writeHeader();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue