()
| 19 | } |
| 20 | |
| 21 | public void base() throws Exception { |
| 22 | try (var surface = Surface.makeRaster(ImageInfo.makeN32Premul(100, 100)); |
| 23 | var paint = new Paint().setColor(0xFFFF0000); |
| 24 | var path = new PathBuilder().moveTo(20, 80).lineTo(50, 20).lineTo(80, 80).closePath().build();) |
| 25 | { |
| 26 | var canvas = surface.getCanvas(); |
| 27 | canvas.drawPath(path, paint); |
| 28 | try (var image = surface.makeImageSnapshot()) { |
| 29 | var dir = "target/tests/ImageTest/"; |
| 30 | new File(dir).mkdirs(); |
| 31 | Files.write(Path.of(dir, "polygon_default.png"), EncoderPNG.encode(image).getBytes()); |
| 32 | Files.write(Path.of(dir, "polygon_default_none_1.png"), EncoderPNG.encode(image, EncodePNGOptions.DEFAULT.withFlags(EncodePNGFilterFlag.NONE).withZlibLevel(1)).getBytes()); |
| 33 | Files.write(Path.of(dir, "polygon_jpeg_default.jpeg"), EncoderJPEG.encode(image).getBytes()); |
| 34 | Files.write(Path.of(dir, "polygon_jpeg_50.jpeg"), EncoderJPEG.encode(image, EncodeJPEGOptions.DEFAULT.withQuality(50)).getBytes()); |
| 35 | Files.write(Path.of(dir, "polygon_webp_default.webp"), EncoderWEBP.encode(image).getBytes()); |
| 36 | Files.write(Path.of(dir, "polygon_webp_50.webp"), EncoderWEBP.encode(image,EncodeWEBPOptions.DEFAULT.withQuality(50)).getBytes()); |
| 37 | Files.write(Path.of(dir, "polygon_webp_lossless.webp"), EncoderWEBP.encode(image,EncodeWEBPOptions.DEFAULT.withCompressionMode(EncodeWEBPCompressionMode.LOSSLESS)).getBytes()); |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | public void makeSubset() throws Exception { |
| 43 | try (var surface = Surface.makeRaster(ImageInfo.makeN32Premul(100, 80))) { |
nothing calls this directly
no test coverage detected