Some encode/decode practice.
This commit is contained in:
parent
8a41337e2d
commit
ff962a6b16
29 changed files with 727 additions and 305 deletions
|
@ -2,21 +2,11 @@
|
|||
|
||||
#include "Image.h"
|
||||
|
||||
#ifdef HAS_LIBPNG
|
||||
#include <png.h>
|
||||
#include "PngWriterLibPng.h"
|
||||
#else
|
||||
#include "PngWriterBasic.h"
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
|
||||
PngWriter::PngWriter()
|
||||
{
|
||||
#ifdef HAS_LIBPNG
|
||||
mImpl = std::make_unique<PngWriterLibPng>();
|
||||
#else
|
||||
mImpl = std::make_unique<PngWriterBasic>();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
std::unique_ptr<PngWriter> PngWriter::Create()
|
||||
|
@ -24,14 +14,14 @@ std::unique_ptr<PngWriter> PngWriter::Create()
|
|||
return std::make_unique<PngWriter>();
|
||||
}
|
||||
|
||||
void PngWriter::SetPath(const std::string& path)
|
||||
void PngWriter::setPath(const Path& path)
|
||||
{
|
||||
mImpl->setPath(path);
|
||||
mPath = path;
|
||||
}
|
||||
|
||||
void PngWriter::Write(const std::unique_ptr<Image<unsigned char> >& image) const
|
||||
void PngWriter::write(const std::unique_ptr<Image<unsigned char> >& image) const
|
||||
{
|
||||
mImpl->write(image);
|
||||
//mImpl->write(image);
|
||||
//auto fp = fopen(mPath.c_str(), "wb");
|
||||
|
||||
//auto png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue