djvu-rs 0.31.0 → 0.32.0
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;
|
|
26
30
|
/**
|
|
27
31
|
* Return a handle to page `index` (0-based).
|
|
28
32
|
*
|
|
29
33
|
* Throws if `index >= page_count()`.
|
|
30
34
|
*/
|
|
31
35
|
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,13 +72,6 @@ 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;
|
|
82
75
|
/**
|
|
83
76
|
* Fast coarse render — decodes only the first BG44 chunk (~5 ms for a
|
|
84
77
|
* typical color page).
|
|
@@ -91,6 +84,13 @@ export class WasmPage {
|
|
|
91
84
|
* Throws on decode error.
|
|
92
85
|
*/
|
|
93
86
|
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.
|
|
5
|
+
"version": "0.32.0",
|
|
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;
|
|
26
30
|
/**
|
|
27
31
|
* Return a handle to page `index` (0-based).
|
|
28
32
|
*
|
|
29
33
|
* Throws if `index >= page_count()`.
|
|
30
34
|
*/
|
|
31
35
|
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,13 +72,6 @@ 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;
|
|
82
75
|
/**
|
|
83
76
|
* Fast coarse render — decodes only the first BG44 chunk (~5 ms for a
|
|
84
77
|
* typical color page).
|
|
@@ -91,6 +84,13 @@ export class WasmPage {
|
|
|
91
84
|
* Throws on decode error.
|
|
92
85
|
*/
|
|
93
86
|
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,6 +45,14 @@ 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
|
+
}
|
|
48
56
|
/**
|
|
49
57
|
* Return a handle to page `index` (0-based).
|
|
50
58
|
*
|
|
@@ -59,14 +67,6 @@ export class WasmDocument {
|
|
|
59
67
|
}
|
|
60
68
|
return WasmPage.__wrap(ret[0]);
|
|
61
69
|
}
|
|
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).
|
|
@@ -145,21 +145,6 @@ export class WasmPage {
|
|
|
145
145
|
const ret = wasm.wasmpage_height_at(this.__wbg_ptr, target_dpi);
|
|
146
146
|
return ret >>> 0;
|
|
147
147
|
}
|
|
148
|
-
/**
|
|
149
|
-
* Render the page at `target_dpi` and return raw RGBA pixels
|
|
150
|
-
* (`Uint8ClampedArray`, suitable for `new ImageData(pixels, w, h)`).
|
|
151
|
-
*
|
|
152
|
-
* Throws on decode error.
|
|
153
|
-
* @param {number} target_dpi
|
|
154
|
-
* @returns {Uint8ClampedArray}
|
|
155
|
-
*/
|
|
156
|
-
render(target_dpi) {
|
|
157
|
-
const ret = wasm.wasmpage_render(this.__wbg_ptr, target_dpi);
|
|
158
|
-
if (ret[2]) {
|
|
159
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
160
|
-
}
|
|
161
|
-
return takeFromExternrefTable0(ret[0]);
|
|
162
|
-
}
|
|
163
148
|
/**
|
|
164
149
|
* Fast coarse render — decodes only the first BG44 chunk (~5 ms for a
|
|
165
150
|
* typical color page).
|
|
@@ -180,6 +165,21 @@ export class WasmPage {
|
|
|
180
165
|
}
|
|
181
166
|
return takeFromExternrefTable0(ret[0]);
|
|
182
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Render the page at `target_dpi` and return raw RGBA pixels
|
|
170
|
+
* (`Uint8ClampedArray`, suitable for `new ImageData(pixels, w, h)`).
|
|
171
|
+
*
|
|
172
|
+
* Throws on decode error.
|
|
173
|
+
* @param {number} target_dpi
|
|
174
|
+
* @returns {Uint8ClampedArray}
|
|
175
|
+
*/
|
|
176
|
+
render(target_dpi) {
|
|
177
|
+
const ret = wasm.wasmpage_render(this.__wbg_ptr, target_dpi);
|
|
178
|
+
if (ret[2]) {
|
|
179
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
180
|
+
}
|
|
181
|
+
return takeFromExternrefTable0(ret[0]);
|
|
182
|
+
}
|
|
183
183
|
/**
|
|
184
184
|
* Render into a caller-owned [`WasmPixmap`], reusing its Rust-side
|
|
185
185
|
* allocation (#611). No JS-side allocation, no wasm→JS copy — consume
|
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;
|
|
26
30
|
/**
|
|
27
31
|
* Return a handle to page `index` (0-based).
|
|
28
32
|
*
|
|
29
33
|
* Throws if `index >= page_count()`.
|
|
30
34
|
*/
|
|
31
35
|
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,13 +72,6 @@ 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;
|
|
82
75
|
/**
|
|
83
76
|
* Fast coarse render — decodes only the first BG44 chunk (~5 ms for a
|
|
84
77
|
* typical color page).
|
|
@@ -91,6 +84,13 @@ export class WasmPage {
|
|
|
91
84
|
* Throws on decode error.
|
|
92
85
|
*/
|
|
93
86
|
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,6 +45,14 @@ 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
|
+
}
|
|
48
56
|
/**
|
|
49
57
|
* Return a handle to page `index` (0-based).
|
|
50
58
|
*
|
|
@@ -59,14 +67,6 @@ export class WasmDocument {
|
|
|
59
67
|
}
|
|
60
68
|
return WasmPage.__wrap(ret[0]);
|
|
61
69
|
}
|
|
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).
|
|
@@ -145,21 +145,6 @@ export class WasmPage {
|
|
|
145
145
|
const ret = wasm.wasmpage_height_at(this.__wbg_ptr, target_dpi);
|
|
146
146
|
return ret >>> 0;
|
|
147
147
|
}
|
|
148
|
-
/**
|
|
149
|
-
* Render the page at `target_dpi` and return raw RGBA pixels
|
|
150
|
-
* (`Uint8ClampedArray`, suitable for `new ImageData(pixels, w, h)`).
|
|
151
|
-
*
|
|
152
|
-
* Throws on decode error.
|
|
153
|
-
* @param {number} target_dpi
|
|
154
|
-
* @returns {Uint8ClampedArray}
|
|
155
|
-
*/
|
|
156
|
-
render(target_dpi) {
|
|
157
|
-
const ret = wasm.wasmpage_render(this.__wbg_ptr, target_dpi);
|
|
158
|
-
if (ret[2]) {
|
|
159
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
160
|
-
}
|
|
161
|
-
return takeFromExternrefTable0(ret[0]);
|
|
162
|
-
}
|
|
163
148
|
/**
|
|
164
149
|
* Fast coarse render — decodes only the first BG44 chunk (~5 ms for a
|
|
165
150
|
* typical color page).
|
|
@@ -180,6 +165,21 @@ export class WasmPage {
|
|
|
180
165
|
}
|
|
181
166
|
return takeFromExternrefTable0(ret[0]);
|
|
182
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Render the page at `target_dpi` and return raw RGBA pixels
|
|
170
|
+
* (`Uint8ClampedArray`, suitable for `new ImageData(pixels, w, h)`).
|
|
171
|
+
*
|
|
172
|
+
* Throws on decode error.
|
|
173
|
+
* @param {number} target_dpi
|
|
174
|
+
* @returns {Uint8ClampedArray}
|
|
175
|
+
*/
|
|
176
|
+
render(target_dpi) {
|
|
177
|
+
const ret = wasm.wasmpage_render(this.__wbg_ptr, target_dpi);
|
|
178
|
+
if (ret[2]) {
|
|
179
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
180
|
+
}
|
|
181
|
+
return takeFromExternrefTable0(ret[0]);
|
|
182
|
+
}
|
|
183
183
|
/**
|
|
184
184
|
* Render into a caller-owned [`WasmPixmap`], reusing its Rust-side
|
|
185
185
|
* allocation (#611). No JS-side allocation, no wasm→JS copy — consume
|
package/simd128/djvu_rs_bg.wasm
CHANGED
|
Binary file
|