def rgb_pixeldata(self):
pixels = [np.ndarray(shape=[64, 128], dtype=np.dtype('u1'), order='C'),
np.ndarray(shape=[64, 128], dtype=np.dtype('u1'), order='C'),
np.ndarray(shape=[64, 128], dtype=np.dtype('u1'), order='C')]
for s in range(0, len(pixels)):
for (y, x), value in np.ndenumerate(pixels[s]):
if s == 0:
value = (x * 255) / 128
if s == 1:
value = (y * 255) / 64
if s == 2:
value = 255 - ((y * 255) / 64)
pixels[s].itemset((y, x), value)
return pixels
评论列表
文章目录