public class AndroidScreen extends java.lang.Object implements NativeScreen
| Modifier and Type | Field and Description |
|---|---|
private float |
density |
static java.lang.Object |
framebufferSwapLock
An Object to lock against when swapping screen buffers.
|
| Constructor and Description |
|---|
AndroidScreen() |
| Modifier and Type | Method and Description |
|---|---|
(package private) float |
_getDensity() |
(package private) int |
_getHeight() |
(package private) long |
_getNativeHandle() |
(package private) java.nio.ByteBuffer |
_getScreenCapture() |
(package private) int |
_getWidth() |
(package private) void |
_shutdown() |
(package private) void |
_swapBuffers() |
(package private) void |
_uploadPixels(java.nio.Buffer b,
int x,
int y,
int width,
int height,
float alpha) |
int |
getDepth()
Returns the bit depth of the screen/
|
int |
getDPI()
Returns the number of pixels per inch in the screen.
|
int |
getHeight()
Returns the pixel height of the screen.
|
int |
getNativeFormat()
Returns the native format of the screen, as a constant from the Pixels
class.
|
long |
getNativeHandle()
Returns a native handle for the screen.
|
float |
getScale()
Return the scale factor between the physical pixels and the logical pixels
e.g.
|
java.nio.ByteBuffer |
getScreenCapture()
Returns a read-only ByteBuffer in the native pixel format containing the screen contents.
|
int |
getWidth()
Returns the pixel width of the screen.
|
void |
shutdown()
Called during JavaFX shutdown to release the screen.
|
void |
swapBuffers()
Called on the JavaFX application thread when pixel data for all windows
has been uploaded.
|
void |
uploadPixels(java.nio.Buffer b,
int x,
int y,
int width,
int height,
float alpha)
Uploads a pixel buffer to the screen.
|
private float density
public static final java.lang.Object framebufferSwapLock
public int getDepth()
NativeScreengetDepth in interface NativeScreenpublic int getNativeFormat()
getNativeFormat in interface NativeScreenpublic int getWidth()
getWidth in interface NativeScreenpublic int getHeight()
getHeight in interface NativeScreenpublic int getDPI()
getDPI in interface NativeScreenpublic float getScale()
NativeScreengetScale in interface NativeScreenpublic long getNativeHandle()
getNativeHandle in interface NativeScreenpublic void shutdown()
shutdown in interface NativeScreenpublic void uploadPixels(java.nio.Buffer b,
int x,
int y,
int width,
int height,
float alpha)
uploadPixels in interface NativeScreenb - Pixel data, in BYTE_BGRA_PRE format. The byte stride of the
data is equal to width * 4.x - The X offset of the pixel data on the screeny - The Y offset of the pixel data on the screenwidth - The pixel width of the dataheight - The pixel height of the dataalpha - The alpha level to use to compose the data over existing
pixelspublic void swapBuffers()
swapBuffers in interface NativeScreenpublic java.nio.ByteBuffer getScreenCapture()
getScreenCapture in interface NativeScreenint _getWidth()
int _getHeight()
float _getDensity()
long _getNativeHandle()
void _shutdown()
void _uploadPixels(java.nio.Buffer b,
int x,
int y,
int width,
int height,
float alpha)
void _swapBuffers()
java.nio.ByteBuffer _getScreenCapture()