1
0

Compare commits

..

No commits in common. "master" and "v1.1.4.516" have entirely different histories.

43 changed files with 373 additions and 21 deletions

2
.gitignore vendored
View File

@ -1,6 +1,4 @@
/upload.gradle
/gradle.properties
/.idea
/.gradle
/build
/cer

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Binary file not shown.

View File

@ -0,0 +1,2 @@
#Sun May 15 20:49:35 CST 2022
gradle.version=7.4

Binary file not shown.

BIN
.gradle/file-system.probe Normal file

Binary file not shown.

View File

8
.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

1
.idea/.name generated Normal file
View File

@ -0,0 +1 @@
ImageTracer

9
.idea/ImageTracerJava.iml generated Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/compiler.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.8" />
</component>
</project>

6
.idea/copyright/2_0.xml generated Normal file
View File

@ -0,0 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="/*&#10; * Copyright 2022 田梓萱, xcl@xuegao-tzx.top&#10; *&#10; * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);&#10; * you may not use this file except in compliance with the License.&#10; * You may obtain a copy of the License at&#10; *&#10; * http://www.apache.org/licenses/LICENSE-2.0&#10; *&#10; * Unless required by applicable law or agreed to in writing, software&#10; * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; * See the License for the specific language governing permissions and&#10; * limitations under the License.&#10; */" />
<option name="myName" value="开源2.0" />
</copyright>
</component>

19
.idea/gradle.xml generated Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="delegatedBuild" value="true" />
<option name="testRunner" value="PLATFORM" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

141
.idea/intellij-javadocs-4.0.1.xml generated Normal file
View File

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaDocConfiguration">
<GENERAL>
<MODE>UPDATE</MODE>
<OVERRIDDEN_METHODS>false</OVERRIDDEN_METHODS>
<SPLITTED_CLASS_NAME>true</SPLITTED_CLASS_NAME>
<LEVELS>
<LEVEL>METHOD</LEVEL>
<LEVEL>FIELD</LEVEL>
<LEVEL>TYPE</LEVEL>
</LEVELS>
<VISIBILITIES>
<VISIBILITY>PROTECTED</VISIBILITY>
<VISIBILITY>PUBLIC</VISIBILITY>
<VISIBILITY>DEFAULT</VISIBILITY>
</VISIBILITIES>
</GENERAL>
<TEMPLATES>
<CLASSES>
<CLASS>
<KEY>^.*(public|protected|private)*.+interface\s+\w+.*</KEY>
<VALUE>/**\n
* The interface ${name}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;&lt;#list element.typeParameters as typeParameter&gt; * @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt; */</VALUE>
</CLASS>
<CLASS>
<KEY>^.*(public|protected|private)*.+enum\s+\w+.*</KEY>
<VALUE>/**\n
* The enum ${name}.\n
*/</VALUE>
</CLASS>
<CLASS>
<KEY>^.*(public|protected|private)*.+class\s+\w+.*</KEY>
<VALUE>/**\n
* The type ${name}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;&lt;#list element.typeParameters as typeParameter&gt; * @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt; */</VALUE>
</CLASS>
<CLASS>
<KEY>.+</KEY>
<VALUE>/**\n
* The type ${name}.\n
*/</VALUE>
</CLASS>
</CLASSES>
<CONSTRUCTORS>
<CONSTRUCTOR>
<KEY>.+</KEY>
<VALUE>/**\n
* Instantiates a new ${name}.\n
&lt;#if element.parameterList.parameters?has_content&gt; *\n
&lt;/#if&gt;&lt;#list element.parameterList.parameters as parameter&gt; * @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;&lt;#if element.throwsList.referenceElements?has_content&gt; *\n
&lt;/#if&gt;&lt;#list element.throwsList.referenceElements as exception&gt; * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt; */</VALUE>
</CONSTRUCTOR>
</CONSTRUCTORS>
<METHODS>
<METHOD>
<KEY>^.*(public|protected|private)*\s*.*(\w(\s*&lt;.+&gt;)*)+\s+get\w+\s*\(.*\).+</KEY>
<VALUE>/**\n
* Gets ${partName}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;&lt;#list element.typeParameters as typeParameter&gt; * @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;&lt;#if element.parameterList.parameters?has_content&gt; *\n
&lt;/#if&gt;&lt;#list element.parameterList.parameters as parameter&gt; * @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;&lt;#if isNotVoid&gt; *\n
* @return the ${partName}\n
&lt;/#if&gt;&lt;#if element.throwsList.referenceElements?has_content&gt; *\n
&lt;/#if&gt;&lt;#list element.throwsList.referenceElements as exception&gt; * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt; */</VALUE>
</METHOD>
<METHOD>
<KEY>^.*(public|protected|private)*\s*.*(void|\w(\s*&lt;.+&gt;)*)+\s+set\w+\s*\(.*\).+</KEY>
<VALUE>/**\n
* Sets ${partName}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;&lt;#list element.typeParameters as typeParameter&gt; * @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;&lt;#if element.parameterList.parameters?has_content&gt; *\n
&lt;/#if&gt;&lt;#list element.parameterList.parameters as parameter&gt; * @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;&lt;#if isNotVoid&gt; *\n
* @return the ${partName}\n
&lt;/#if&gt;&lt;#if element.throwsList.referenceElements?has_content&gt; *\n
&lt;/#if&gt;&lt;#list element.throwsList.referenceElements as exception&gt; * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt; */</VALUE>
</METHOD>
<METHOD>
<KEY>^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+</KEY>
<VALUE>/**\n
* The entry point of application.\n
&lt;#if element.parameterList.parameters?has_content&gt; *\n
&lt;/#if&gt; * @param ${element.parameterList.parameters[0].name} the input arguments\n
&lt;#if element.throwsList.referenceElements?has_content&gt; *\n
&lt;/#if&gt;&lt;#list element.throwsList.referenceElements as exception&gt; * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt; */</VALUE>
</METHOD>
<METHOD>
<KEY>.+</KEY>
<VALUE>/**\n
* ${name}&lt;#if isNotVoid&gt; ${return}&lt;/#if&gt;.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;&lt;#list element.typeParameters as typeParameter&gt; * @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;&lt;#if element.parameterList.parameters?has_content&gt; *\n
&lt;/#if&gt;&lt;#list element.parameterList.parameters as parameter&gt; * @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;&lt;#if isNotVoid&gt; *\n
* @return the ${return}\n
&lt;/#if&gt;&lt;#if element.throwsList.referenceElements?has_content&gt; *\n
&lt;/#if&gt;&lt;#list element.throwsList.referenceElements as exception&gt; * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt; */</VALUE>
</METHOD>
</METHODS>
<FIELDS>
<FIELD>
<KEY>^.*(public|protected|private)*.+static.*(\w\s\w)+.+</KEY>
<VALUE>/**\n
* The constant ${element.getName()}.\n
*/</VALUE>
</FIELD>
<FIELD>
<KEY>^.*(public|protected|private)*.*(\w\s\w)+.+</KEY>
<VALUE>/**\n
&lt;#if element.parent.isInterface()&gt; * The constant ${element.getName()}.\n
&lt;#else&gt; * The ${name}.\n
&lt;/#if&gt; */</VALUE>
</FIELD>
<FIELD>
<KEY>.+</KEY>
<VALUE>/**\n
&lt;#if element.parent.isEnum()&gt; *${name} ${typeName}.\n
&lt;#else&gt; * The ${name}.\n
&lt;/#if&gt;*/</VALUE>
</FIELD>
</FIELDS>
</TEMPLATES>
</component>
</project>

