Reduce color bleeding on Black

This commit is contained in:
Tamas Rudnai 2020-02-28 21:57:23 -08:00
parent 06b911be9c
commit 3a01ee2934

View File

@ -496,7 +496,12 @@ class HiRes: NSView {
HiRes.pixels[pixelAddr + 4 + A] = 0x00;
case 0x02: // green
if (prev == 0x02) || (prev == 0x06) || (prev == 0x03) || (prev == 0x07) || (prev == 0x00) || (prev == 0x04) {
if (prev == 0x02) ||
(prev == 0x06) ||
(prev == 0x03) || (prev == 0x07) ||
(prev == 0x00) || (prev == 0x04) ||
(prev == 0x04)
{
HiRes.pixels[pixelAddr + R] = 0x08;
HiRes.pixels[pixelAddr + G] = 0xA2;
HiRes.pixels[pixelAddr + B] = 0x12;
@ -510,7 +515,9 @@ class HiRes: NSView {
}
// reducing color bleeding
if (prev == 0x01) || (prev == 0x05) {
if (prev == 0x01) ||
(prev == 0x05)
{
HiRes.pixels[pixelAddr + 4 + R] = 0x00;
HiRes.pixels[pixelAddr + 4 + G] = 0x00;
HiRes.pixels[pixelAddr + 4 + B] = 0x00;
@ -558,7 +565,9 @@ class HiRes: NSView {
case 0x06: // orange
// do we need to extend the color?
if (prev == 0x06) || (prev == 0x03) || (prev == 0x07) {
if (prev == 0x06) ||
(prev == 0x03) || (prev == 0x07)
{
HiRes.pixels[pixelAddr + R] = 0xEE;
HiRes.pixels[pixelAddr + G] = 0x22;
HiRes.pixels[pixelAddr + B] = 0x11;
@ -622,7 +631,11 @@ class HiRes: NSView {
}
// purple adjustment -- followed by white
else if (prev == 0x01) && ( (pixel == 0x01) || (pixel == 0x03) || (pixel == 0x07) || (pixel == 0x00) || (pixel == 0x04) ) {
else if (prev == 0x01) && (
(pixel == 0x01) || (pixel == 0x03) ||
(pixel == 0x07) || (pixel == 0x00) ||
(pixel == 0x04)
) {
// was the previous purple pixel promoted to white or is it still purple?
if ( HiRes.pixels[pixelAddr - 8 + R] == 0xBB ) {
HiRes.pixels[pixelAddr - 4 + R] = 0xBB;
@ -633,7 +646,10 @@ class HiRes: NSView {
}
// blue adjustment
else if (prev == 0x05) && ( (pixel == 0x05) || (pixel == 0x03) || (pixel == 0x07) ) {
else if (prev == 0x05) && (
(pixel == 0x05) ||
(pixel == 0x03) || (pixel == 0x07)
) {
HiRes.pixels[pixelAddr - 4 + R] = 0x11;
HiRes.pixels[pixelAddr - 4 + G] = 0x66;
HiRes.pixels[pixelAddr - 4 + B] = 0xEE;