def _parse_overscan_shape(rows, columns):
    """
    Parse the number of overscan rows and columns into indices that can be used
    to reshape arrays.

    :param rows:
        The number of overscan rows.

    :type rows:
        int

    :param columns:
        The number of overscan columns.

    :type columns:
        int
    """

    if rows == 0 and columns == 0:
        return (0, 0)

    if rows == 0 and columns > 0:
        return (-1, columns)

    if rows > 0 and columns == 0:
        return (rows, -1)

    if rows > 0 and columns > 0:
        return (rows, columns)