1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

[api-minor] Add a jpx decoder based on OpenJPEG 2.5.2

The decoder is compiled in WASM:
https://github.com/mozilla/pdf.js.openjpeg

Fixes #17289, #17061, #16485, #13051, #6365, #4648, #12213.
This commit is contained in:
Calixte Denizet 2024-04-15 10:12:05 +02:00
parent 2e94511330
commit 2e83cfbbc1
20 changed files with 172 additions and 2347 deletions

View file

@ -73,7 +73,7 @@ class DecodeStream extends BaseStream {
return this.buffer[this.pos++];
}
getBytes(length) {
getBytes(length, ignoreColorSpace = false) {
const pos = this.pos;
let end;
@ -82,7 +82,7 @@ class DecodeStream extends BaseStream {
end = pos + length;
while (!this.eof && this.bufferLength < end) {
this.readBlock();
this.readBlock(ignoreColorSpace);
}
const bufEnd = this.bufferLength;
if (end > bufEnd) {
@ -90,7 +90,7 @@ class DecodeStream extends BaseStream {
}
} else {
while (!this.eof) {
this.readBlock();
this.readBlock(ignoreColorSpace);
}
end = this.bufferLength;
}