Test correct handling of alpha

The forth byte of a pixel is undefined in most encodings, so make sure
the decoders don't leak that through as an alpha channel.
This commit is contained in:
Pierre Ossman
2020-06-08 07:40:56 +02:00
committed by Lauri Kasanen
parent 5752bf8ab7
commit 55178c76b8
2 changed files with 20 additions and 19 deletions

View File

@@ -52,19 +52,19 @@ describe('RRE Decoder', function () {
it('should handle the RRE encoding', function () {
let data = [];
push32(data, 2); // 2 subrects
push32(data, 0xff00ff); // becomes 00ff00ff --> #00FF00 bg color
data.push(0xff); // becomes ff0000ff --> #0000FF color
push32(data, 0x00ff0000); // becomes 00ff0000 --> #00FF00 bg color
data.push(0xff); // becomes ff000000 --> #0000FF color
data.push(0x00);
data.push(0x00);
data.push(0x00);
data.push(0xff);
push16(data, 0); // x: 0
push16(data, 0); // y: 0
push16(data, 2); // width: 2
push16(data, 2); // height: 2
data.push(0xff); // becomes ff0000ff --> #0000FF color
data.push(0xff); // becomes ff000000 --> #0000FF color
data.push(0x00);
data.push(0x00);
data.push(0x00);
data.push(0xff);
push16(data, 2); // x: 2
push16(data, 2); // y: 2
push16(data, 2); // width: 2