Created
October 15, 2017 20:08
-
-
Save grkvlt/f014447fc70ade8351ceef51e2f8be1a to your computer and use it in GitHub Desktop.
Exploring Iterated Function Systems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Density estimation histogram | |
if (render.isDensity()) { | |
try { | |
density[p] = LongMath.checkedAdd(density[p], 1l); | |
switch (render) { | |
case LOG_DENSITY_BLUR: | |
case LOG_DENSITY_BLUR_INVERSE: | |
density[p] = LongMath.checkedAdd(density[p], kernel - 1); | |
int q = (x / kernel) + (y / kernel) * (size.width / kernel); | |
blur[q] = LongMath.checkedAdd(blur[q], 1); | |
break; | |
case LOG_DENSITY_POWER: | |
case DENSITY_POWER: | |
case LOG_DENSITY_POWER_INVERSE: | |
density[p] = (long) Math.min(((double) density[p]) * 1.01d, Long.MAX_VALUE); | |
break; | |
default: | |
break; | |
} | |
max = Math.max(max, density[p]); | |
} catch (ArithmeticException ae) { /* ignored */ } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment