Class DepthOfFieldModel

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

public final class DepthOfFieldModel extends Object implements AutoCloseable
Immutable set of parameters that describe the DepthOfFieldEffect, which blurs parts of the map based on their distance to the camera.

This model uses 4 parameters:

  • The focusDistance parameter is the distance from the camera, in meters, at which objects are perfectly in focus.
  • The blurStartDistance parameter is the distance from the focus plane, in meters, beyond which objects start to blur. Within this distance objects stay perfectly sharp.
  • The fullBlurDistance parameter is the distance from the focus plane, in meters, at which the blur saturates and objects are fully blurred. Between blurStartDistance and fullBlurDistance objects are blurred progressively.
  • The blurStrength parameter is a multiplier that increases or decreases the strength of the blur.

The sharp and blurred zones are symmetric around the focus plane: the pattern is the same toward the camera and away from it. blurStartDistance and fullBlurDistance are measured from the focus plane and apply equally on both sides:

 camera                           focus plane
     o.........|------------|==============|==============|------------|.........
              Fb           Bs                            Bs           Fb

     === sharp    --- blurring    ... fully blurred
     Bs = blurStartDistance    Fb = fullBlurDistance
 

Create one with DepthOfFieldModel#newBuilder, or start from an existing model with asBuilder, and apply it with DepthOfFieldEffect#setModel.

Since:
2026.1
  • Method Details

    • finalize

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

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

      @NotNull public static DepthOfFieldModel.Builder newBuilder()
      Creates a new builder with the default depth-of-field parameters.
      Returns:
      a new builder.
    • asBuilder

      @NotNull public DepthOfFieldModel.Builder asBuilder()
      Creates a builder pre-filled with this model's parameters.
      Returns:
      a builder pre-filled with this model's parameters.
    • getBlurStrength

      public double getBlurStrength()
      Returns the blur strength multiplier.
      Returns:
      the blur strength multiplier.
    • getFocusDistance

      public double getFocusDistance()
      Returns the focus distance in meters.
      Returns:
      the focus distance in meters.
    • getBlurStartDistance

      public double getBlurStartDistance()
      Returns the blur-start distance in meters.
      Returns:
      the blur-start distance in meters.
    • getFullBlurDistance

      public double getFullBlurDistance()
      Returns the full-blur distance in meters.
      Returns:
      the full-blur distance in meters.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable Object other)
      Overrides:
      equals in class Object