sf_concat_nch.py 456 字节
Newer Older
A
Alex Duan 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# init
def init():
    pass

# destroy
def destroy():
    pass

def process(block):
    (nrows, ncols) = block.shape()
    results = []
    for i in range(nrows):
        row = []
        for j in range(ncols):
            val = block.data(i, j)
            if val is None:
                return [None]
            row.append(val.decode('utf_32_le'))
        row_str = ''.join(row)
        results.append(row_str.encode('utf_32_le'))
    return results