Skip to content

Commit

Permalink
Merge pull request #11 from hrkalona/release/1.0.9.0
Browse files Browse the repository at this point in the history
Release/1.0.9.0
  • Loading branch information
hrkalona authored Mar 27, 2024
2 parents 6699665 + cd3c538 commit 402d285
Show file tree
Hide file tree
Showing 662 changed files with 34,018 additions and 12,659 deletions.
11 changes: 11 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Version 1.0.9.0
-Implemented Zhuoran's reference compression algorithm as a memory/speed tradeoff for locations with high memory requirement
-Optimized the custom BigNum implementation, which decreases the reference calculation time in shallow areas
-Optimized the mpfr/mpir reference calculations by reducing the number of JNA calls
-Implemented Zhuoran's multithreaded BLA table generation code. (It mostly affects areas with high iteration count, when using compression)
-Modified the drawing algorithms to include more tiling options
-Added convergent bailout as an option
-The zoom sequence renderer of Image Expander will now save the render settings and also the zoom factor on every step
-Added an aspect ratio option in zoom sequence renderer as a temporary workaround, until I implement non-square image format
-Bug Fixes and general improvements

Version 1.0.8.9
-Implemented a non-blocking (Only for the pixel calculation part) successive refinement method with pixel guessing
-Optimized the pixel calculation for Mandelbrot by unwrapping some calculations
Expand Down
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Fractal Zoomer 1.0.8.9
Fractal Zoomer 1.0.9.0

The most complete fractal generating software using java!

Expand Down
Binary file added lib/big-math-2.3.2.jar
Binary file not shown.
8 changes: 8 additions & 0 deletions src/de/articdive/jnoise/core/api/annotations/Vector1D.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package de.articdive.jnoise.core.api.annotations;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@Retention(RetentionPolicy.RUNTIME)
public @interface Vector1D {
}
8 changes: 8 additions & 0 deletions src/de/articdive/jnoise/core/api/annotations/Vector2D.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package de.articdive.jnoise.core.api.annotations;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@Retention(RetentionPolicy.RUNTIME)
public @interface Vector2D {
}
8 changes: 8 additions & 0 deletions src/de/articdive/jnoise/core/api/annotations/Vector3D.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package de.articdive.jnoise.core.api.annotations;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@Retention(RetentionPolicy.RUNTIME)
public @interface Vector3D {
}
8 changes: 8 additions & 0 deletions src/de/articdive/jnoise/core/api/annotations/Vector4D.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package de.articdive.jnoise.core.api.annotations;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@Retention(RetentionPolicy.RUNTIME)
public @interface Vector4D {
}
106 changes: 53 additions & 53 deletions src/de/articdive/jnoise/core/api/functions/Combiner.java
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
package de.articdive.jnoise.core.api.functions;

import de.articdive.jnoise.core.util.MathUtil;

