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), "读入像素点中"): for currentRow in tqdm(range(height), "读入像素点中"):
currentCol = 0 currentCol = 0
while (currentCol < width * (bpp // 8)): while (currentCol < width * (bpp // 8)):
index = dataStart + currentRow * rowLength + currentCol
if (bpp == 32): if (bpp == 32):
pixels[currentRow].append({ pixels[currentRow].append({
'r': 'r': imgBytes[index],
imgBytes[dataStart + currentRow * rowLength + currentCol], 'g': imgBytes[index + 1],
'g': 'b': imgBytes[index + 2],
imgBytes[dataStart + currentRow * rowLength + currentCol + 1], 'a': imgBytes[index + 3]
'b':
imgBytes[dataStart + currentRow * rowLength + currentCol + 2],
'a':
imgBytes[dataStart + currentRow * rowLength + currentCol + 3]
}) })
currentCol += bpp // 8 currentCol += bpp // 8
else: else:
pixels[currentRow].append({ pixels[currentRow].append({
'r': 'r': imgBytes[index],
imgBytes[dataStart + currentRow * rowLength + currentCol], 'g': imgBytes[index + 1],
'g': 'b': imgBytes[index + 2],
imgBytes[dataStart + currentRow * rowLength + currentCol + 1], 'a': 0
'b':
imgBytes[dataStart + currentRow * rowLength + currentCol + 2],
'a':
0
}) })
currentCol += bpp // 8 currentCol += bpp // 8
# 读入图片为像素数组完成 # 读入图片为像素数组完成