def cb_row(corners, pattern_size_wh, row_idx):
    """
    Get a row of chessboard corners with index row_idx.

    If non-valid row_idx is provided, None is returned.
    """
    
    row_size, n_rows = pattern_size_wh
    
    if row_idx < 0 or row_idx >= n_rows:
        return None
    
    offset = row_idx * row_size
    
    return corners[offset:offset+row_size, :]