-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
113 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
!LowPoly-1.0.jar |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.zzhoujay.lowpoly; | ||
|
||
import java.io.File; | ||
import java.io.FileInputStream; | ||
import java.io.FileOutputStream; | ||
import java.io.IOException; | ||
|
||
/** | ||
* Created by zhou on 16-5-12. | ||
*/ | ||
public class Simple { | ||
|
||
public static void main(String[] args) throws IOException { | ||
if (args.length < 2) { | ||
throw new RuntimeException("请输入有效的图片"); | ||
} | ||
String in = args[0]; | ||
String out = args[1]; | ||
File inFile = new File(in); | ||
if (inFile.exists()) { | ||
File outFile = new File(out); | ||
FileInputStream inputStream = new FileInputStream(inFile); | ||
FileOutputStream outputStream = new FileOutputStream(outFile); | ||
long lastTime = System.currentTimeMillis(); | ||
if (args.length >= 8) { | ||
int accuracy = Integer.valueOf(args[2]); | ||
float scale = Float.valueOf(args[3]); | ||
boolean fill = Boolean.valueOf(args[4]); | ||
String format = args[5]; | ||
boolean antiAliasing = Boolean.valueOf(args[6]); | ||
int pointCount = Integer.valueOf(args[7]); | ||
LowPoly.generate(inputStream, outputStream, accuracy, scale, !fill, format, antiAliasing, pointCount); | ||
} else { | ||
LowPoly.generate(inputStream, outputStream); | ||
} | ||
System.out.println("目标已保存至:" + outFile.getAbsolutePath()); | ||
System.out.println("用时:" + (System.currentTimeMillis() - lastTime)); | ||
} else { | ||
throw new RuntimeException("源文件不存在"); | ||
} | ||
} | ||
} |