Enum Kernel.EdgeHandlingStrategy
- java.lang.Object
-
- java.lang.Enum<Kernel.EdgeHandlingStrategy>
-
- dev.brachtendorf.jimagehash.hashAlgorithms.filter.Kernel.EdgeHandlingStrategy
-
- All Implemented Interfaces:
Serializable,Comparable<Kernel.EdgeHandlingStrategy>
- Enclosing class:
- Kernel
public static enum Kernel.EdgeHandlingStrategy extends Enum<Kernel.EdgeHandlingStrategy>
The edge handling strategy defines the behaviour when a kernel reaches the edge of an image and does not have enough information to compute it's value.- Since:
- 2.0.0
- Author:
- Kilian
-
-
Enum Constant Summary
Enum Constants Enum Constant Description EXPANDIf not enough data is available take the last pixel at the edge and repeat itMIRRORIf not enough data is available mirror the pixels along the edgeNO_OPIf not enough data is available copy the original value.WRAPIf not enough data is available wrap the image around
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcorrectPixel(int pIndex, int widthOrHeight)Return the array index to compute the kernel valuestatic Kernel.EdgeHandlingStrategyvalueOf(String name)Returns the enum constant of this type with the specified name.static Kernel.EdgeHandlingStrategy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NO_OP
public static final Kernel.EdgeHandlingStrategy NO_OP
If not enough data is available copy the original value.
-
EXPAND
public static final Kernel.EdgeHandlingStrategy EXPAND
If not enough data is available take the last pixel at the edge and repeat it
-
MIRROR
public static final Kernel.EdgeHandlingStrategy MIRROR
If not enough data is available mirror the pixels along the edge
-
WRAP
public static final Kernel.EdgeHandlingStrategy WRAP
If not enough data is available wrap the image around
-
-
Method Detail
-
values
public static Kernel.EdgeHandlingStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Kernel.EdgeHandlingStrategy c : Kernel.EdgeHandlingStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Kernel.EdgeHandlingStrategy valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
correctPixel
public int correctPixel(int pIndex, int widthOrHeight)Return the array index to compute the kernel value- Parameters:
pIndex- The pixel index of the arraywidthOrHeight- the width or height of the array- Returns:
- the index of the array used to compute the value
-
-