Class MaskWrapper

    • Constructor Detail

      • MaskWrapper

        public MaskWrapper​(MaskData mask)
        Constructor of the MaskWrapper class using a MaskData.
        Parameters:
        mask - The MaskData to wrap.
      • MaskWrapper

        public MaskWrapper()
        Constructor of the MaskWrapper class using a new empty MaskData.
      • MaskWrapper

        public MaskWrapper​(double x,
                           double y,
                           double width,
                           double height,
                           byte[] mask)
        Constructor of the MaskWrapper class using a new MaskData.
        Parameters:
        x - The x-coordinate of the top-left corner of the image.
        y - The y-coordinate of the top-left corner of the image.
        width - The width of the image.
        height - The height of the image.
        mask - The mask image.
    • Method Detail

      • getText

        public java.lang.String getText()
        Gets the text on the ShapeData.
        Specified by:
        getText in interface Shape
        Returns:
        the text
      • setText

        public void setText​(java.lang.String text)
        Sets the text on the ShapeData.
        Specified by:
        setText in interface Shape
        Parameters:
        text - the text
      • getX

        public double getX()
        Returns the x-coordinate of the rectangular shape.
        Specified by:
        getX in interface Rectangular
        Returns:
        See above.
      • setX

        public void setX​(double x)
        Sets the x-coordinate of the rectangular shape.
        Specified by:
        setX in interface Rectangular
        Parameters:
        x - See above.
      • getY

        public double getY()
        Returns the y coordinate of the rectangular shape.
        Specified by:
        getY in interface Rectangular
        Returns:
        See above.
      • setY

        public void setY​(double y)
        Sets the y-coordinate of the rectangular shape.
        Specified by:
        setY in interface Rectangular
        Parameters:
        y - See above.
      • getWidth

        public double getWidth()
        Returns the width of the rectangular shape.
        Specified by:
        getWidth in interface Rectangular
        Returns:
        See above.
      • setWidth

        public void setWidth​(double width)
        Sets width of the rectangular shape.
        Specified by:
        setWidth in interface Rectangular
        Parameters:
        width - See above.
      • getHeight

        public double getHeight()
        Returns the height of the rectangular shape.
        Specified by:
        getHeight in interface Rectangular
        Returns:
        See above.
      • setHeight

        public void setHeight​(double height)
        Sets the height of the rectangular shape.
        Specified by:
        setHeight in interface Rectangular
        Parameters:
        height - See above.
      • getMaskAsBinaryArray

        public int[][] getMaskAsBinaryArray()
        Returns the mask image.
        Specified by:
        getMaskAsBinaryArray in interface Mask
        Returns:
        See above.
      • getMask

        public byte[] getMask()
        Returns the mask as a byte array.
        Specified by:
        getMask in interface Mask
        Returns:
        See above.
      • setMask

        public void setMask​(byte[] mask)
        Sets the mask image.
        Specified by:
        setMask in interface Mask
        Parameters:
        mask - See above.
      • setMask

        public void setMask​(int[][] mask)
        Sets the mask
        Specified by:
        setMask in interface Mask
        Parameters:
        mask - The binary mask (int[width][height])
      • setMask

        public void setMask​(boolean[][] mask)
        Sets the mask
        Specified by:
        setMask in interface Mask
        Parameters:
        mask - The binary mask (boolean[width][height])