35
.idea/jarRepositories.xml generated Normal file
View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="https://mirrors.huaweicloud.com/repository/maven/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven2" />
<option name="name" value="maven2" />
<option name="url" value="https://developer.huawei.com/repo/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven3" />
<option name="name" value="maven3" />
<option name="url" value="https://repo.huaweicloud.com/repository/maven/" />
</remote-repository>
</component>
</project>

15
.idea/misc.xml generated Normal file
View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="SwUserDefinedSpecifications">
<option name="specTypeByUrl">
<map />
</option>
</component>
</project>

View File

@ -0,0 +1,34 @@
g java:S112:"FDefine and throw a dedicated exception instead of using a generic one.(»Œ<C2BB>ßûÿÿÿÿµÖŒ0
b java:S112K"FDefine and throw a dedicated exception instead of using a generic one.(ÝäâúµÖŒ0

java:S1319q"dThe type of "options" should be an interface such as "Map" rather than the implementation "HashMap".(«Š¾úùÿÿÿÿ8•ŒµÖŒ0
t
java:S1104"QMake width a static final constant or non-public and provide accessors if needed.(åáÛ‹ûÿÿÿÿ8žŒµÖŒ0
p
java:S1104"RMake height a static final constant or non-public and provide accessors if needed.(Á“Çú8ŸŒµÖŒ0
t
java:S1104»"QMake width a static final constant or non-public and provide accessors if needed.(åáÛ‹ûÿÿÿÿ8ŸŒµÖŒ0
p
java:S1104¾"RMake height a static final constant or non-public and provide accessors if needed.(Á“Çú8 ŒµÖŒ0
s
java:S1104Â"PMake data a static final constant or non-public and provide accessors if needed.(µ÷§Çøÿÿÿÿ8¡ŒµÖŒ0
n
java:S2095?"LUse try-with-resources or close this "BufferedWriter" in a "finally" clause.(îÞÀ‘ûÿÿÿÿ8¿ŽµÖŒ0
£
java:S1186/"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(æ—¶¾üÿÿÿÿ8ÍŽµÖŒ0
x
java:S1450*"VRemove the "rawdata" field and declare it as a local variable in the relevant methods.(ú é”úÿÿÿÿ8ÝŽµÖŒ0
?
java:S1118/"Hide this public constructor.(æ—¶¾üÿÿÿÿ8쎵֌0
^ java:S899="BDo something with the "boolean" value returned by "createNewFile".(úܲ¥<38>µÖŒ0
P
java:S1172E".Remove this unused method parameter "options".(ÖÚ‚Ùüÿÿÿÿ<38>µÖŒ0

