public final class EyeDomeLightingEffect extends Object implements AutoCloseable
The lighting model applies a shade to each pixel, based on the depth difference between that pixel and its surrounding pixels. The EDL technique uses 3 properties:
Note that Eye-dome lighting is only applied in 3D views.
You cannot create an EyeDomeLightingEffect
. Instead, you can retrieve it from GraphicsEffects#getEyeDomeLighting
.
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
finalize() |
android.graphics.Color |
getColor()
Returns the color of the shade.
|
double |
getStrength()
Returns the shading multiplication factor.
|
int |
getWindow()
Returns the number of surrounding pixels taken into account by EDL model.
|
boolean |
isEnabled() |
void |
set(int window,
double strength,
android.graphics.Color color)
Sets multiple properties in one go.
|
void |
setColor(android.graphics.Color color)
Sets the color of the shade.
|
void |
setEnabled(boolean enabled)
Enables or disables the Eye-dome lighting effect.
|
void |
setStrength(double strength)
Sets the shading multiplication factor.
|
void |
setWindow(int window)
Sets the number of surrounding pixels taken into account by EDL model.
|
public void close()
close
in interface AutoCloseable
public boolean isEnabled()
public void setEnabled(boolean enabled)
The default is false.
enabled
- true to enable the Eye-dome lighting effect or false to disable it.public int getWindow()
public void setWindow(int window)
The default window is 2.
window
- number of surrounding pixels taken into account by EDL model.@NotNull public android.graphics.Color getColor()
public void setColor(@NotNull android.graphics.Color color)
Note that the alpha component of the color is ignored so the color is fully opaque.
The default color is black.
color
- color of the shade.public double getStrength()
public void setStrength(double strength)
A value between 0 and 1 softens the shade, a value higher than 1 hardens the shade.
The default strength is 1.
strength
- shading multiplication factor.public void set(int window, double strength, @NotNull android.graphics.Color color)
window
- number of surrounding pixels taken into account by EDL model.strength
- color of the shade.color
- shading multiplication factor.setWindow
,
setStrength
,
setColor