Class DepthOfFieldEffect

java.lang.Object
com.luciad.maps.effects.DepthOfFieldEffect
All Implemented Interfaces:
AutoCloseable

public final class DepthOfFieldEffect extends Object implements AutoCloseable
This class implements the depth-of-field effect, which blurs parts of the map based on their distance to the camera.

This mimics the behavior of a camera lens with a wide aperture: objects at the focus distance appear sharp, while objects closer to or farther from the camera are progressively blurred.

Left: depth of field disabled, Right: depth of field enabled with focus on the foreground
Left: depth of field disabled, Right: depth of field enabled with focus on the foreground

Depth of field is typically used to draw attention to a specific part of the scene, or to increase the visual quality of a 3D view. Its parameters are held by an immutable DepthOfFieldModel.

Read the parameters with getModel and change them by building a new model and passing it to setModel.

Note that depth of field is only applied in 3D views.

You cannot create a DepthOfFieldEffect. Instead, you can retrieve it from GraphicsEffects#getDepthOfField.

See the Configure Map Effects article for an overview of the available map effects.

Since:
2026.1
  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • isEnabled

      public boolean isEnabled()
      Returns whether the depth-of-field effect is enabled.
      Returns:
      whether the depth-of-field effect is enabled.
    • setEnabled

      public void setEnabled(boolean enabled)
      Sets whether the depth-of-field effect is enabled.

      The default is false.

      Parameters:
      enabled - true to enable the depth-of-field effect or false to disable it.
    • getModel

      @NotNull public DepthOfFieldModel getModel()
      Returns the depth-of-field model.
      Returns:
      the depth-of-field model.
    • setModel

      public void setModel(@NotNull DepthOfFieldModel model) throws NullPointerException
      Sets the depth-of-field model.
      Parameters:
      model - the depth-of-field model.
      Throws:
      NullPointerException - when the model is a null value.