Class BinaryMask

java.lang.Object
imagingbook.common.filter.mask.BinaryMask
Direct Known Subclasses:
CircularMask

public class BinaryMask extends Object
This class defines a binary mask, as used in filters, for example.
Version:
2022/09/10
  • Constructor Details

    • BinaryMask

      public BinaryMask(byte[][] mask, int centerX, int centerY)
    • BinaryMask

      public BinaryMask(byte[][] mask)
  • Method Details

    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • getCenterX

      public int getCenterX()
      Returns the x-coordinate of the mask's reference point.
      Returns:
      the x-coordinate of the mask's reference point
    • getCenterY

      public int getCenterY()
      Returns the y-coordinate of the mask's reference point.
      Returns:
      the y-coordinate of the mask's reference point
    • getElementCount

      public int getElementCount()
      Returns the number of inside-mask (1) elements.
      Returns:
      the number of inside-mask elements
    • getByteArray

      public byte[][] getByteArray()
      Returns a byte[x][y] with outside mask element values zero, inside mask elements non-zero. The first array index corresponds to the horizontal coordinate.
      Returns:
      the mask as a byte[][]
    • getByteProcessor

      Returns a byte[x][y] with outside mask element values zero, inside mask elements non-zero. The first array index corresponds to the horizontal coordinate.
      Returns:
      the mask as a byte[][]