de.grogra.texgen
public class DiamondSquareTexture extends SyntheticTexture
| Modifier and Type | Class and Description |
|---|---|
static class |
DiamondSquareTexture.Type |
| Modifier and Type | Field and Description |
|---|---|
static DiamondSquareTexture.Type |
$TYPE |
static SCOType.Field |
a0$FIELD |
static SCOType.Field |
a1$FIELD |
static SCOType.Field |
a2$FIELD |
static SCOType.Field |
a3$FIELD |
static SCOType.Field |
height$FIELD |
static SCOType.Field |
randomSeed$FIELD |
static SCOType.Field |
useColor$FIELD |
static SCOType.Field |
width$FIELD |
| Constructor and Description |
|---|
DiamondSquareTexture() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
createImage()
"helper function" to create an initial grid before the recursive function is called
|
protected float |
displace(float width,
float height,
float num)
Randomly displaces color value for midpoint depending on size of grid piece.
|
protected void |
divideGrid(java.awt.Graphics g,
float x,
float y,
float width,
float height,
float a0,
float a1,
float a2,
float a3)
This is the recursive function that implements the random midpoint
displacement algorithm (diamond square).
|
float |
getA0() |
float |
getA1() |
float |
getA2() |
float |
getA3() |
java.awt.image.BufferedImage |
getBufferedImage() |
int |
getHeight() |
ManageableType |
getManageableType() |
java.awt.Dimension |
getPreferredIconSize(boolean small) |
long |
getRandomSeed() |
int |
getWidth() |
boolean |
isUseColor() |
void |
setA0(float value) |
void |
setA1(float value) |
void |
setA2(float value) |
void |
setA3(float value) |
void |
setHeight(int value) |
void |
setRandomSeed(long value) |
void |
setUseColor(boolean value) |
void |
setWidth(int value) |
getNativeImage, isMutablegetIcon, getIconBounds, getIconSource, getImage, getImage, getImageSource, paintIcon, prepareIconaddReference, appendReferencesTo, fieldModified, getProvider, getStamp, initProvider, manageableReadResolve, manageableWriteReplace, removeReferencepublic static final DiamondSquareTexture.Type $TYPE
public static final SCOType.Field a0$FIELD
public static final SCOType.Field a1$FIELD
public static final SCOType.Field a2$FIELD
public static final SCOType.Field a3$FIELD
public static final SCOType.Field height$FIELD
public static final SCOType.Field randomSeed$FIELD
public static final SCOType.Field useColor$FIELD
public static final SCOType.Field width$FIELD
protected void createImage()
protected float displace(float width,
float height,
float num)
protected void divideGrid(java.awt.Graphics g,
float x,
float y,
float width,
float height,
float a0,
float a1,
float a2,
float a3)
public float getA0()
public float getA1()
public float getA2()
public float getA3()
public java.awt.image.BufferedImage getBufferedImage()
getBufferedImage in class ImageAdapterpublic int getHeight()
public ManageableType getManageableType()
public java.awt.Dimension getPreferredIconSize(boolean small)
getPreferredIconSize in interface IconSourcegetPreferredIconSize in class ImageAdapterpublic long getRandomSeed()
public int getWidth()
public boolean isUseColor()
public void setA0(float value)
public void setA1(float value)
public void setA2(float value)
public void setA3(float value)
public void setHeight(int value)
public void setRandomSeed(long value)
public void setUseColor(boolean value)
public void setWidth(int value)