def METHOD_NAME(data, w, h, depth):
    if depth == 8:
        arr = be_array_from_bytes('B', data)
        arr = _delta_decode(arr, 0x100, w, h)
    elif depth == 16:
        arr = be_array_from_bytes('H', data)
        arr = _delta_decode(arr, 0x10000, w, h)
    elif depth == 32:
        arr = array.array('B', data)
        arr = _delta_decode(arr, 0x100, w * 4, h)
        arr = _restore_byte_order(arr, w, h)
    else:
        raise ValueError('Invalid pixel size %d' % (depth))
    return getattr(arr, 'tobytes', getattr(arr, 'tostring', None))()