Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
d5bf1093ea | |||
5a12e46830 | |||
7bd944bb8b | |||
4eab782cd0 | |||
fe0e00a356 | |||
427607da70 |
7
.checkstyle
Normal file
7
.checkstyle
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
|
||||
<fileset name="all" enabled="true" check-config-name="Google Checks" local="false">
|
||||
<file-match-pattern match-pattern="." include-pattern="true"/>
|
||||
</fileset>
|
||||
</fileset-config>
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
# IntelliJ project file
|
||||
v# IntelliJ project file
|
||||
*.iml
|
||||
|
||||
# Java Flight Recorder
|
||||
@ -228,3 +228,7 @@ $RECYCLE.BIN/
|
||||
.dropbox
|
||||
.dropbox.attr
|
||||
.dropbox.cache
|
||||
|
||||
/__pycache__/
|
||||
|
||||
|
||||
|
11
.travis.yml
11
.travis.yml
@ -1,11 +0,0 @@
|
||||
sudo: false
|
||||
language: java
|
||||
script: mvn clean verify -P coverage
|
||||
jdk:
|
||||
- openjdk8
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
cache:
|
||||
timeout: 1000
|
||||
directories:
|
||||
- $HOME/.m2
|
67
lutin_org-atriasoft-pngencoder.py
Normal file
67
lutin_org-atriasoft-pngencoder.py
Normal file
@ -0,0 +1,67 @@
|
||||
#!/usr/bin/python
|
||||
import realog.debug as debug
|
||||
import lutin.tools as tools
|
||||
import realog.debug as debug
|
||||
import lutin.image as image
|
||||
import os
|
||||
import lutin.multiprocess as lutinMultiprocess
|
||||
|
||||
|
||||
def get_type():
|
||||
return "LIBRARY_DYNAMIC"
|
||||
|
||||
def get_desc():
|
||||
return "Ewol Tool Kit"
|
||||
|
||||
def get_licence():
|
||||
return "MPL-2"
|
||||
|
||||
def get_compagny_type():
|
||||
return "org"
|
||||
|
||||
def get_compagny_name():
|
||||
return "atria-soft"
|
||||
|
||||
#def get_maintainer():
|
||||
# return "authors.txt"
|
||||
|
||||
#def get_version():
|
||||
# return "version.txt"
|
||||
|
||||
def configure(target, my_module):
|
||||
|
||||
my_module.add_src_file([
|
||||
'src/module-info.java',
|
||||
'src/org/atriasoft/pngencoder/PngEncoderLogic.java',
|
||||
'src/org/atriasoft/pngencoder/PngEncoderDeflaterExecutorService.java',
|
||||
'src/org/atriasoft/pngencoder/PngEncoderSrgbRenderingIntent.java',
|
||||
'src/org/atriasoft/pngencoder/PngEncoderVerificationUtil.java',
|
||||
'src/org/atriasoft/pngencoder/PngEncoder.java',
|
||||
'src/org/atriasoft/pngencoder/PngEncoderDeflaterThreadLocalDeflater.java',
|
||||
'src/org/atriasoft/pngencoder/PngEncoderIdatChunksOutputStream.java',
|
||||
'src/org/atriasoft/pngencoder/PngEncoderDeflaterOutputStream.java',
|
||||
'src/org/atriasoft/pngencoder/PngEncoderDeflaterBufferPool.java',
|
||||
'src/org/atriasoft/pngencoder/PngEncoderPhysicalPixelDimensions.java',
|
||||
'src/org/atriasoft/pngencoder/PngEncoderCountingOutputStream.java',
|
||||
'src/org/atriasoft/pngencoder/PngEncoderDeflaterBuffer.java',
|
||||
'src/org/atriasoft/pngencoder/PngEncoderDeflaterSegmentTask.java',
|
||||
'src/org/atriasoft/pngencoder/PngEncoderDeflaterExecutorServiceThreadFactory.java',
|
||||
'src/org/atriasoft/pngencoder/PngEncoderDeflaterSegmentResult.java',
|
||||
|
||||
])
|
||||
my_module.add_path('src/', type='java')
|
||||
|
||||
my_module.add_depend([
|
||||
'org-atriasoft-egami'
|
||||
])
|
||||
|
||||
#my_module.add_path([
|
||||
# 'lib/spotbugs-annotations-4.2.2.jar'
|
||||
# ],
|
||||
# type='java',
|
||||
# export=True
|
||||
#);
|
||||
my_module.add_flag('java', "RELEASE_15_PREVIEW");
|
||||
|
||||
return True
|
||||
|
122
pom.xml
Normal file
122
pom.xml
Normal file
@ -0,0 +1,122 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.atriasoft</groupId>
|
||||
<artifactId>png-encoder</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<properties>
|
||||
<maven.compiler.version>3.13.0</maven.compiler.version>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<maven.dependency.version>3.1.1</maven.dependency.version>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>gitea</id>
|
||||
<url>https://gitea.atria-soft.org/api/packages/org.atriasoft/maven</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>gitea</id>
|
||||
<url>https://gitea.atria-soft.org/api/packages/org.atriasoft/maven</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>gitea</id>
|
||||
<url>https://gitea.atria-soft.org/api/packages/org.atriasoft/maven</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.atriasoft</groupId>
|
||||
<artifactId>egami</artifactId>
|
||||
<version>0.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<version>5.11.0-M2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
<version>2.1.0-alpha1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
<!--<testSourceDirectory>test/src</testSourceDirectory>-->
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven.compiler.version}</version>
|
||||
<configuration>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
<!--<encoding>${project.build.sourceEncoding}</encoding>-->
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Create the source bundle -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- junit results -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.0.0-M5</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>fully.qualified.MainClass</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Java-doc generation for stand-alone site -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<configuration>
|
||||
<show>private</show>
|
||||
<nohelp>true</nohelp>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<!-- Generate Java-docs As Part Of Project Reports -->
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<configuration>
|
||||
<show>public</show>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
</project>
|
@ -82,9 +82,9 @@ class PngEncoderLogic {
|
||||
final byte[] scanlineBytes;
|
||||
|
||||
if (bufferedImage.hasAlpha()) {
|
||||
scanlineBytes = ToolImage.convertInByteBufferRGBA(bufferedImage);
|
||||
scanlineBytes = ToolImage.pngConvertInByteBufferRGBA(bufferedImage);
|
||||
} else {
|
||||
scanlineBytes = ToolImage.convertInByteBufferRGB(bufferedImage);
|
||||
scanlineBytes = ToolImage.pngConvertInByteBufferRGB(bufferedImage);
|
||||
}
|
||||
|
||||
final int segmentMaxLengthOriginal = PngEncoderDeflaterOutputStream.getSegmentMaxLengthOriginal(scanlineBytes.length);
|
||||
@ -95,10 +95,12 @@ class PngEncoderLogic {
|
||||
deflaterOutputStream.write(scanlineBytes);
|
||||
deflaterOutputStream.finish();
|
||||
deflaterOutputStream.flush();
|
||||
//deflaterOutputStream.close();
|
||||
} else {
|
||||
PngEncoderDeflaterOutputStream deflaterOutputStream = new PngEncoderDeflaterOutputStream(idatChunksOutputStream, compressionLevel, segmentMaxLengthOriginal);
|
||||
deflaterOutputStream.write(scanlineBytes);
|
||||
deflaterOutputStream.finish();
|
||||
//deflaterOutputStream.close();
|
||||
}
|
||||
|
||||
countingOutputStream.write(PngEncoderLogic.FILE_ENDING);
|
||||
|
Loading…
Reference in New Issue
Block a user