Interface IMapImageServiceFacade

    • Method Detail

      • isOnSea

        boolean isOnSea​(int x,
                        int y)
        Check if a location on the image is white meaning it is at sea.
        Parameters:
        x - location to be checked
        y - location to be checked
        Returns:
        true if the coordinates represent a coordinate at sea.
      • distanceToShore

        double distanceToShore​(javafx.geometry.Point2D point,
                               double max)
                        throws java.io.IOException
        Check the if there is shore within a certain radius of max. If there is the approximate distance is returned.
        Parameters:
        point - that is to be checked.
        max - maximum radius
        Returns:
        maximum radius or approximate distance to the shore, whatever is smaller. If the approximate distance is returned it may be smaller than the actual distance to the nearest land.
        Throws:
        java.io.IOException
      • countLandPixels

        int countLandPixels​(javafx.geometry.Point2D point,
                            int radius,
                            java.util.List<ECircleSegment> segments)
                     throws java.io.IOException
        Count the number of black pixels in a circle around point with radius.
        Parameters:
        point - center point around which should be checked
        radius - radius of the area that should be checked.
        Returns:
        number of pixels that represent land.
        Throws:
        java.io.IOException
      • getLocationAtOtherEndOfMap

        javafx.geometry.Point2D getLocationAtOtherEndOfMap​(javafx.geometry.Point2D location)
        Retrieve a random ponint that is at sea.
        Parameters:
        location - near where the random point has to be located.
        Returns:
        point located on the sea.
      • getWidth

        int getWidth()
        £Retrieve the width of the map in pixels.
        Returns:
        width of the map
      • getHeight

        int getHeight()
        Retrieve the height of the map in pixels.
        Returns:
        height of the map