latex过宽,小修改
This commit is contained in:
parent
8e6baef7dc
commit
6dde739b22
25
main.py
25
main.py
|
@ -173,28 +173,21 @@ i = dataStart
|
|||
for currentRow in tqdm(range(height), "读入像素点中"):
|
||||
currentCol = 0
|
||||
while (currentCol < width * (bpp // 8)):
|
||||
index = dataStart + currentRow * rowLength + currentCol
|
||||
if (bpp == 32):
|
||||
pixels[currentRow].append({
|
||||
'r':
|
||||
imgBytes[dataStart + currentRow * rowLength + currentCol],
|
||||
'g':
|
||||
imgBytes[dataStart + currentRow * rowLength + currentCol + 1],
|
||||
'b':
|
||||
imgBytes[dataStart + currentRow * rowLength + currentCol + 2],
|
||||
'a':
|
||||
imgBytes[dataStart + currentRow * rowLength + currentCol + 3]
|
||||
'r': imgBytes[index],
|
||||
'g': imgBytes[index + 1],
|
||||
'b': imgBytes[index + 2],
|
||||
'a': imgBytes[index + 3]
|
||||
})
|
||||
currentCol += bpp // 8
|
||||
else:
|
||||
pixels[currentRow].append({
|
||||
'r':
|
||||
imgBytes[dataStart + currentRow * rowLength + currentCol],
|
||||
'g':
|
||||
imgBytes[dataStart + currentRow * rowLength + currentCol + 1],
|
||||
'b':
|
||||
imgBytes[dataStart + currentRow * rowLength + currentCol + 2],
|
||||
'a':
|
||||
0
|
||||
'r': imgBytes[index],
|
||||
'g': imgBytes[index + 1],
|
||||
'b': imgBytes[index + 2],
|
||||
'a': 0
|
||||
})
|
||||
currentCol += bpp // 8
|
||||
# 读入图片为像素数组完成
|
||||
|
|
Loading…
Reference in New Issue