public interface ScalableSurface
NativeSurface
implementation,
see setSurfaceScale(float[])
.Modifier and Type | Field and Description |
---|---|
static float |
AUTOMAX_PIXELSCALE
Setting surface-pixel-scale of 0.0f, results in maximum platform dependent pixel-scale, i.e.
|
static float |
IDENTITY_PIXELSCALE
Setting surface-pixel-scale of 1.0f, results in same pixel- and window-units.
|
Modifier and Type | Method and Description |
---|---|
float[] |
getCurrentSurfaceScale(float[] result)
Returns the current pixel scale of the associated
NativeSurface . |
float[] |
getMaximumSurfaceScale(float[] result)
Returns the maximum pixel scale of the associated
NativeSurface . |
float[] |
getMinimumSurfaceScale(float[] result)
Returns the minimum pixel scale of the associated
NativeSurface . |
float[] |
getRequestedSurfaceScale(float[] result)
Returns the
requested pixel scale of the associated NativeSurface . |
boolean |
setSurfaceScale(float[] pixelScale)
Request a pixel scale in x- and y-direction for the associated
NativeSurface ,
where size_in_pixel_units = pixel_scale * size_in_window_units . |
static final float IDENTITY_PIXELSCALE
static final float AUTOMAX_PIXELSCALE
boolean setSurfaceScale(float[] pixelScale)
NativeSurface
,
where size_in_pixel_units = pixel_scale * size_in_window_units
.
Default pixel scale request for both directions is AUTOMAX_PIXELSCALE
.
In case platform only supports uniform pixel scale, i.e. one scale for both directions,
either AUTOMAX_PIXELSCALE
or the maximum requested pixel scale component is used.
The requested pixel scale will be validated against platform limits before native scale-setup,
i.e. clipped to IDENTITY_PIXELSCALE
if not supported or clipped to the platform maximum.
It can be queried via getRequestedSurfaceScale(float[])
.
The actual realized pixel scale values of the NativeSurface
can be queried via getCurrentSurfaceScale(float[])
or
computed via surface.
convertToPixelUnits
(new int[] { 1, 1 })
pixelScale
- requested surface pixel scale float[2] values for x- and y-direction.true
if the current pixel scale
has changed, otherwise false
.getRequestedSurfaceScale(float[])
float[] getRequestedSurfaceScale(float[] result)
requested
pixel scale of the associated NativeSurface
.result
- float[2] storage for the resultsetSurfaceScale(float[])
float[] getCurrentSurfaceScale(float[] result)
NativeSurface
.result
- float[2] storage for the resultfloat[] getMinimumSurfaceScale(float[] result)
NativeSurface
.result
- float[2] storage for the resultfloat[] getMaximumSurfaceScale(float[] result)
NativeSurface
.
The maximum pixel scale maybe used to determine the proper dpi
value of the monitor displaying this NativeSurface
.
surfacePpMM = monitorPpMM * currentSurfaceScale / nativeSurfaceScale, with PpMM == pixel per millimeter
result
- float[2] storage for the resultCopyright 2010 JogAmp Community.