public class NineBlockIdenticonRenderer2 extends Object implements IdenticonRenderer
Current implementation uses only the lower 32 bits of identicon code.
Constructor and Description |
---|
NineBlockIdenticonRenderer2()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Color |
getBackgroundColor() |
float |
getPatchSize()
Returns the size in pixels at which each patch will be rendered before
they are scaled down to requested identicon size.
|
BufferedImage |
render(BigInteger code,
int size)
Returns rendered identicon image for given identicon code.
|
BufferedImage |
render(int code,
int size)
Returns rendered identicon image for given identicon code.
|
protected BufferedImage |
renderQuilt(int code,
int size) |
void |
setBackgroundColor(Color backgroundColor) |
void |
setPatchSize(float size)
Set the size in pixels at which each patch will be rendered before they
are scaled down to requested identicon size.
|
public float getPatchSize()
public void setPatchSize(float size)
size
- patch size in pixelspublic Color getBackgroundColor()
public void setBackgroundColor(Color backgroundColor)
public BufferedImage render(BigInteger code, int size)
IdenticonRenderer
render
in interface IdenticonRenderer
code
- identicon codesize
- image sizepublic BufferedImage render(int code, int size)
Size of the returned identicon image is determined by patchSize set using
setPatchSize(float)
. Since a 9-block identicon consists of 3x3 patches,
width and height will be 3 times the patch size.
render
in interface IdenticonRenderer
code
- identicon codesize
- image sizeprotected BufferedImage renderQuilt(int code, int size)