Skip to content

Commit

Permalink
Scatter now defaults to a wider dither range.
Browse files Browse the repository at this point in the history
Also, InteractiveReducer correctly disposes of Pixmaps it no longer uses (this prevents a crash in long-term usage), and we've upgraded to Gradle 6.8.1.
  • Loading branch information
tommyettinger committed Feb 2, 2021
1 parent 8fecdf4 commit 1830681
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,7 @@ public Pixmap reduceScatter (Pixmap pixmap) {
pixmap.setBlending(Pixmap.Blending.None);
int color, used, rdiff, gdiff, bdiff;
byte er, eg, eb, paletteIndex;
float w1 = (float)(ditherStrength * populationBias * 0.09375), w3 = w1 * 3f, w5 = w1 * 5f, w7 = w1 * 7f;
float w1 = (float)(ditherStrength * populationBias * 0.140625), w3 = w1 * 3f, w5 = w1 * 5f, w7 = w1 * 7f;
for (int y = 0; y < h; y++) {
int ny = y + 1;
for (int i = 0; i < lineLen; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ public void filesDropped(String[] files) {
}

public void load(String name) {
if(p0 != null) p0.dispose();
//// loads a file by its full path, which we get via drag+drop
if (Gdx.files.internal(name).exists())
p0 = new Pixmap(Gdx.files.internal(name));
else
p0 = new Pixmap(Gdx.files.absolute(name));
if(p != null) p.dispose();
p = new Pixmap(this.p0.getWidth(), this.p0.getHeight(), Pixmap.Format.RGBA8888);
refresh();
}
Expand Down

0 comments on commit 1830681

Please sign in to comment.