Skip to content

Commit b8e22e2

Browse files
authored
Merge pull request #11 from umjammer/1.0.10
1.0.10
2 parents 0153c44 + 72a38e1 commit b8e22e2

File tree

100 files changed

+3626
-2012
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+3626
-2012
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,11 @@ jobs:
3030

3131
steps:
3232
- name: Checkout repository
33-
uses: actions/checkout@v2
34-
with:
35-
# We must fetch at least the immediate parents so that if this is
36-
# a pull request then we can checkout the head.
37-
fetch-depth: 2
38-
39-
# If this run was triggered by a pull request event, then checkout
40-
# the head of the pull request instead of the merge commit.
41-
- run: git checkout HEAD
42-
if: ${{ github.event_name == 'pull_request' }}
33+
uses: actions/checkout@v3
4334

4435
# Initializes the CodeQL tools for scanning.
4536
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v1
37+
uses: github/codeql-action/init@v2
4738
with:
4839
languages: ${{ matrix.language }}
4940
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,10 +44,10 @@ jobs:
5344

5445
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5546
# If this step fails, then you should remove it and run the build manually (see below)
56-
- name: Autobuild
47+
- name: build
5748
run: |
5849
brew install ffmpeg
5950
mvn -B install --file pom.xml
6051
6152
- name: Perform CodeQL Analysis
62-
uses: github/codeql-action/analyze@v1
53+
uses: github/codeql-action/analyze@v2

.github/workflows/maven-publish.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ jobs:
1010
runs-on: macos-latest
1111

1212
steps:
13-
- uses: actions/checkout@v1
13+
- uses: actions/checkout@v3
1414
- name: Set up JDK 1.8
15-
uses: actions/setup-java@v1
15+
uses: actions/setup-java@v3
1616
with:
17-
java-version: 1.8
17+
java-version: '8'
18+
distribution: 'temurin'
19+
cache: maven
1820
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
1921
settings-path: ${{ github.workspace }} # location for the settings.xml file
2022

.github/workflows/maven.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Java CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: macos-latest
9+
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Set up JDK 1.8
13+
uses: actions/setup-java@v3
14+
with:
15+
java-version: '8'
16+
distribution: 'temurin'
17+
cache: maven
18+
- name: Build with Maven
19+
run: |
20+
brew install ffmpeg
21+
mvn -B package --file pom.xml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/tmp/
22
/etc/
33
/lib/
4+
local.properties

README.md

