Package net.algart.matrices.scanning
Enum Class Boundary2DScanner.Side
- All Implemented Interfaces:
- Serializable,- Comparable<Boundary2DScanner.Side>,- Constable
- Enclosing class:
- Boundary2DScanner
The pixel side. This class represents one of 4 sides of a pixel (little square 1x1).
 See definition of the "pixel" term in comments to Boundary2DScanner class.
This class is immutable and thread-safe: there are no ways to modify settings of the created instance.
- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionThe left side (if the x axis is directed rightwards): the vertical boundary segment of the pixel with less x-coordinate.The right side (if the x axis is directed rightwards): the vertical boundary segment of the pixel with greater x-coordinate.The top side (if the y axis is directed downwards): the horizontal boundary segment of the pixel with less y-coordinate.The bottom side (if the y axis is directed downwards): the horizontal boundary segment of the pixel with greater y-coordinate.
- 
Method SummaryModifier and TypeMethodDescriptiondoublecenterX()Returns x-coordinate of the center (middle) of this side of the pixel.doublecenterY()Returns y-coordinate of the center (middle) of this side of the pixel.intdxAlong()Returns x-projection of this side of the pixel; the side is considered as an oriented segment (vector).intdyAlong()Returns y-projection of this side of the pixel; the side is considered as an oriented segment (vector).booleanbooleanstatic Boundary2DScanner.SideReturns the enum constant of this class with the specified name.static Boundary2DScanner.Side[]values()Returns an array containing the constants of this enum class, in the order they are declared.
- 
Enum Constant Details- 
X_MINUSThe left side (if the x axis is directed rightwards): the vertical boundary segment of the pixel with less x-coordinate.
- 
Y_MINUSThe top side (if the y axis is directed downwards): the horizontal boundary segment of the pixel with less y-coordinate.
- 
X_PLUSThe right side (if the x axis is directed rightwards): the vertical boundary segment of the pixel with greater x-coordinate.
- 
Y_PLUSThe bottom side (if the y axis is directed downwards): the horizontal boundary segment of the pixel with greater y-coordinate.
 
- 
- 
Method Details- 
valuesReturns 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
 
- 
valueOfReturns 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
 
- 
isHorizontalpublic boolean isHorizontal()- Returns:
- whether it is a horizontal side of the square pixel.
 
- 
isVerticalpublic boolean isVertical()- Returns:
- whether it is a vertical side of the square pixel.
 
- 
dxAlongpublic int dxAlong()Returns x-projection of this side of the pixel; the side is considered as an oriented segment (vector). It is supposed that we are passing around the pixel in the clockwise order, in assumption that if the x axis is directed rightwards and the y axis is directed downwards, — according to the general rules of tracing boundary segments, specified in comments toBoundary2DScannerclass.This method returns +1 for Y_MINUS, -1 forY_PLUS, 0 forX_MINUSandX_PLUS.- Returns:
- x-projection of this side of the pixel.
 
- 
dyAlongpublic int dyAlong()Returns y-projection of this side of the pixel; the side is considered as an oriented segment (vector). It is supposed that we are passing around the pixel in the clockwise order, in assumption that if the x axis is directed rightwards and the y axis is directed downwards, — according to the general rules of tracing boundary segments, specified in comments toBoundary2DScannerclass.This method returns -1 for X_MINUS, +1 forX_PLUS, 0 forY_MINUSandY_PLUS.- Returns:
- y-projection of this side of the pixel.
 
- 
centerXpublic double centerX()Returns x-coordinate of the center (middle) of this side of the pixel. (It is supposed that the center of this pixel is at the origin of coordinates.)This method returns -0.5 for X_MINUS, +0.5 forX_PLUS, 0.0 forY_MINUSandY_PLUS.- Returns:
- x-coordinate of the center of this pixel side.
 
- 
centerYpublic double centerY()Returns y-coordinate of the center (middle) of this side of the pixel. (It is supposed that the center of this pixel is at the origin of coordinates.)This method returns -0.5 for Y_MINUS, +0.5 forY_PLUS, 0.0 forX_MINUSandX_PLUS.- Returns:
- x-coordinate of the center of this pixel side.
 
 
-