Enum Class OutsideKernelPolicy

Object
Enum<OutsideKernelPolicy>
OutsideKernelPolicy
All Implemented Interfaces:
Serializable, Comparable<OutsideKernelPolicy>, Constable

public enum OutsideKernelPolicy extends Enum<OutsideKernelPolicy>
How to handle voxels whose neighbors are outside the scene.
Author:
Owen Feehan
  • Enum Constant Details

    • IGNORE_OUTSIDE

      public static final OutsideKernelPolicy IGNORE_OUTSIDE
      Ignore any parts of the neighborhood that lie outside the scene. The second parameter here is arbtirary.
    • AS_ON

      public static final OutsideKernelPolicy AS_ON
      Pretend any parts of the neighborhood that lie outside the scene are being on-valued.
    • AS_OFF

      public static final OutsideKernelPolicy AS_OFF
      Pretend any parts of the neighborhood that lie outside the scene are being off-valued.
  • Method Details

    • values

      public static OutsideKernelPolicy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static OutsideKernelPolicy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • as

      public static OutsideKernelPolicy as(boolean on)
      Multiplexes between AS_ON and AS_OFF.
      Parameters:
      on - if true, then AS_ON is selected, otherwise AS_OFF.
      Returns:
      either AS_ON and AS_OFF.
    • of

      public static OutsideKernelPolicy of(boolean ignoreOutside, boolean outsideHigh)
      Multiplexes between all three possible enums.
      Parameters:
      ignoreOutside - if true, then IGNORE_OUTSIDE is selected.
      outsideHigh - if ignoreOutside==false, and determines whether AS_ON (if true) is selected or AS_OFF (if false).
      Returns:
      either AS_ON and AS_OFF or IGNORE_OUTSIDE.
    • isIgnoreOutside

      public boolean isIgnoreOutside()
      When true, any parts of the neighborhood that lie outside the scene are not considered in kernel neighborhoods.
      Returns:
      true if parts of the neighborhood that lie outside the scene should be ignored.
    • isOutsideOn

      public boolean isOutsideOn()
      In cases where isIgnoreOutside() is false, then whether to treat voxels that lie outside the scene as on (if true) or off (if false).
      Returns:
      true if voxels lying outside the scene should be treated as on in the above circumstances, otherwise they are treated as off.
    • multiplex

      public int multiplex(int ignored, int asOn, int asOff)
      Multiplexes between three-values depending on which policy is currently selected.
      Parameters:
      ignored - the value to return if current policy is IGNORE_OUTSIDE
      asOn - the value to return if current policy is AS_ON
      asOff - the value to return if current policy is AS_OFF
      Returns:
      one of the three values above.