Lines changed: 29 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
[![Release](https://jitpack.io/v/umjammer/vavi-image.svg)](https://jitpack.io/#umjammer/vavi-image)
2+
[![Java CI](https://github.com/umjammer/vavi-image/actions/workflows/maven.yml/badge.svg)](https://github.com/umjammer/vavi-image/actions/workflows/maven.yml)
23
[![CodeQL](https://github.com/umjammer/vavi-image/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/umjammer/vavi-image/actions/workflows/codeql-analysis.yml)
34
[![GitHub Packages (only ffmpeg)](https://github.com/umjammer/vavi-image/actions/workflows/maven-publish.yml/badge.svg)](https://github.com/umjammer/vavi-image/actions/workflows/maven-publish.yml)
5+
![Java](https://img.shields.io/badge/Java-8-b07219)
46

57
# vavi-image
68

7-
Imaging goodies.
9+
🎨 Imaging the world!
810

911
## Formats
10-
* artmaster 88 (old japanese pc pc-88,98 image format)
11-
* windows bitmap
12-
* gif (non lzw)
12+
13+
* [artmaster 88](http://fileformats.archiveteam.org/wiki/ArtMaster88) (old school japanese pc-8801,9801 image format)
14+
* [mag](https://ja.wikipedia.org/wiki/MAG%E3%83%95%E3%82%A9%E3%83%BC%E3%83%9E%E3%83%83%E3%83%88) (maki-chan graphic loader: old school japanese pc-8801,9801 image format)
15+
* [zim](https://ja.wikipedia.org/wiki/%E3%83%84%E3%82%A1%E3%82%A4%E3%83%88#Z's_STAFF) (z's staff kid: old school japanese 9801 image format)
16+
* [windows bitmap](https://www.google.co.jp/books/edition/Windows3_1%E3%82%B0%E3%83%A9%E3%83%95%E3%82%A3%E3%83%83%E3%82%AF%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9/YEYsAgAACAAJ?hl=ja)
17+
* gif ([non lzw](https://web.archive.org/web/20161106215528/http://homepage1.nifty.com/uchi/software.htm))
1318
* windows icon
1419
* ppm
1520

16-
## Resizing Evaluation
21+
## Resizing
1722

1823
|type|quality|speed|comment|
1924
|---|---|---|---|
@@ -23,73 +28,39 @@ Imaging goodies.
2328
|`G2dResample`|2||`Graphics2d#drawImage` with rendering hints (`VALUE_INTERPOLATION_NEAREST_NEIGHBOR`)|
2429
|`AffineTransformOp`|2| |`TYPE_NEAREST_NEIGHBOR`|
2530

26-
## Quantizing Evaluation
31+
## Quantization
2732

28-
|type|quality|comment|
29-
|---|---|---|
30-
|`ImageMagick`|||
31-
|`NeuralNet`|👑|https://github.com/umjammer/vavi-image-sandbox/wiki/OctTree_vs_NeuralNet|
32-
|`OctTree`|||
33+
| type |quality|comment|
34+
|----------------------------------------------------------------------------------|---|---|
35+
| [`ImageMagick`](src/main/java/vavi/awt/image/quantization/ImageMagikQuantizeOp.java) |||
36+
| `NeuralNet` |👑|https://github.com/umjammer/vavi-image-sandbox/wiki/OctTree_vs_NeuralNet|
37+
| `OctTree` |||
3338

3439
## Installation
3540

36-
* maven repo.
37-
```xml
38-
<repository>
39-
<id>github</id>
40-
<name>GitHub umjammer Apache Maven Packages</name>
41-
<url>https://maven.pkg.github.com/umjammer/*</url>
42-
</repository>
43-
44-
<dependency>
45-
<groupId>vavi</groupId>
46-
<artifactId>vavi-image</artifactId>
47-
<version>1.0.9</version>
48-
</dependency>
49-
```
50-
* if you want to use ffmpeg resizing, add below into your `pom.xml`
51-
* exec jvm w/ `-Djava.library.path=/target/test-classes`
52-
```xml
53-
<plugin>
54-
<artifactId>maven-dependency-plugin</artifactId>
55-
<version>2.10</version>
56-
<executions>
57-
<execution>
58-
<id>copy</id>
59-
<phase>generate-resources</phase>
60-
<goals>
61-
<goal>copy</goal>
62-
</goals>
63-
<configuration>
64-
<artifactItems>
65-
<artifactItem>
66-
<groupId>vavi</groupId>
67-
<artifactId>vavi-image-ffmpeg</artifactId>
68-
<version>1.0.9-SNAPSHOT</version>
69-
<type>dylib</type>
70-
<overWrite>false</overWrite>
71-
<outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
72-
<destFileName>libFfmpegResampleOpWrapper.dylib</destFileName>
73-
</artifactItem>
74-
</artifactItems>
75-
</configuration>
76-
</execution>
77-
</executions>
78-
</plugin>
79-
```
41+
* maven: https://jitpack.io/#umjammer/vavi-image
42+
* if you want to use ffmpeg resizing
43+
* [pom.xml](https://github.com/umjammer/vavi-image/wiki/Install-ffmpeg-native-library)
44+
* exec jvm w/ `java.library.path` system property e.g `-Djava.library.path=/target/test-classes`
8045

8146
## TODO
8247

8348
* test `OctTreeQuantizer` (only 256 colors?)
8449
* complete `ImageMagikQuantizer`
8550
* Lanczos3 filter using AWT API
8651
* `BufferedImageOp` ???
52+
* https://github.com/iariro/N88BasicImage
53+
* ffmpeg resize 4byte 32bit operation is wrong
8754

8855
## Tech Know
8956

9057
* Mac Open JDK's JNI library extension is `.dylib`
9158
* `libsescale` has MMX bug, this causes segmentation fault when resizing image.
9259

60+
## References
61+
62+
* https://sourceforge.net/projects/recoil/
63+
9364
## License
9465

9566
### Image I/O PPM Reader
@@ -127,9 +98,9 @@ Public Domain
12798

12899
### Java Image Editor
129100

130-
The downloadable source code on this page is released under the Apache License. Basically, this means that you are free to do whatever you like with this code, but it's not my fault if your satellite/nuclear power station/missile system fails as a result. Have fun!
131-
132-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this code except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
101+
| The downloadable source code on this page is released under the Apache License. Basically, this means that you are free to do whatever you like with this code, but it's not my fault if your satellite/nuclear power station/missile system fails as a result. Have fun!
102+
|
103+
| Licensed under the Apache License, Version 2.0 (the "License"); you may not use this code except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
133104

134105
### SkyView
135106

local.properties.sample

Lines changed: 0 additions & 3 deletions
This file was deleted.

pom.xml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
<groupId>vavi</groupId>
88
<artifactId>vavi-image</artifactId>
9-
<version>1.0.9</version>
9+
<version>1.0.10-SNAPSHOT</version>
1010

1111
<name>Vavi Imaging API</name>
1212
<organization>
13-
<name></name>
13+
<name>vavi</name>
1414
</organization>
1515
<url>https://github.com/umjammer/vavi-image</url>
16-
<description></description>
16+
<description>Vavi Imaging API</description>
1717
<scm>
1818
<url>https://github.com/umjammer/vavi-image</url>
1919
</scm>
@@ -24,7 +24,6 @@
2424
<distributionManagement>
2525
<repository>
2626
<id>github</id>
27-
<name>GitHub umjammer Apache Maven Packages</name>
2827
<url>https://maven.pkg.github.com/umjammer/vavi-image</url>
2928
</repository>
3029
</distributionManagement>
@@ -47,6 +46,7 @@
4746
<plugin>
4847
<groupId>org.codehaus.mojo</groupId>
4948
<artifactId>native-maven-plugin</artifactId>
49+
<version>1.0-alpha-11</version>
5050
<extensions>true</extensions>
5151
<configuration>
5252
<javahClassNames>
@@ -79,7 +79,7 @@
7979
<linkerStartOption>-dynamiclib -arch x86_64 -v
8080
-L/usr/local/lib -lobjc -lavformat -lavcodec -lswscale -lavutil</linkerStartOption>
8181
</linkerStartOptions>
82-
<linkerFinalName></linkerFinalName>
82+
<linkerFinalName/>
8383
</configuration>
8484
<executions>
8585
<execution>
@@ -115,7 +115,9 @@
115115

116116

117117
<plugin>
118+
<groupId>org.apache.maven.plugins</groupId>
118119
<artifactId>maven-install-plugin</artifactId>
120+
<version>3.0.0-M1</version>
119121
<executions>
120122
<execution>
121123
<id>install-library</id>
@@ -135,7 +137,9 @@
135137
</plugin>
136138

137139
<plugin>
140+
<groupId>org.apache.maven.plugins</groupId>
138141
<artifactId>maven-deploy-plugin</artifactId>
142+
<version>3.0.0-M2</version>
139143
<configuration>
140144
<skip>true</skip>
141145
</configuration>
@@ -179,7 +183,7 @@
179183
<plugin>
180184
<groupId>org.apache.maven.plugins</groupId>
181185
<artifactId>maven-surefire-plugin</artifactId>
182-
<version>3.0.0-M5</version>
186+
<version>3.0.0-M7</version>
183187
<configuration>
184188
<forkMode>once</forkMode>
185189
<argLine>
@@ -196,7 +200,9 @@
196200
<build>
197201
<plugins>
198202
<plugin>
203+
<groupId>org.apache.maven.plugins</groupId>
199204
<artifactId>maven-compiler-plugin</artifactId>
205+
<version>3.10.1</version>
200206
<configuration>
201207
<source>8</source>
202208
<target>8</target>
@@ -218,7 +224,7 @@
218224
<dependency>
219225
<groupId>org.junit</groupId>
220226
<artifactId>junit-bom</artifactId>
221-
<version>5.8.1</version>
227+
<version>5.9.0</version>
222228
<type>pom</type>
223229
<scope>import</scope>
224230
</dependency>
@@ -229,7 +235,7 @@
229235
<dependency>
230236
<groupId>com.github.umjammer</groupId>
231237
<artifactId>vavi-commons</artifactId>
232-
<version>1.1.6</version>
238+
<version>1.1.8</version>
233239
</dependency>
234240
<dependency>
235241
<groupId>com.github.umjammer</groupId>
@@ -240,7 +246,7 @@
240246
<dependency>
241247
<groupId>com.github.umjammer</groupId>
242248
<artifactId>vavi-awt</artifactId>
243-
<version>1.0.5</version>
249+
<version>1.0.6</version>
244250
<scope>test</scope>
245251
</dependency>
246252
<dependency>
@@ -249,12 +255,6 @@
249255
<version>2.1.3</version>
250256
<scope>test</scope>
251257
</dependency>
252-
<dependency>
253-
<groupId>commons-logging</groupId>
254-
<artifactId>commons-logging</artifactId>
255-
<version>1.1</version>
256-
<scope>test</scope>
257-
</dependency>
258258

259259
<dependency>
260260
<groupId>org.junit.jupiter</groupId>

src/main/java/vavi/awt/image/AbstractBufferedImageOp.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public abstract class AbstractBufferedImageOp implements BufferedImageOp, Clonea
3636
/**
3737
* @return same size as src
3838
*/
39+
@Override
3940
public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dstCM) {
4041
if (dstCM == null) {
4142
dstCM = src.getColorModel();
@@ -44,11 +45,13 @@ public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dst
4445
}
4546

4647
/** @return just src bounds */
48+
@Override
4749
public Rectangle2D getBounds2D(BufferedImage src) {
4850
return new Rectangle(0, 0, src.getWidth(), src.getHeight());
4951
}
5052

5153
/** @return no conversion */
54+
@Override
5255
public Point2D getPoint2D(Point2D srcPt, Point2D dstPt) {
5356
if (dstPt == null) {
5457
dstPt = new Point2D.Double();
@@ -58,6 +61,7 @@ public Point2D getPoint2D(Point2D srcPt, Point2D dstPt) {
5861
}
5962

6063
/** @return null */
64+
@Override
6165
public RenderingHints getRenderingHints() {
6266
return null;
6367
}
@@ -91,6 +95,7 @@ protected void setRGB(BufferedImage image, int x, int y, int width, int height,
9195
}
9296

9397
/* TODO hide CloneNotSupportedException */
98+
@Override
9499
public Object clone() {
95100
try {
96101
return super.clone();

0 commit comments

Comments
 (0)