fix bwr display

This commit is contained in:
Shuanglei Tao
2024-11-16 00:04:23 +08:00
parent 32eb020b62
commit 107f639b0b
4 changed files with 5 additions and 19 deletions

View File

@@ -92,7 +92,7 @@ function canvas2bytes(canvas, type='bw') {
if (type !== 'bwr') {
buffer.push(imageData.data[index] > 0 && imageData.data[index+1] > 0 && imageData.data[index+2] > 0 ? 1 : 0);
} else {
buffer.push(imageData.data[index] > 0 && imageData.data[index+1] === 0 && imageData.data[index+2] === 0 ? 1 : 0);
buffer.push(imageData.data[index] > 0 && imageData.data[index+1] === 0 && imageData.data[index+2] === 0 ? 0 : 1);
}
if (buffer.length === 8) {