djvu-rs 0.32.0 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/djvu_rs.d.ts +11 -11
- package/package.json +1 -1
- package/scalar/djvu_rs.d.ts +11 -11
- package/scalar/djvu_rs.js +23 -23
- package/scalar/djvu_rs_bg.wasm +0 -0
- package/simd128/djvu_rs.d.ts +11 -11
- package/simd128/djvu_rs.js +23 -23
- package/simd128/djvu_rs_bg.wasm +0 -0
package/djvu_rs.d.ts
CHANGED
|
@@ -23,16 +23,16 @@ export class WasmDocument {
|
|
|
23
23
|
* Throws a JavaScript `Error` if the bytes are not a valid DjVu file.
|
|
24
24
|
*/
|
|
25
25
|
static from_bytes(data: Uint8Array): WasmDocument;
|
|
26
|
-
/**
|
|
27
|
-
* Total number of pages in the document.
|
|
28
|
-
*/
|
|
29
|
-
page_count(): number;
|
|
30
26
|
/**
|
|
31
27
|
* Return a handle to page `index` (0-based).
|
|
32
28
|
*
|
|
33
29
|
* Throws if `index >= page_count()`.
|
|
34
30
|
*/
|
|
35
31
|
page(index: number): WasmPage;
|
|
32
|
+
/**
|
|
33
|
+
* Total number of pages in the document.
|
|
34
|
+
*/
|
|
35
|
+
page_count(): number;
|
|
36
36
|
/**
|
|
37
37
|
* Render a contiguous batch of pages at `target_dpi`, returning one
|
|
38
38
|
* [`WasmPixmap`] per page in input order (#610).
|
|
@@ -72,6 +72,13 @@ export class WasmPage {
|
|
|
72
72
|
* Output height in pixels when rendered at `target_dpi`.
|
|
73
73
|
*/
|
|
74
74
|
height_at(target_dpi: number): number;
|
|
75
|
+
/**
|
|
76
|
+
* Render the page at `target_dpi` and return raw RGBA pixels
|
|
77
|
+
* (`Uint8ClampedArray`, suitable for `new ImageData(pixels, w, h)`).
|
|
78
|
+
*
|
|
79
|
+
* Throws on decode error.
|
|
80
|
+
*/
|
|
81
|
+
render(target_dpi: number): Uint8ClampedArray;
|
|
75
82
|
/**
|
|
76
83
|
* Fast coarse render — decodes only the first BG44 chunk (~5 ms for a
|
|
77
84
|
* typical color page).
|
|
@@ -84,13 +91,6 @@ export class WasmPage {
|
|
|
84
91
|
* Throws on decode error.
|
|
85
92
|
*/
|
|
86
93
|
render_coarse(target_dpi: number): Uint8ClampedArray | undefined;
|
|
87
|
-
/**
|
|
88
|
-
* Render the page at `target_dpi` and return raw RGBA pixels
|
|
89
|
-
* (`Uint8ClampedArray`, suitable for `new ImageData(pixels, w, h)`).
|
|
90
|
-
*
|
|
91
|
-
* Throws on decode error.
|
|
92
|
-
*/
|
|
93
|
-
render(target_dpi: number): Uint8ClampedArray;
|
|
94
94
|
/**
|
|
95
95
|
* Render into a caller-owned [`WasmPixmap`], reusing its Rust-side
|
|
96
96
|
* allocation (#611). No JS-side allocation, no wasm→JS copy — consume
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "djvu-rs",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "Read, render, convert, and create DjVu files. Pure-Rust DjVu decoder/encoder with CLI, WebAssembly, and Python bindings. DjVu to PDF, EPUB, TIFF, PNG, and text. MIT licensed, no GPL dependencies.",
|
|
5
|
-
"version": "0.32.
|
|
5
|
+
"version": "0.32.1",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
package/scalar/djvu_rs.d.ts
CHANGED
|
@@ -23,16 +23,16 @@ export class WasmDocument {
|
|
|
23
23
|
* Throws a JavaScript `Error` if the bytes are not a valid DjVu file.
|
|
24
24
|
*/
|
|
25
25
|
static from_bytes(data: Uint8Array): WasmDocument;
|
|
26
|
-
/**
|
|
27
|
-
* Total number of pages in the document.
|
|
28
|
-
*/
|
|
29
|
-
page_count(): number;
|
|
30
26
|
/**
|
|
31
27
|
* Return a handle to page `index` (0-based).
|
|
32
28
|
*
|
|
33
29
|
* Throws if `index >= page_count()`.
|
|
34
30
|
*/
|
|
35
31
|
page(index: number): WasmPage;
|
|
32
|
+
/**
|
|
33
|
+
* Total number of pages in the document.
|
|
34
|
+
*/
|
|
35
|
+
page_count(): number;
|
|
36
36
|
/**
|
|
37
37
|
* Render a contiguous batch of pages at `target_dpi`, returning one
|
|
38
38
|
* [`WasmPixmap`] per page in input order (#610).
|
|
@@ -72,6 +72,13 @@ export class WasmPage {
|
|
|
72
72
|
* Output height in pixels when rendered at `target_dpi`.
|
|
73
73
|
*/
|
|
74
74
|
height_at(target_dpi: number): number;
|
|
75
|
+
/**
|
|
76
|
+
* Render the page at `target_dpi` and return raw RGBA pixels
|
|
77
|
+
* (`Uint8ClampedArray`, suitable for `new ImageData(pixels, w, h)`).
|
|
78
|
+
*
|
|
79
|
+
* Throws on decode error.
|
|
80
|
+
*/
|
|
81
|
+
render(target_dpi: number): Uint8ClampedArray;
|
|
75
82
|
/**
|
|
76
83
|
* Fast coarse render — decodes only the first BG44 chunk (~5 ms for a
|
|
77
84
|
* typical color page).
|
|
@@ -84,13 +91,6 @@ export class WasmPage {
|
|
|
84
91
|
* Throws on decode error.
|
|
85
92
|
*/
|
|
86
93
|
render_coarse(target_dpi: number): Uint8ClampedArray | undefined;
|
|
87
|
-
/**
|
|
88
|
-
* Render the page at `target_dpi` and return raw RGBA pixels
|
|
89
|
-
* (`Uint8ClampedArray`, suitable for `new ImageData(pixels, w, h)`).
|
|
90
|
-
*
|
|
91
|
-
* Throws on decode error.
|
|
92
|
-
*/
|
|
93
|
-
render(target_dpi: number): Uint8ClampedArray;
|
|
94
94
|
/**
|
|
95
95
|
* Render into a caller-owned [`WasmPixmap`], reusing its Rust-side
|
|
96
96
|
* allocation (#611). No JS-side allocation, no wasm→JS copy — consume
|
package/scalar/djvu_rs.js
CHANGED
|
@@ -45,14 +45,6 @@ export class WasmDocument {
|
|
|
45
45
|
}
|
|
46
46
|
return WasmDocument.__wrap(ret[0]);
|
|
47
47
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Total number of pages in the document.
|
|
50
|
-
* @returns {number}
|
|
51
|
-
*/
|
|
52
|
-
page_count() {
|
|
53
|
-
const ret = wasm.wasmdocument_page_count(this.__wbg_ptr);
|
|
54
|
-
return ret >>> 0;
|
|
55
|
-
}
|
|
56
48
|
/**
|
|
57
49
|
* Return a handle to page `index` (0-based).
|
|
58
50
|
*
|
|
@@ -67,6 +59,14 @@ export class WasmDocument {
|
|
|
67
59
|
}
|
|
68
60
|
return WasmPage.__wrap(ret[0]);
|
|
69
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Total number of pages in the document.
|
|
64
|
+
* @returns {number}
|
|
65
|
+
*/
|
|
66
|
+
page_count() {
|
|
67
|
+
const ret = wasm.wasmdocument_page_count(this.__wbg_ptr);
|
|
68
|
+
return ret >>> 0;
|
|
69
|
+
}
|
|
70
70
|
/**
|
|
71
71
|
* Render a contiguous batch of pages at `target_dpi`, returning one
|
|
72
72
|
* [`WasmPixmap`] per page in input order (#610).
|
|
@@ -146,35 +146,35 @@ export class WasmPage {
|
|
|
146
146
|
return ret >>> 0;
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* Returns `undefined` for bilevel-only pages (no BG44 data); use
|
|
153
|
-
* [`render`] for those. For color pages the result is a blurry but
|
|
154
|
-
* instantly visible preview; call [`render_progressive`] or [`render`]
|
|
155
|
-
* on a Web Worker to produce the final image.
|
|
149
|
+
* Render the page at `target_dpi` and return raw RGBA pixels
|
|
150
|
+
* (`Uint8ClampedArray`, suitable for `new ImageData(pixels, w, h)`).
|
|
156
151
|
*
|
|
157
152
|
* Throws on decode error.
|
|
158
153
|
* @param {number} target_dpi
|
|
159
|
-
* @returns {Uint8ClampedArray
|
|
154
|
+
* @returns {Uint8ClampedArray}
|
|
160
155
|
*/
|
|
161
|
-
|
|
162
|
-
const ret = wasm.
|
|
156
|
+
render(target_dpi) {
|
|
157
|
+
const ret = wasm.wasmpage_render(this.__wbg_ptr, target_dpi);
|
|
163
158
|
if (ret[2]) {
|
|
164
159
|
throw takeFromExternrefTable0(ret[1]);
|
|
165
160
|
}
|
|
166
161
|
return takeFromExternrefTable0(ret[0]);
|
|
167
162
|
}
|
|
168
163
|
/**
|
|
169
|
-
*
|
|
170
|
-
*
|
|
164
|
+
* Fast coarse render — decodes only the first BG44 chunk (~5 ms for a
|
|
165
|
+
* typical color page).
|
|
166
|
+
*
|
|
167
|
+
* Returns `undefined` for bilevel-only pages (no BG44 data); use
|
|
168
|
+
* [`render`] for those. For color pages the result is a blurry but
|
|
169
|
+
* instantly visible preview; call [`render_progressive`] or [`render`]
|
|
170
|
+
* on a Web Worker to produce the final image.
|
|
171
171
|
*
|
|
172
172
|
* Throws on decode error.
|
|
173
173
|
* @param {number} target_dpi
|
|
174
|
-
* @returns {Uint8ClampedArray}
|
|
174
|
+
* @returns {Uint8ClampedArray | undefined}
|
|
175
175
|
*/
|
|
176
|
-
|
|
177
|
-
const ret = wasm.
|
|
176
|
+
render_coarse(target_dpi) {
|
|
177
|
+
const ret = wasm.wasmpage_render_coarse(this.__wbg_ptr, target_dpi);
|
|
178
178
|
if (ret[2]) {
|
|
179
179
|
throw takeFromExternrefTable0(ret[1]);
|
|
180
180
|
}
|
package/scalar/djvu_rs_bg.wasm
CHANGED
|
Binary file
|
package/simd128/djvu_rs.d.ts
CHANGED
|
@@ -23,16 +23,16 @@ export class WasmDocument {
|
|
|
23
23
|
* Throws a JavaScript `Error` if the bytes are not a valid DjVu file.
|
|
24
24
|
*/
|
|
25
25
|
static from_bytes(data: Uint8Array): WasmDocument;
|
|
26
|
-
/**
|
|
27
|
-
* Total number of pages in the document.
|
|
28
|
-
*/
|
|
29
|
-
page_count(): number;
|
|
30
26
|
/**
|
|
31
27
|
* Return a handle to page `index` (0-based).
|
|
32
28
|
*
|
|
33
29
|
* Throws if `index >= page_count()`.
|
|
34
30
|
*/
|
|
35
31
|
page(index: number): WasmPage;
|
|
32
|
+
/**
|
|
33
|
+
* Total number of pages in the document.
|
|
34
|
+
*/
|
|
35
|
+
page_count(): number;
|
|
36
36
|
/**
|
|
37
37
|
* Render a contiguous batch of pages at `target_dpi`, returning one
|
|
38
38
|
* [`WasmPixmap`] per page in input order (#610).
|
|
@@ -72,6 +72,13 @@ export class WasmPage {
|
|
|
72
72
|
* Output height in pixels when rendered at `target_dpi`.
|
|
73
73
|
*/
|
|
74
74
|
height_at(target_dpi: number): number;
|
|
75
|
+
/**
|
|
76
|
+
* Render the page at `target_dpi` and return raw RGBA pixels
|
|
77
|
+
* (`Uint8ClampedArray`, suitable for `new ImageData(pixels, w, h)`).
|
|
78
|
+
*
|
|
79
|
+
* Throws on decode error.
|
|
80
|
+
*/
|
|
81
|
+
render(target_dpi: number): Uint8ClampedArray;
|
|
75
82
|
/**
|
|
76
83
|
* Fast coarse render — decodes only the first BG44 chunk (~5 ms for a
|
|
77
84
|
* typical color page).
|
|
@@ -84,13 +91,6 @@ export class WasmPage {
|
|
|
84
91
|
* Throws on decode error.
|
|
85
92
|
*/
|
|
86
93
|
render_coarse(target_dpi: number): Uint8ClampedArray | undefined;
|
|
87
|
-
/**
|
|
88
|
-
* Render the page at `target_dpi` and return raw RGBA pixels
|
|
89
|
-
* (`Uint8ClampedArray`, suitable for `new ImageData(pixels, w, h)`).
|
|
90
|
-
*
|
|
91
|
-
* Throws on decode error.
|
|
92
|
-
*/
|
|
93
|
-
render(target_dpi: number): Uint8ClampedArray;
|
|
94
94
|
/**
|
|
95
95
|
* Render into a caller-owned [`WasmPixmap`], reusing its Rust-side
|
|
96
96
|
* allocation (#611). No JS-side allocation, no wasm→JS copy — consume
|
package/simd128/djvu_rs.js
CHANGED
|
@@ -45,14 +45,6 @@ export class WasmDocument {
|
|
|
45
45
|
}
|
|
46
46
|
return WasmDocument.__wrap(ret[0]);
|
|
47
47
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Total number of pages in the document.
|
|
50
|
-
* @returns {number}
|
|
51
|
-
*/
|
|
52
|
-
page_count() {
|
|
53
|
-
const ret = wasm.wasmdocument_page_count(this.__wbg_ptr);
|
|
54
|
-
return ret >>> 0;
|
|
55
|
-
}
|
|
56
48
|
/**
|
|
57
49
|
* Return a handle to page `index` (0-based).
|
|
58
50
|
*
|
|
@@ -67,6 +59,14 @@ export class WasmDocument {
|
|
|
67
59
|
}
|
|
68
60
|
return WasmPage.__wrap(ret[0]);
|
|
69
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Total number of pages in the document.
|
|
64
|
+
* @returns {number}
|
|
65
|
+
*/
|
|
66
|
+
page_count() {
|
|
67
|
+
const ret = wasm.wasmdocument_page_count(this.__wbg_ptr);
|
|
68
|
+
return ret >>> 0;
|
|
69
|
+
}
|
|
70
70
|
/**
|
|
71
71
|
* Render a contiguous batch of pages at `target_dpi`, returning one
|
|
72
72
|
* [`WasmPixmap`] per page in input order (#610).
|
|
@@ -146,35 +146,35 @@ export class WasmPage {
|
|
|
146
146
|
return ret >>> 0;
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* Returns `undefined` for bilevel-only pages (no BG44 data); use
|
|
153
|
-
* [`render`] for those. For color pages the result is a blurry but
|
|
154
|
-
* instantly visible preview; call [`render_progressive`] or [`render`]
|
|
155
|
-
* on a Web Worker to produce the final image.
|
|
149
|
+
* Render the page at `target_dpi` and return raw RGBA pixels
|
|
150
|
+
* (`Uint8ClampedArray`, suitable for `new ImageData(pixels, w, h)`).
|
|
156
151
|
*
|
|
157
152
|
* Throws on decode error.
|
|
158
153
|
* @param {number} target_dpi
|
|
159
|
-
* @returns {Uint8ClampedArray
|
|
154
|
+
* @returns {Uint8ClampedArray}
|
|
160
155
|
*/
|
|
161
|
-
|
|
162
|
-
const ret = wasm.
|
|
156
|
+
render(target_dpi) {
|
|
157
|
+
const ret = wasm.wasmpage_render(this.__wbg_ptr, target_dpi);
|
|
163
158
|
if (ret[2]) {
|
|
164
159
|
throw takeFromExternrefTable0(ret[1]);
|
|
165
160
|
}
|
|
166
161
|
return takeFromExternrefTable0(ret[0]);
|
|
167
162
|
}
|
|
168
163
|
/**
|
|
169
|
-
*
|
|
170
|
-
*
|
|
164
|
+
* Fast coarse render — decodes only the first BG44 chunk (~5 ms for a
|
|
165
|
+
* typical color page).
|
|
166
|
+
*
|
|
167
|
+
* Returns `undefined` for bilevel-only pages (no BG44 data); use
|
|
168
|
+
* [`render`] for those. For color pages the result is a blurry but
|
|
169
|
+
* instantly visible preview; call [`render_progressive`] or [`render`]
|
|
170
|
+
* on a Web Worker to produce the final image.
|
|
171
171
|
*
|
|
172
172
|
* Throws on decode error.
|
|
173
173
|
* @param {number} target_dpi
|
|
174
|
-
* @returns {Uint8ClampedArray}
|
|
174
|
+
* @returns {Uint8ClampedArray | undefined}
|
|
175
175
|
*/
|
|
176
|
-
|
|
177
|
-
const ret = wasm.
|
|
176
|
+
render_coarse(target_dpi) {
|
|
177
|
+
const ret = wasm.wasmpage_render_coarse(this.__wbg_ptr, target_dpi);
|
|
178
178
|
if (ret[2]) {
|
|
179
179
|
throw takeFromExternrefTable0(ret[1]);
|
|
180
180
|
}
|
package/simd128/djvu_rs_bg.wasm
CHANGED
|
Binary file
|