/**
* Interface marking the implementing class as a function that combines to double values into 1 double value.
* As an example this is used to mark the minimization function in Worley Noise.
*
* @author Articdive
*/
@FunctionalInterface
public interface Combiner {
Combiner ADD = Double::sum;
Combiner MULTIPLY = (a, b) -> a * b;
Combiner MAX = Math::max;
Combiner MIN = Math::min;
Combiner POW = Math::pow;

Combiner EXPONENTIAL_SMOOTH_MIN = (a, b) -> {
double res = MathUtil.exp2(-32.0 * a) + MathUtil.exp2(-32.0 * b);
return -MathUtil.log2(res) / 32.0;
};
Combiner POWER_SMOOTH_MIN = (a, b) -> {
a = Math.pow(a, 8);
b = Math.pow(b, 8);
return Math.pow((a * b) / (a + b), 1.0 / 8);
};
Combiner POLYNOMIAL_SMOOTH_MIN = (a, b) -> {
double h = Math.max(0.1 - Math.abs(a - b), 0.0) / 0.1;
return Math.min(a, b) - h * h * 0.1 * (1.0 / 4.0);
};

/**
* Combines two double values into one double value.
*
* @param a first double.
* @param b second double.
* @return the resulting double.
* @deprecated Use {@link #applyTo(double, double)} - makes more sense with conventions.
*/
@Deprecated
default double combine(double a, double b) {
return applyTo(a, b);
}

/**
* Combines two double values into one double value.
*
* @param a first double.
* @param b second double.
* @return the resulting double.
*/
double applyTo(double a, double b);
package de.articdive.jnoise.core.api.functions;

import de.articdive.jnoise.core.util.MathUtil;

/**
* Interface marking the implementing class as a function that combines to double values into 1 double value.
* As an example this is used to mark the minimization function in Worley Noise.
*
* @author Articdive
*/
@FunctionalInterface
public interface Combiner {
Combiner ADD = Double::sum;
Combiner MULTIPLY = (a, b) -> a * b;
Combiner MAX = Math::max;
Combiner MIN = Math::min;
Combiner POW = Math::pow;

Combiner EXPONENTIAL_SMOOTH_MIN = (a, b) -> {
double res = MathUtil.exp2(-32.0 * a) + MathUtil.exp2(-32.0 * b);
return -MathUtil.log2(res) / 32.0;
};
Combiner POWER_SMOOTH_MIN = (a, b) -> {
a = Math.pow(a, 8);
b = Math.pow(b, 8);
return Math.pow((a * b) / (a + b), 1.0 / 8);
};
Combiner POLYNOMIAL_SMOOTH_MIN = (a, b) -> {
double h = Math.max(0.1 - Math.abs(a - b), 0.0) / 0.1;
return Math.min(a, b) - h * h * 0.1 * (1.0 / 4.0);
};

/**
* Combines two double values into one double value.
*
* @param a first double.
* @param b second double.
* @return the resulting double.
* @deprecated Use {@link #applyTo(double, double)} - makes more sense with conventions.
*/
@Deprecated
default double combine(double a, double b) {
return applyTo(a, b);
}

/**
* Combines two double values into one double value.
*
* @param a first double.
* @param b second double.
* @return the resulting double.
*/
double applyTo(double a, double b);
}
4 changes: 1 addition & 3 deletions src/de/articdive/jnoise/core/api/noisegen/NoiseResult.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package de.articdive.jnoise.core.api.noisegen;

import de.articdive.jnoise.core.util.vectors.Vector;

/**
* Interface that denotes a noise result, which is used to wrap the results of an entire noise generation step.
* Useful when there are multiple result types, i.e. not only a double but e.g. a {@link Vector}.
* Useful when there are multiple result types, i.e. not only a double but e.g. a vector.
*
* @author Articdive
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.articdive.jnoise.core.api.noisegen;



/**
* Interface that denotes a {@link SeededNoiseGenerator}, which can additionally evaluate a {@link NoiseResult} at a location.
*
Expand All @@ -16,7 +15,6 @@ public interface SeededExplicitNoiseGenerator<NR extends NoiseResult> extends Ex
* @param seed seed for the {@link SeededNoiseGenerator} to use.
* @return {@link NR} denoting the noise value at the 1D point.
*/

NR evaluateNoiseResult(double x, long seed);

/**
Expand All @@ -27,7 +25,6 @@ public interface SeededExplicitNoiseGenerator<NR extends NoiseResult> extends Ex
* @param seed seed for the {@link SeededNoiseGenerator} to use.
* @return {@link NR} denoting the noise value at the 2D point.
*/

NR evaluateNoiseResult(double x, double y, long seed);

/**
Expand All @@ -39,7 +36,6 @@ public interface SeededExplicitNoiseGenerator<NR extends NoiseResult> extends Ex
* @param seed seed for the {@link SeededNoiseGenerator} to use.
* @return {@link NR} denoting the noise value at the 3D point.
*/

NR evaluateNoiseResult(double x, double y, double z, long seed);

/**
Expand All @@ -52,6 +48,5 @@ public interface SeededExplicitNoiseGenerator<NR extends NoiseResult> extends Ex
* @param seed seed for the {@link SeededNoiseGenerator} to use.
* @return {@link NR} denoting the noise value at the 4D point.
*/

NR evaluateNoiseResult(double x, double y, double z, double w, long seed);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import de.articdive.jnoise.core.api.noisegen.NoiseResult;


/**
* Interface that denotes an explicit {@link NoiseSource}, which can evaluate a {@link NoiseResult} at a location.
* Used everywhere where a {@link NoiseSource} has a non-double as a result.
Expand All @@ -16,7 +15,6 @@ public interface ExplicitNoiseSource<NR extends NoiseResult> extends NoiseSource
* @param x X-Coordinate of the 1D point.
* @return {@link NR} denoting the noise value at the 1D point.
*/

NR evaluateNoiseResult(double x);

/**
Expand All @@ -26,7 +24,6 @@ public interface ExplicitNoiseSource<NR extends NoiseResult> extends NoiseSource
* @param y Y-Coordinate of the 2D point.
* @return {@link NR} denoting the noise value at the 2D point.
*/

NR evaluateNoiseResult(double x, double y);

/**
Expand All @@ -37,7 +34,6 @@ public interface ExplicitNoiseSource<NR extends NoiseResult> extends NoiseSource
* @param z Z-Coordinate of the 3D point.
* @return {@link NR} denoting the noise value at the 3D point.
*/

NR evaluateNoiseResult(double x, double y, double z);

/**
Expand All @@ -49,6 +45,5 @@ public interface ExplicitNoiseSource<NR extends NoiseResult> extends NoiseSource
* @param w W-Coordinate of the 4D point.
* @return {@link NR} denoting the noise value at the 4D point.
*/

NR evaluateNoiseResult(double x, double y, double z, double w);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package de.articdive.jnoise.core.api.transformers;

import de.articdive.jnoise.core.util.vectors.Vector2D;
import de.articdive.jnoise.core.util.vectors.Vector3D;
import de.articdive.jnoise.core.util.vectors.Vector4D;

import de.articdive.jnoise.core.api.annotations.Vector1D;
import de.articdive.jnoise.core.api.annotations.Vector2D;
import de.articdive.jnoise.core.api.annotations.Vector3D;
import de.articdive.jnoise.core.api.annotations.Vector4D;

/**
* Interface that denotes a detailed transformer, which is used to transform coordinate tuples parts before the noise generation step.
Expand All @@ -13,40 +13,30 @@
*/
public interface DetailedTransformer {
/**
* Transforms an x coordinate before noise evaluation.
* Transforms an x coordinate before noise evaluation via a side-effect.
*
* @param x coordinate to transform.
* @return transformed x coordinate.
* @param vec1D a double array representing a 1D vector containing the x coordinate to transform.
*/
double transform(double x);
void transform1D(@Vector1D double[] vec1D);

/**
* Transforms an x and y coordinate before noise evaluation.
* Transforms an x and y coordinate before noise evaluation via a side-effect.
*
* @param x X coordinate to transform.
* @param y Y coordinate to transform.
* @return {@link Vector2D} containing the transformed x and y coordinates.
* @param vec2D a double array representing a 2D vector containing the x and y coordinate to transform.
*/
Vector2D transform(double x, double y);
void transform2D(@Vector2D double[] vec2D);

/**
* Transforms an x, y and z coordinate before noise evaluation.
* Transforms an x, y and z coordinate before noise evaluation via a side-effect.
*
* @param x X coordinate to transform.
* @param y Y coordinate to transform.
* @param z Z coordinate to transform.
* @return {@link Vector3D} containing the transformed x, y and z coordinates.
* @param vec3D a double array representing a 3D vector containing the x, y and z coordinate to transform.
*/
Vector3D transform(double x, double y, double z);
void transform3D(@Vector3D double[] vec3D);

/**
* Transforms an x, y, z and w coordinate before noise evaluation.
* Transforms an x, y, z and w coordinate before noise evaluation via a side-effect.
*
* @param x X coordinate to transform.
* @param y Y coordinate to transform.
* @param z Z coordinate to transform.
* @param w W coordinate to transform.
* @return {@link Vector4D} containing the transformed x, y, z and w coordinates.
* @param vec4D a double array representing a 4D vector containing the x, y, z and w coordinate to transform.
*/
Vector4D transform(double x, double y, double z, double w);
void transform4D(@Vector4D double[] vec4D);
}
37 changes: 37 additions & 0 deletions src/de/articdive/jnoise/core/util/MathUtil.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package de.articdive.jnoise.core.util;

import de.articdive.jnoise.core.api.annotations.Vector2D;
import de.articdive.jnoise.core.api.annotations.Vector3D;
import de.articdive.jnoise.core.api.annotations.Vector4D;

/**
* Utility class for mathematical functions.
*
Expand Down Expand Up @@ -29,4 +33,37 @@ public static double exp2(double x) {
public static double log2(double x) {
return Math.log(x) / Math.log(2);
}

/**
* Calculates the dot product of the specified 2D vectors.
*
* @param a a double array representing a 2D vector.
* @param b a double array representing a 2D vector.
* @return the dot product of the two 2D vectors.
*/
public static double dot2D(@Vector2D double[] a, @Vector2D double[] b) {
return (a[0] * b[0]) + (a[1] * b[1]);
}

/**
* Calculates the dot product of the specified 3D vectors.
*
* @param a a double array representing a 3D vector.
* @param b a double array representing a 3D vector.
* @return the dot product of the two 3D vectors.
*/
public static double dot3D(@Vector3D double[] a, @Vector3D double[] b) {
return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);
}

/**
* Calculates the dot product of the specified 4D vectors.
*
* @param a a double array representing a 4D vector.
* @param b a double array representing a 4D vector.
* @return the dot product of the two 4D vectors.
*/
public static double dot4D(@Vector4D double[] a, @Vector4D double[] b) {
return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);
}
}
Loading

0 comments on commit 402d285

Please sign in to comment.