java:S1130K"lRemove the declaration of thrown exception 'java.lang.Exception', as it cannot be thrown from method's body.(Ýäâú<38>µÖŒ0
] java:S125Z"<This block of commented-out lines of code should be removed.(ô¹ù·ýÿÿÿÿ<38>µÖŒ0
Z java:S106r"9Replace this use of System.out or System.err by a logger.(ܳš·üÿÿÿÿ<38>µÖŒ0
B
java:S1659"$Declare "height" on a separate line.(Á“Çú<38>µÖŒ0
B
java:S1659¾"$Declare "height" on a separate line.(Á“Çú8€<38>µÖŒ0

View File

@ -0,0 +1,46 @@
k java:S117]"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(•Ž…<C5BD>øÿÿÿÿ
\
java:S2184È"ECast one of the operands of this subtraction operation to a "double".(Äž¯í
c
java:S3973q"HUse indentation to denote the code conditionally executed by this "for".(Êóšâýÿÿÿÿ
U
java:S1118":Add a private constructor to hide the implicit public one.(çž<C3A7>ªûÿÿÿÿ
Q java:S125'"<This block of commented-out lines of code should be removed.(¥­ùÀ
m
java:S3776H"RRefactor this method to reduce its Cognitive Complexity from 29 to the 15 allowed.(ïÓ„æøÿÿÿÿ
U
java:S1659Z"?Declare "cd" and all following declarations on a separate line.(Ÿ<E28098><C5B8>
P java:S125e"<This block of commented-out lines of code should be removed.(ó<>É}
n
java:S3776¹"RRefactor this method to reduce its Cognitive Complexity from 36 to the 15 allowed.(µú—äýÿÿÿÿ
i
java:S3776í"RRefactor this method to reduce its Cognitive Complexity from 24 to the 15 allowed.(‹Žúª
=
java:S1659õ"&Declare "holepath" on a separate line.(É´ÓÖ
i
java:S3776¸"RRefactor this method to reduce its Cognitive Complexity from 22 to the 15 allowed.(<28>žÆë
V
java:S1659½"@Declare "pp2" and all following declarations on a separate line.(Æд
[
java:S1659¾"DDeclare "nextidx" and all following declarations on a separate line.(×£âÀ
H
java:S5261Ø"1Add explicit curly braces to avoid dangling else.(ôØÿ½
M
java:S5261ß"1Add explicit curly braces to avoid dangling else.(««ÒÀøÿÿÿÿ
I
java:S1135"2Complete the task associated to this TODO comment.(Œ¢Â¨
@
java:S1659<18>"$Declare "seqend" on a separate line.(™›‘žüÿÿÿÿ
<
java:S1659"&Declare "segtype2" on a separate line.(¿Ðìn
R java:S125"<This block of commented-out lines of code should be removed.(Ê¿…ë
W java:S125§"<This block of commented-out lines of code should be removed.(š™Ó’þÿÿÿÿ
I
java:S1135¥"2Complete the task associated to this TODO comment.(Œ¢Â¨
n
java:S3776´"RRefactor this method to reduce its Cognitive Complexity from 17 to the 15 allowed.(òƒ¨‚úÿÿÿÿ
V
java:S1659¾"?Declare "py" and all following declarations on a separate line.(™ïØ·
V
java:S1659ê"?Declare "t1" and all following declarations on a separate line.(Ü¢þ•

View File

@ -0,0 +1,5 @@
J
java:S2699"-Add at least one assertion to this test case.(þ–’ê8®œàÁŒ0
¡
java:S3577Rename class "Test" to match the regular expression: '^((Test|IT)[a-zA-Z0-9_]+|[A-Z][a-zA-Z0-9_]*(Test|Tests|TestCase|IT|ITCase))$'(Óµ¨œ ®¾Œ0

24
.idea/sonarlint/issuestore/index.pb generated Normal file
View File

@ -0,0 +1,24 @@
k
;src/main/java/com/xcl/imagetracer_mod/VectorizingUtils.java,7\6\7694485864010b12895922b15f2a2725fba0800a
_
/src/test/java/com/xcl/imagetracer_mod/Test.java,e\1\e10c18fde270132583fe384e4bd43a528f6d5e3d
c
3src/main/java/com/xcl/imagetracer_mod/SVGUtils.java,1\5\1586d759e116a7db0964977c1b73b0ffb0d15141
h
8src/main/java/com/xcl/imagetracer_mod/SelectiveBlur.java,c\0\c0e3efd21e2289b1fc9bd254fb2d359b2be6d8aa
f
6src/main/java/com/xcl/imagetracer_mod/ImageTracer.java,0\a\0ab6f53a3ca221a03ba699f735c59475a23a261b
?
settings.gradle,0\5\05efc8b1657769a27696d478ded1e95f38737233
<
build.gradle,f\0\f07866736216be0ee2aba49e392191aeae700a35
A
gradle.properties,2\a\2afbb999f001938c88fa43fc2ef52abf0f8213e4
9
README.md,8\e\8ec9a00bfd09b3190ac6b22251dbb1aa95a0579d
=
upload.gradle,9\2\92bb4b9034d01b5517aed00be842828de7184f6e
:
.gitignore,a\5\a5cc2925ca8258af241be7e5b0381edf30266302

6
.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -1,19 +1,16 @@
# ImageTracerJava
ImageTracerJava(A library that can transfer pictures such as PNG to SVG)<br>
ImageTracerJava(一个可以把png等图片转svg的开源Java库)
## How to Use:
### Including in Java projects
Add **ImageTracer.jar** to your build path<br>
**ImageTracer.jar** 添加到构建路径<br>
Add **ImageTracer.jar** to your build path
**ImageTracer.jar** 添加到构建路径
### 安装教程
**Add the mavenCentral repository under the project's build.gradle**<br>
**在 Project 的 build.gradle 下添加 mavenCentral 仓库**<br>
**Add the mavenCentral repository under the project's build.gradle**
**在 Project 的 build.gradle 下添加 mavenCentral 仓库**
```groovy
repositories {
@ -27,15 +24,15 @@ repositories {
}
```
**Add ImageTracerJava dependency under Module's build.gradle**<br>
**在 Module 的 build.gradle 下添加 ImageTracerJava 依赖**<br>
**Add ImageTracerJava dependency under Module's build.gradle**
**在 Module 的 build.gradle 下添加 ImageTracerJava 依赖**
```groovy
implementation 'top.xuegao-tzx:ImageTracerJava:1.1.4.516'
```
then use the static methods:<br>
然后使用静态方法:<br>
then use the static methods:
然后使用静态方法:
```java
import com.xcl.imagetracer_mod.ImageTracer;
@ -47,8 +44,8 @@ ImageTracer.saveString(
);
```
With options and palette<br>
带有选项和调色板的方法:<br>
With options and palette
带有选项和调色板的方法:
```java
// Options
@ -99,8 +96,8 @@ ImageTracer.saveString(
See [options for deterministic tracing](https://github.com/jankovicsandras/imagetracerjava/blob/master/deterministic.md)
### Main Functions<br>
### 主要功能<br>
### Main Functions
### 主要功能
|Function name|Arguments|Returns|
|-------------|---------|-------|
|```imageToSVG```|```String filename, HashMap<String,Float> options /*can be null*/, byte [][] palette /*can be null*/```|```String /*SVG content*/```|
@ -122,8 +119,8 @@ See [options for deterministic tracing](https://github.com/jankovicsandras/image
There are more functions for advanced users, read the source if you are interested. :)
### Options<br>
### 配置选项<br>
### Options
### 配置选项
|Option name|Default value|Meaning|
|-----------|-------------|-------|
|```ltres```|```1f```|Error treshold for straight lines.|
@ -145,7 +142,7 @@ There are more functions for advanced users, read the source if you are interest
### Process overview
See [Process overview and Ideas for improvement](https://github.com/jankovicsandras/imagetracerjava/blob/master/process_overview.md)
### License<br>
### 许可证<br>
### License
### 许可证
Modfiy Author田梓萱<br>
ImageTracerJava 在 [Apache 2.0 License](LICENSE)下获得许可