diff --git a/imageConv/Release/imageConv.Build.CppClean.log b/imageConv/Release/imageConv.Build.CppClean.log new file mode 100644 index 0000000..d1424e8 --- /dev/null +++ b/imageConv/Release/imageConv.Build.CppClean.log @@ -0,0 +1,16 @@ +e:\work\myprojects\imageconv\imageconv\release\vc141.pdb +e:\work\myprojects\imageconv\imageconv\release\opthandle.obj +e:\work\myprojects\imageconv\imageconv\release\imageconv.obj +e:\work\myprojects\imageconv\release\imageconv.lib +e:\work\myprojects\imageconv\release\imageconv.exp +e:\work\myprojects\imageconv\release\imageconv.ipdb +e:\work\myprojects\imageconv\release\imageconv.iobj +e:\work\myprojects\imageconv\release\imageconv.exe +e:\work\myprojects\imageconv\release\imageconv.pdb +e:\work\myprojects\imageconv\imageconv\release\imageconv.tlog\cl.command.1.tlog +e:\work\myprojects\imageconv\imageconv\release\imageconv.tlog\cl.read.1.tlog +e:\work\myprojects\imageconv\imageconv\release\imageconv.tlog\cl.write.1.tlog +e:\work\myprojects\imageconv\imageconv\release\imageconv.tlog\imageconv.write.1u.tlog +e:\work\myprojects\imageconv\imageconv\release\imageconv.tlog\link.command.1.tlog +e:\work\myprojects\imageconv\imageconv\release\imageconv.tlog\link.read.1.tlog +e:\work\myprojects\imageconv\imageconv\release\imageconv.tlog\link.write.1.tlog diff --git a/imageConv/Release/imageConv.log b/imageConv/Release/imageConv.log new file mode 100644 index 0000000..692f9ae --- /dev/null +++ b/imageConv/Release/imageConv.log @@ -0,0 +1,8 @@ + optHandle.cpp + 正在创建库 E:\work\MyProjects\imageConv\Release\imageConv.lib 和对象 E:\work\MyProjects\imageConv\Release\imageConv.exp + 正在生成代码 + 1 of 1660 functions (<0.1%) were compiled, the rest were copied from previous compilation. + 0 functions were new in current compilation + 3 functions had inline decision re-evaluated but remain unchanged + 已完成代码的生成 + imageConv.vcxproj -> E:\work\MyProjects\imageConv\Release\imageConv.exe diff --git a/imageConv/Release/imageConv.obj b/imageConv/Release/imageConv.obj new file mode 100644 index 0000000..245e219 Binary files /dev/null and b/imageConv/Release/imageConv.obj differ diff --git a/imageConv/Release/imageConv.tlog/CL.command.1.tlog b/imageConv/Release/imageConv.tlog/CL.command.1.tlog new file mode 100644 index 0000000..f4e1791 Binary files /dev/null and b/imageConv/Release/imageConv.tlog/CL.command.1.tlog differ diff --git a/imageConv/Release/imageConv.tlog/CL.read.1.tlog b/imageConv/Release/imageConv.tlog/CL.read.1.tlog new file mode 100644 index 0000000..1ec5051 Binary files /dev/null and b/imageConv/Release/imageConv.tlog/CL.read.1.tlog differ diff --git a/imageConv/Release/imageConv.tlog/CL.write.1.tlog b/imageConv/Release/imageConv.tlog/CL.write.1.tlog new file mode 100644 index 0000000..421f5cd Binary files /dev/null and b/imageConv/Release/imageConv.tlog/CL.write.1.tlog differ diff --git a/imageConv/Release/imageConv.tlog/imageConv.lastbuildstate b/imageConv/Release/imageConv.tlog/imageConv.lastbuildstate new file mode 100644 index 0000000..6343917 --- /dev/null +++ b/imageConv/Release/imageConv.tlog/imageConv.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.18362.0 +Release|Win32|E:\work\MyProjects\imageConv\| diff --git a/imageConv/Release/imageConv.tlog/imageConv.write.1u.tlog b/imageConv/Release/imageConv.tlog/imageConv.write.1u.tlog new file mode 100644 index 0000000..991256a Binary files /dev/null and b/imageConv/Release/imageConv.tlog/imageConv.write.1u.tlog differ diff --git a/imageConv/Release/imageConv.tlog/link.command.1.tlog b/imageConv/Release/imageConv.tlog/link.command.1.tlog new file mode 100644 index 0000000..203e707 Binary files /dev/null and b/imageConv/Release/imageConv.tlog/link.command.1.tlog differ diff --git a/imageConv/Release/imageConv.tlog/link.read.1.tlog b/imageConv/Release/imageConv.tlog/link.read.1.tlog new file mode 100644 index 0000000..9ec74da Binary files /dev/null and b/imageConv/Release/imageConv.tlog/link.read.1.tlog differ diff --git a/imageConv/Release/imageConv.tlog/link.write.1.tlog b/imageConv/Release/imageConv.tlog/link.write.1.tlog new file mode 100644 index 0000000..f922a21 Binary files /dev/null and b/imageConv/Release/imageConv.tlog/link.write.1.tlog differ diff --git a/imageConv/Release/optHandle.obj b/imageConv/Release/optHandle.obj new file mode 100644 index 0000000..5ef85bf Binary files /dev/null and b/imageConv/Release/optHandle.obj differ diff --git a/imageConv/Release/vc141.pdb b/imageConv/Release/vc141.pdb new file mode 100644 index 0000000..dd3bd80 Binary files /dev/null and b/imageConv/Release/vc141.pdb differ diff --git a/imageConv/optHandle.cpp b/imageConv/optHandle.cpp index 4891e17..467cbbf 100644 --- a/imageConv/optHandle.cpp +++ b/imageConv/optHandle.cpp @@ -27,7 +27,7 @@ OPT::~OPT() void OPT::help() { printf("====================\n"); - printf("imageConv\nv1.8 by CBH\n"); + printf("imageConv\nv1.9 by CBH\n"); printf("====================\n\n"); printf("Usage: imageConv <--in> [options...] <--out> [options...]\n\n"); printf("\n--------------------\nType & Options:\n--------------------\n"); diff --git a/imgConvLib/Release/bmp.obj b/imgConvLib/Release/bmp.obj new file mode 100644 index 0000000..0436b17 Binary files /dev/null and b/imgConvLib/Release/bmp.obj differ diff --git a/imgConvLib/Release/image.obj b/imgConvLib/Release/image.obj new file mode 100644 index 0000000..3fdee89 Binary files /dev/null and b/imgConvLib/Release/image.obj differ diff --git a/imgConvLib/Release/imgConvLib.Build.CppClean.log b/imgConvLib/Release/imgConvLib.Build.CppClean.log new file mode 100644 index 0000000..85c76c2 --- /dev/null +++ b/imgConvLib/Release/imgConvLib.Build.CppClean.log @@ -0,0 +1,12 @@ +e:\work\myprojects\imageconv\imgconvlib\release\imgconvlib.pdb +e:\work\myprojects\imageconv\imgconvlib\release\kmeans.obj +e:\work\myprojects\imageconv\imgconvlib\release\imgconvlib.obj +e:\work\myprojects\imageconv\imgconvlib\release\image.obj +e:\work\myprojects\imageconv\imgconvlib\release\bmp.obj +e:\work\myprojects\imageconv\release\imgconvlib.lib +e:\work\myprojects\imageconv\imgconvlib\release\imgconvlib.tlog\cl.command.1.tlog +e:\work\myprojects\imageconv\imgconvlib\release\imgconvlib.tlog\cl.read.1.tlog +e:\work\myprojects\imageconv\imgconvlib\release\imgconvlib.tlog\cl.write.1.tlog +e:\work\myprojects\imageconv\imgconvlib\release\imgconvlib.tlog\lib-link.read.1.tlog +e:\work\myprojects\imageconv\imgconvlib\release\imgconvlib.tlog\lib-link.write.1.tlog +e:\work\myprojects\imageconv\imgconvlib\release\imgconvlib.tlog\lib.command.1.tlog diff --git a/imgConvLib/Release/imgConvLib.log b/imgConvLib/Release/imgConvLib.log new file mode 100644 index 0000000..9caeb83 --- /dev/null +++ b/imgConvLib/Release/imgConvLib.log @@ -0,0 +1,2 @@ + image.cpp + imgConvLib.vcxproj -> E:\work\MyProjects\imageConv\Release\imgConvLib.lib diff --git a/imgConvLib/Release/imgConvLib.obj b/imgConvLib/Release/imgConvLib.obj new file mode 100644 index 0000000..93356b0 Binary files /dev/null and b/imgConvLib/Release/imgConvLib.obj differ diff --git a/imgConvLib/Release/imgConvLib.pdb b/imgConvLib/Release/imgConvLib.pdb new file mode 100644 index 0000000..06e1f6f Binary files /dev/null and b/imgConvLib/Release/imgConvLib.pdb differ diff --git a/imgConvLib/Release/imgConvLib.tlog/CL.command.1.tlog b/imgConvLib/Release/imgConvLib.tlog/CL.command.1.tlog new file mode 100644 index 0000000..063387f Binary files /dev/null and b/imgConvLib/Release/imgConvLib.tlog/CL.command.1.tlog differ diff --git a/imgConvLib/Release/imgConvLib.tlog/CL.read.1.tlog b/imgConvLib/Release/imgConvLib.tlog/CL.read.1.tlog new file mode 100644 index 0000000..548e7b0 Binary files /dev/null and b/imgConvLib/Release/imgConvLib.tlog/CL.read.1.tlog differ diff --git a/imgConvLib/Release/imgConvLib.tlog/CL.write.1.tlog b/imgConvLib/Release/imgConvLib.tlog/CL.write.1.tlog new file mode 100644 index 0000000..6e879fe Binary files /dev/null and b/imgConvLib/Release/imgConvLib.tlog/CL.write.1.tlog differ diff --git a/imgConvLib/Release/imgConvLib.tlog/Lib-link-cvtres.read.1.tlog b/imgConvLib/Release/imgConvLib.tlog/Lib-link-cvtres.read.1.tlog new file mode 100644 index 0000000..2eb5798 Binary files /dev/null and b/imgConvLib/Release/imgConvLib.tlog/Lib-link-cvtres.read.1.tlog differ diff --git a/imgConvLib/Release/imgConvLib.tlog/Lib-link-cvtres.write.1.tlog b/imgConvLib/Release/imgConvLib.tlog/Lib-link-cvtres.write.1.tlog new file mode 100644 index 0000000..b2401bc Binary files /dev/null and b/imgConvLib/Release/imgConvLib.tlog/Lib-link-cvtres.write.1.tlog differ diff --git a/imgConvLib/Release/imgConvLib.tlog/Lib.command.1.tlog b/imgConvLib/Release/imgConvLib.tlog/Lib.command.1.tlog new file mode 100644 index 0000000..309c448 Binary files /dev/null and b/imgConvLib/Release/imgConvLib.tlog/Lib.command.1.tlog differ diff --git a/imgConvLib/Release/imgConvLib.tlog/imgConvLib.lastbuildstate b/imgConvLib/Release/imgConvLib.tlog/imgConvLib.lastbuildstate new file mode 100644 index 0000000..6343917 --- /dev/null +++ b/imgConvLib/Release/imgConvLib.tlog/imgConvLib.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.18362.0 +Release|Win32|E:\work\MyProjects\imageConv\| diff --git a/imgConvLib/Release/imgConvLib.tlog/rc.command.1.tlog b/imgConvLib/Release/imgConvLib.tlog/rc.command.1.tlog new file mode 100644 index 0000000..65f06ff Binary files /dev/null and b/imgConvLib/Release/imgConvLib.tlog/rc.command.1.tlog differ diff --git a/imgConvLib/Release/imgConvLib.tlog/rc.read.1.tlog b/imgConvLib/Release/imgConvLib.tlog/rc.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/imgConvLib/Release/imgConvLib.tlog/rc.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/imgConvLib/Release/imgConvLib.tlog/rc.write.1.tlog b/imgConvLib/Release/imgConvLib.tlog/rc.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/imgConvLib/Release/imgConvLib.tlog/rc.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/imgConvLib/Release/kmeans.obj b/imgConvLib/Release/kmeans.obj new file mode 100644 index 0000000..95142d8 Binary files /dev/null and b/imgConvLib/Release/kmeans.obj differ diff --git a/imgConvLib/image.cpp b/imgConvLib/image.cpp index 3832b77..94146ea 100644 --- a/imgConvLib/image.cpp +++ b/imgConvLib/image.cpp @@ -145,14 +145,14 @@ void ImageData::resize(unsigned int w, unsigned int h) bool ImageData::operator == (const ImageData &src) const { if (src.width != width || src.height != height) return false; - for (unsigned int i = 0; i < size; i++) if (src.get(i, i) != get(i)) return false; + for (unsigned int i = 0; i < size; i++) if (src.get(i) != get(i)) return false; return true; } bool ImageData::operator != (const ImageData &src) const { if (src.width != width || src.height != height) return true; - for (unsigned int i = 0; i < size; i++) if (src.get(i, i) != get(i)) return true; + for (unsigned int i = 0; i < size; i++) if (src.get(i) != get(i)) return true; return false; } diff --git a/imgConvLib/imgConvLib.h b/imgConvLib/imgConvLib.h index 76b982a..02b85e7 100644 --- a/imgConvLib/imgConvLib.h +++ b/imgConvLib/imgConvLib.h @@ -67,7 +67,7 @@ class ImageData ImageData flip(bool h, bool v); ImageData flip(unsigned int hvMode); ImageData clip(unsigned int x, unsigned int y, unsigned int w, unsigned int h); - int paste(ImageData &src, unsigned int x, unsigned int y, bool cover = 1); + int paste(ImageData &src, unsigned int x, unsigned int y, bool cover = true); Color *ptr(); void clone(ImageData &dst) const; diff --git a/imgConvLib/imgconvlib.cpp b/imgConvLib/imgconvlib.cpp index f7027eb..fbe5ddc 100644 --- a/imgConvLib/imgconvlib.cpp +++ b/imgConvLib/imgconvlib.cpp @@ -571,6 +571,7 @@ int ImageToIP(const ImageData &image, vector &index, vector(imgOri.size / 2).swap(index); for (size_t i = 0; i < index.size(); i++) index[i] = (tmpData[i * 2 + 1] & 0xF) << 4 | (tmpData[i * 2] & 0xF); + if (imgOri.size % 2 != 0) index.push_back(tmpData[imgOri.size - 1] & 0xF); } else { @@ -592,7 +593,11 @@ int IPToImage(ImageData &image, const vector &index, const vector { // palMode: 0: 4bit, 1: 8bit unsigned int size = width * height; - if (palMode == 0) size /= 2; + if (palMode == 0) + { + if (size % 2 != 0) size++; + size /= 2; + } if (index.size() == 0 || size != index.size() || palMode > 1) return -1; image.initial(width, height, { 0,0,0,0 }, imgMode); if (palMode == 0)