From d348cc9f377f3ddd875be78cffcd4c331f2f9d78 Mon Sep 17 00:00:00 2001 From: lltcggie Date: Thu, 4 Feb 2016 14:14:40 +0900 Subject: [PATCH] =?UTF-8?q?Waifu2x::WriteMat()=E3=82=92static=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/waifu2x.cpp | 4 ++-- common/waifu2x.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/waifu2x.cpp b/common/waifu2x.cpp index 9fc01f1..e8d7e3d 100644 --- a/common/waifu2x.cpp +++ b/common/waifu2x.cpp @@ -1300,7 +1300,7 @@ static void Waifu2x_stbi_write_func(void *context, void *data, int size) osp->write((const char *)data, size); } -Waifu2x::eWaifu2xError Waifu2x::WriteMat(const cv::Mat &im, const boost::filesystem::path &output_file) +Waifu2x::eWaifu2xError Waifu2x::WriteMat(const cv::Mat &im, const boost::filesystem::path &output_file, const boost::optional &output_quality) { const boost::filesystem::path ip(output_file); const std::string ext = ip.extension().string(); @@ -1715,7 +1715,7 @@ Waifu2x::eWaifu2xError Waifu2x::waifu2x(const boost::filesystem::path &input_fil cv::merge(planes, write_iamge); } - ret = WriteMat(write_iamge, output_file); + ret = WriteMat(write_iamge, output_file, output_quality); if (ret != eWaifu2xError_OK) return ret; diff --git a/common/waifu2x.h b/common/waifu2x.h index aa95e19..5fc292c 100644 --- a/common/waifu2x.h +++ b/common/waifu2x.h @@ -126,7 +126,7 @@ private: , const boost::filesystem::path &modelbin_path, const boost::filesystem::path &caffemodel_path, const std::string &process); eWaifu2xError SetParameter(caffe::NetParameter ¶m, const std::string &process) const; eWaifu2xError ReconstructImage(boost::shared_ptr> net, cv::Mat &im); - eWaifu2xError WriteMat(const cv::Mat &im, const boost::filesystem::path &output_file); + static eWaifu2xError WriteMat(const cv::Mat &im, const boost::filesystem::path &output_file, const boost::optional &output_quality); eWaifu2xError BeforeReconstructFloatMatProcess(const cv::Mat &in, cv::Mat &out, bool &convertBGRflag); eWaifu2xError ReconstructFloatMat(const bool isReconstructNoise, const bool isReconstructScale, const waifu2xCancelFunc cancel_func, const cv::Mat &in, cv::Mat &out);