latex过宽,小修改

This commit is contained in:
Luthics 2023-01-16 17:45:10 +08:00
parent 8e6baef7dc
commit 6dde739b22
1 changed files with 9 additions and 16 deletions

25
main.py
View File

@ -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
# 读入图片为像素数组完成