File tree 2 files changed +27
-21
lines changed
src/main/kotlin/com/hcyacg
2 files changed +27
-21
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import java.awt.image.BufferedImage
26
26
import java.io.ByteArrayInputStream
27
27
import java.io.ByteArrayOutputStream
28
28
import java.io.File
29
+ import java.io.InputStream
29
30
import java.util.concurrent.TimeUnit
30
31
import javax.imageio.ImageIO
31
32
@@ -384,26 +385,31 @@ object PicDetails {
384
385
} // 读入需要播放的jpg文件
385
386
386
387
387
- val out = ByteArrayOutputStream ()
388
- withContext(Dispatchers .IO ) {
389
- ImageIO .write(src[i], " png" , out )
390
- }
391
- // val input: InputStream = ByteArrayInputStream(out.toByteArray())
392
- e.addFrame(withContext(Dispatchers .IO ) {
393
- ImageIO .read(
394
- ByteArrayInputStream (
395
- LowPoly .generate(
396
- ByteArrayInputStream (out .toByteArray()),
397
- 200 ,
398
- 1F ,
399
- true ,
400
- " png" ,
401
- false ,
402
- 200
403
- ).toByteArray()
388
+
389
+ if (Config .lowPoly){
390
+ val out = ByteArrayOutputStream ()
391
+ withContext(Dispatchers .IO ) {
392
+ ImageIO .write(src[i], " png" , out )
393
+ }
394
+ e.addFrame(withContext(Dispatchers .IO ) {
395
+ ImageIO .read(
396
+ ByteArrayInputStream (
397
+ LowPoly .generate(
398
+ ByteArrayInputStream (out .toByteArray()),
399
+ 200 ,
400
+ 1F ,
401
+ true ,
402
+ " png" ,
403
+ false ,
404
+ 200
405
+ ).toByteArray()
406
+ )
404
407
)
405
- )
406
- }) // 添加到帧中
408
+ }) // 添加到帧中
409
+ }else {
410
+ e.addFrame(src[i])
411
+ }
412
+
407
413
}
408
414
409
415
e.finish()
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ object Command: AutoSavePluginConfig("Command") {
45
45
@ValueDescription(" 帮助" )
46
46
var help: String by value(" 帮助" )
47
47
48
- @ValueName(" 晶格化 " )
48
+ @ValueName(" lowPoly " )
49
49
@ValueDescription(" 晶格化命令" )
50
- var lowPoly: String by value(" 帮助 " )
50
+ var lowPoly: String by value(" 晶格化 " )
51
51
}
You can’t perform that action at this time.
0 commit comments