mirror of
https://github.com/bspeice/speice.io
synced 2024-12-22 16:48:10 -05:00
Fix transparency for black-and-white rendering
This commit is contained in:
parent
ce4fdd154a
commit
ea946b2ae9
@ -46,7 +46,7 @@ class AccumulateBinary extends Accumulator {
|
||||
image.data[iIdx + 0] = value;
|
||||
image.data[iIdx + 1] = value;
|
||||
image.data[iIdx + 2] = value;
|
||||
image.data[iIdx + 3] = 0xff;
|
||||
image.data[iIdx + 3] = value ? 0xff : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ export class AccumulateLinear extends Accumulator {
|
||||
image.data[iIdx + 0] = value;
|
||||
image.data[iIdx + 1] = value;
|
||||
image.data[iIdx + 2] = value;
|
||||
image.data[iIdx + 3] = 0xff;
|
||||
image.data[iIdx + 3] = 0xff - value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ export class AccumulateLogarithmic extends Accumulator {
|
||||
image.data[iIdx + 0] = value;
|
||||
image.data[iIdx + 1] = value;
|
||||
image.data[iIdx + 2] = value;
|
||||
image.data[iIdx + 3] = 0xff;
|
||||
image.data[iIdx + 3] = 0xff - value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ export default function () {
|
||||
});
|
||||
return (
|
||||
<Layout>
|
||||
{/* <div>
|
||||
<div>
|
||||
<Canvas f={gasket} />
|
||||
<Canvas f={renderBaseline} />
|
||||
</div>
|
||||
@ -33,10 +33,10 @@ export default function () {
|
||||
<div>
|
||||
<Canvas f={renderLinear} />
|
||||
<Canvas f={renderLogarithmic} />
|
||||
</div> */}
|
||||
<Canvas f={renderTransform1} />
|
||||
</div>
|
||||
{/* <Canvas f={renderTransform1} />
|
||||
<Canvas f={renderTransform2} />
|
||||
<Canvas f={renderTransform3} />
|
||||
<Canvas f={renderTransform3} /> */}
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user