|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.anji.imaging.Java2DSurface
A 2-d matrix of int values (this could be a graphical image or a game board) used by
FloatingEye
. Also contains logic to transform surface image to eye image.
init() and one of tne of the setImage() functions must be called before this object is fully
initialized.
Field Summary |
Fields inherited from interface com.anji.imaging.Surface |
SURFACE_HEIGHT_KEY, SURFACE_WIDTH_KEY, TRANSFORMER_CLASS_KEY |
Constructor Summary | |
Java2DSurface()
default ctor |
Method Summary | |
java.awt.image.BufferedImage |
getBufferedImage()
|
int[] |
getData()
|
int |
getHeight()
|
int |
getValue(int x,
int y)
|
int |
getWidth()
|
void |
init(Properties props)
|
void |
setImage(java.awt.image.BufferedImage newData)
set values of 2-d rectangular surface BufferedImage ; this image is larger
than specified dimension so floating eye can go off the edge; these "off the edge" spaces
are set to aNonviewableSpaceValue |
void |
setImage(java.io.File imageFile)
Set source data of image. |
java.lang.String |
toString()
|
java.lang.String |
toXml()
|
int[] |
transform(TransformParameters parms)
transform image via translate, rotate, scale, crop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Java2DSurface()
Method Detail |
public void setImage(java.io.File imageFile) throws java.io.IOException
Surface
setImage
in interface Surface
imageFile
-
java.io.IOException
Surface.setImage(File)
,
setImage(BufferedImage)
public void setImage(java.awt.image.BufferedImage newData)
BufferedImage
; this image is larger
than specified dimension so floating eye can go off the edge; these "off the edge" spaces
are set to aNonviewableSpaceValue
newData
- public int getWidth()
getWidth
in interface Surface
public int getHeight()
getHeight
in interface Surface
public int getValue(int x, int y)
getValue
in interface Surface
x
- y
-
x
,y
public java.lang.String toXml()
String
XML representation of objectpublic java.lang.String toString()
Object.toString()
public int[] getData()
getData
in interface Surface
Surface.getData()
public java.awt.image.BufferedImage getBufferedImage()
BufferedImage
dataPlusGutter, not including "gutter"public int[] transform(TransformParameters parms)
Surface
transform
in interface Surface
parms
-
Surface.transform(com.anji.imaging.TransformParameters)
public void init(Properties props) throws java.lang.Exception
init
in interface Configurable
props
- configuration parameters
java.lang.Exception
Configurable.init(com.anji.util.Properties)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |