public final class ScreenCapturePixelMatrix extends java.lang.Object implements PixelMatrix
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_HEIGHT
Default height.
|
static int |
DEFAULT_ORIGIN_X
Default origin x.
|
static int |
DEFAULT_ORIGIN_Y
Default origin y.
|
static int |
DEFAULT_WIDTH
Default width.
|
Constructor and Description |
---|
ScreenCapturePixelMatrix(int originX,
int originY,
int width,
int height)
Create a new screen capture pixel matrix at the specified dimensions.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add the specified property change listener.
|
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Add the specified property change listener for the specified property.
|
void |
capture()
Capture a new screen shot.
|
int |
getHeight()
Return the height of this pixel matrix.
|
java.awt.Image |
getImage()
Return an image for this pixel matrix, scaled to dimensions
getWidth() x getHeight() if necessary. |
java.awt.Color |
getPixel(int x,
int y)
Return the color of the pixel at the specified (x, y) coordinates.
|
int |
getWidth()
Return the width of this pixel matrix.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove the specified property change listener.
|
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Remove the specified property change listener for the specified property.
|
void |
setPixel(int x,
int y,
java.awt.Color color)
Set the pixel at the specified (x, y) coordinates to the RGB and alpha
values in the specified color (optional operation).
|
java.awt.Image |
view(ReceptiveField receptiveField)
View this pixel matrix, returning an image for the specified receptive
field.
|
public static final int DEFAULT_ORIGIN_X
public static final int DEFAULT_ORIGIN_Y
public static final int DEFAULT_HEIGHT
public static final int DEFAULT_WIDTH
public ScreenCapturePixelMatrix(int originX, int originY, int width, int height)
originX
- screen capture origin xoriginY
- screen capture origin ywidth
- width in pixels, must be > 0height
- height in pixels, must be > 0public int getHeight()
getHeight
in interface PixelMatrix
public int getWidth()
getWidth
in interface PixelMatrix
public java.awt.Image getImage()
getWidth() x getHeight()
if necessary. The image will not be
null.getImage
in interface PixelMatrix
public void capture()
public java.awt.Color getPixel(int x, int y)
getPixel
in interface PixelMatrix
x
- x coordinate of the pixely
- y coordinate of the pixelpublic void setPixel(int x, int y, java.awt.Color color)
setPixel
in interface PixelMatrix
x
- x coordinate of the pixel to sety
- y coordinate of the pixel to setcolor
- color value, must not be nullpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface PixelMatrix
listener
- listener to addpublic void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface PixelMatrix
propertyName
- property namelistener
- listener to addpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface PixelMatrix
listener
- listener to removepublic void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface PixelMatrix
propertyName
- property namelistener
- listener to removepublic java.awt.Image view(ReceptiveField receptiveField)
view
in interface PixelMatrix
receptiveField
- receptive field through which to view this pixel
matrix, must not be null