Skip to content

Commit

Permalink
Start looking at the effects of separate channels.
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyettinger committed Nov 12, 2022
1 parent e30ebf6 commit 22031a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RELEASE_SIGNING_ENABLED=true

GROUP=com.github.tommyettinger
POM_ARTIFACT_ID=anim8-gdx
VERSION_NAME=0.3.11
VERSION_NAME=0.3.12-SNAPSHOT

POM_NAME=anim8-gdx
POM_DESCRIPTION=Support for writing animated GIF and PNG files, plus PNG8, to libGDX.
Expand Down
13 changes: 8 additions & 5 deletions src/test/java/com/github/tommyettinger/InteractiveReducer.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class InteractiveReducer extends ApplicationAdapter {
protected PNG8 png8;
private int[] palette, altPalette, eightPalette;
private Pixmap p0, p;
private int index = 1;
private int index = 1, algorithmCount = 11;
private float strength = 1f;

public static void main(String[] arg) {
Expand Down Expand Up @@ -94,9 +94,12 @@ public void loadPalette(String name) {
public void refresh(){
p.drawPixmap(this.p0, 0, 0);
switch (index) {
case 0:
default:
reducer.reduceSolid(p);
break;
case 0:
reducer.reduceBlueNoiseSeparated(p);
break;
case 1:
reducer.reduceBlueNoise(p);
break;
Expand All @@ -121,7 +124,7 @@ public void refresh(){
case 8:
reducer.reduceScatter(p);
break;
default:
case 9:
reducer.reduceNeue(p);
break;
}
Expand Down Expand Up @@ -297,12 +300,12 @@ public boolean keyDown(int keycode) {
break;
case Input.Keys.LEFT:
case Input.Keys.LEFT_BRACKET:
index = (index + 9) % 10;
index = (index + algorithmCount - 1) % algorithmCount;
refresh();
break;
case Input.Keys.RIGHT:
case Input.Keys.RIGHT_BRACKET:
index = (index + 1) % 10;
index = (index + 1) % algorithmCount;
refresh();
break;
case Input.Keys.UP:
Expand Down

0 comments on commit 22031a3

Please sign in to comment.