@Override
    public boolean contains(Pixel point) {
        int minX = start.getX() < end.getX() ? start.getX() : end.getX();
        int maxX = start.getX() > end.getX() ? start.getX() : end.getX();
        int minY = start.getY() < end.getY() ? start.getY() : end.getY();
        int maxY = start.getY() > end.getY() ? start.getY() : end.getY();
        if (point.getX() >= minX && point.getX() <= maxX &&
            point.getY() >= minY && point.getY() <= maxY)
            return true;
        else
            return false;
    }