def window_bounds(window, affine):
    """ Calculate the window bounds from a given Affine. """
    (row_start, row_stop), (col_start, col_stop) = window
    w, s = (col_start, row_stop) * affine
    e, n = (col_stop, row_start) * affine
    return w, s, e, n