Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
0CBH0 committed Nov 7, 2024
1 parent b4e2c08 commit 98f0c74
Show file tree
Hide file tree
Showing 34 changed files with 54 additions and 5 deletions.
16 changes: 16 additions & 0 deletions imageConv/Release/imageConv.Build.CppClean.log
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions imageConv/Release/imageConv.log
Original file line number Diff line number Diff line change
@@ -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
Binary file added imageConv/Release/imageConv.obj
Binary file not shown.
Binary file not shown.
Binary file added imageConv/Release/imageConv.tlog/CL.read.1.tlog
Binary file not shown.
Binary file added imageConv/Release/imageConv.tlog/CL.write.1.tlog
Binary file not shown.
2 changes: 2 additions & 0 deletions imageConv/Release/imageConv.tlog/imageConv.lastbuildstate
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.18362.0
Release|Win32|E:\work\MyProjects\imageConv\|
Binary file not shown.
Binary file not shown.
Binary file added imageConv/Release/imageConv.tlog/link.read.1.tlog
Binary file not shown.
Binary file added imageConv/Release/imageConv.tlog/link.write.1.tlog
Binary file not shown.
Binary file added imageConv/Release/optHandle.obj
Binary file not shown.
Binary file added imageConv/Release/vc141.pdb
Binary file not shown.
2 changes: 1 addition & 1 deletion imageConv/optHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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> <type> [options...] <--out> <type> [options...]\n\n");
printf("\n--------------------\nType & Options:\n--------------------\n");
Expand Down
Binary file added imgConvLib/Release/bmp.obj
Binary file not shown.
Binary file added imgConvLib/Release/image.obj
Binary file not shown.
12 changes: 12 additions & 0 deletions imgConvLib/Release/imgConvLib.Build.CppClean.log
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions imgConvLib/Release/imgConvLib.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
 image.cpp
imgConvLib.vcxproj -> E:\work\MyProjects\imageConv\Release\imgConvLib.lib
Binary file added imgConvLib/Release/imgConvLib.obj
Binary file not shown.
Binary file added imgConvLib/Release/imgConvLib.pdb
Binary file not shown.
Binary file not shown.
Binary file added imgConvLib/Release/imgConvLib.tlog/CL.read.1.tlog
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions imgConvLib/Release/imgConvLib.tlog/imgConvLib.lastbuildstate
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.18362.0
Release|Win32|E:\work\MyProjects\imageConv\|
Binary file added imgConvLib/Release/imgConvLib.tlog/rc.command.1.tlog
Binary file not shown.
1 change: 1 addition & 0 deletions imgConvLib/Release/imgConvLib.tlog/rc.read.1.tlog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
1 change: 1 addition & 0 deletions imgConvLib/Release/imgConvLib.tlog/rc.write.1.tlog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Binary file added imgConvLib/Release/kmeans.obj
Binary file not shown.
4 changes: 2 additions & 2 deletions imgConvLib/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion imgConvLib/imgConvLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
7 changes: 6 additions & 1 deletion imgConvLib/imgconvlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ int ImageToIP(const ImageData &image, vector<unsigned char> &index, vector<Color
{
vector<u8>(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
{
Expand All @@ -592,7 +593,11 @@ int IPToImage(ImageData &image, const vector<unsigned char> &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)
Expand Down

0 comments on commit 98f0c74

Please sign in to comment.