@thermal-label/brother-ql-core 0.0.1 → 0.2.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/dist/__tests__/colour.test.d.ts +2 -0
- package/dist/__tests__/colour.test.d.ts.map +1 -0
- package/dist/__tests__/colour.test.js +106 -0
- package/dist/__tests__/colour.test.js.map +1 -0
- package/dist/__tests__/devices.test.js +16 -2
- package/dist/__tests__/devices.test.js.map +1 -1
- package/dist/__tests__/media.test.js +17 -6
- package/dist/__tests__/media.test.js.map +1 -1
- package/dist/__tests__/preview.test.d.ts +2 -0
- package/dist/__tests__/preview.test.d.ts.map +1 -0
- package/dist/__tests__/preview.test.js +41 -0
- package/dist/__tests__/preview.test.js.map +1 -0
- package/dist/__tests__/status.test.js +28 -22
- package/dist/__tests__/status.test.js.map +1 -1
- package/dist/colour.d.ts +26 -0
- package/dist/colour.d.ts.map +1 -0
- package/dist/colour.js +84 -0
- package/dist/colour.js.map +1 -0
- package/dist/devices.d.ts +40 -21
- package/dist/devices.d.ts.map +1 -1
- package/dist/devices.js +38 -19
- package/dist/devices.js.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/media.d.ts +31 -4
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +73 -23
- package/dist/media.js.map +1 -1
- package/dist/preview.d.ts +13 -0
- package/dist/preview.d.ts.map +1 -0
- package/dist/preview.js +32 -0
- package/dist/preview.js.map +1 -0
- package/dist/protocol.d.ts +2 -2
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +4 -4
- package/dist/protocol.js.map +1 -1
- package/dist/status.d.ts +20 -2
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +59 -44
- package/dist/status.js.map +1 -1
- package/dist/types.d.ts +36 -30
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -1
- package/package.json +3 -2
- package/src/__tests__/colour.test.ts +126 -0
- package/src/__tests__/devices.test.ts +18 -2
- package/src/__tests__/media.test.ts +17 -6
- package/src/__tests__/preview.test.ts +52 -0
- package/src/__tests__/status.test.ts +31 -22
- package/src/colour.ts +101 -0
- package/src/devices.ts +41 -22
- package/src/index.ts +31 -9
- package/src/media.ts +86 -27
- package/src/preview.ts +34 -0
- package/src/protocol.ts +6 -6
- package/src/status.ts +63 -47
- package/src/types.ts +38 -33
package/dist/media.d.ts
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { type BrotherQLMedia, type MediaType } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Registry of supported Brother QL consumables.
|
|
4
|
+
*
|
|
5
|
+
* Entries are keyed by the firmware media id — the same number the
|
|
6
|
+
* printer reports in the 32-byte status response. `heightMm` is
|
|
7
|
+
* omitted for continuous media (variable length) and set for die-cut
|
|
8
|
+
* labels (fixed length). Only DK-22251 has `colorCapable: true` — the
|
|
9
|
+
* driver uses that to run two-colour plane separation before sending
|
|
10
|
+
* the raster.
|
|
11
|
+
*/
|
|
12
|
+
export declare const MEDIA: Record<number, BrotherQLMedia>;
|
|
13
|
+
/**
|
|
14
|
+
* Default media when `createPreview()` is called without media and
|
|
15
|
+
* without a detected roll. 62mm continuous (DK-22205) is the common
|
|
16
|
+
* single-colour shipping roll.
|
|
17
|
+
*/
|
|
18
|
+
export declare const DEFAULT_MEDIA: BrotherQLMedia;
|
|
19
|
+
export declare function findMedia(id: number): BrotherQLMedia | undefined;
|
|
20
|
+
export declare function findMediaByWidth(widthMm: number, type: MediaType): BrotherQLMedia[];
|
|
21
|
+
/**
|
|
22
|
+
* Match status-response dimensions to a media registry entry.
|
|
23
|
+
*
|
|
24
|
+
* @param widthMm media width in mm (status byte 10)
|
|
25
|
+
* @param heightMm media length in mm (status byte 17) — 0 = continuous
|
|
26
|
+
* @param twoColorMode true when the status response indicates the
|
|
27
|
+
* printer is configured for two-colour media. When
|
|
28
|
+
* both DK-22205 (259) and DK-22251 (251) match the
|
|
29
|
+
* dimensions, the flag picks the right one.
|
|
30
|
+
*/
|
|
31
|
+
export declare function findMediaByDimensions(widthMm: number, heightMm: number, twoColorMode?: boolean): BrotherQLMedia | undefined;
|
|
5
32
|
//# sourceMappingURL=media.d.ts.map
|
package/dist/media.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../src/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../src/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAEjE;;;;;;;;;GASG;AACH,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CA4PhD,CAAC;AAEF;;;;GAIG;AAEH,eAAO,MAAM,aAAa,EAAE,cAA4B,CAAC;AAEzD,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAEhE;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,cAAc,EAAE,CAEnF;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,YAAY,UAAQ,GACnB,cAAc,GAAG,SAAS,CAY5B"}
|
package/dist/media.js
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import {} from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Registry of supported Brother QL consumables.
|
|
4
|
+
*
|
|
5
|
+
* Entries are keyed by the firmware media id — the same number the
|
|
6
|
+
* printer reports in the 32-byte status response. `heightMm` is
|
|
7
|
+
* omitted for continuous media (variable length) and set for die-cut
|
|
8
|
+
* labels (fixed length). Only DK-22251 has `colorCapable: true` — the
|
|
9
|
+
* driver uses that to run two-colour plane separation before sending
|
|
10
|
+
* the raster.
|
|
11
|
+
*/
|
|
2
12
|
export const MEDIA = {
|
|
3
13
|
// Continuous length tape
|
|
4
14
|
257: {
|
|
@@ -6,7 +16,7 @@ export const MEDIA = {
|
|
|
6
16
|
name: '12mm continuous',
|
|
7
17
|
type: 'continuous',
|
|
8
18
|
widthMm: 12,
|
|
9
|
-
|
|
19
|
+
colorCapable: false,
|
|
10
20
|
printAreaDots: 106,
|
|
11
21
|
leftMarginPins: 585,
|
|
12
22
|
rightMarginPins: 29,
|
|
@@ -16,7 +26,7 @@ export const MEDIA = {
|
|
|
16
26
|
name: '29mm continuous (DK-22210)',
|
|
17
27
|
type: 'continuous',
|
|
18
28
|
widthMm: 29,
|
|
19
|
-
|
|
29
|
+
colorCapable: false,
|
|
20
30
|
printAreaDots: 306,
|
|
21
31
|
leftMarginPins: 408,
|
|
22
32
|
rightMarginPins: 6,
|
|
@@ -26,7 +36,7 @@ export const MEDIA = {
|
|
|
26
36
|
name: '38mm continuous (DK-22225)',
|
|
27
37
|
type: 'continuous',
|
|
28
38
|
widthMm: 38,
|
|
29
|
-
|
|
39
|
+
colorCapable: false,
|
|
30
40
|
printAreaDots: 413,
|
|
31
41
|
leftMarginPins: 295,
|
|
32
42
|
rightMarginPins: 12,
|
|
@@ -36,7 +46,7 @@ export const MEDIA = {
|
|
|
36
46
|
name: '50mm continuous (DK-22246)',
|
|
37
47
|
type: 'continuous',
|
|
38
48
|
widthMm: 50,
|
|
39
|
-
|
|
49
|
+
colorCapable: false,
|
|
40
50
|
printAreaDots: 554,
|
|
41
51
|
leftMarginPins: 154,
|
|
42
52
|
rightMarginPins: 12,
|
|
@@ -46,7 +56,7 @@ export const MEDIA = {
|
|
|
46
56
|
name: '54mm continuous (DK-22214)',
|
|
47
57
|
type: 'continuous',
|
|
48
58
|
widthMm: 54,
|
|
49
|
-
|
|
59
|
+
colorCapable: false,
|
|
50
60
|
printAreaDots: 590,
|
|
51
61
|
leftMarginPins: 130,
|
|
52
62
|
rightMarginPins: 0,
|
|
@@ -56,7 +66,7 @@ export const MEDIA = {
|
|
|
56
66
|
name: '62mm continuous (DK-22205)',
|
|
57
67
|
type: 'continuous',
|
|
58
68
|
widthMm: 62,
|
|
59
|
-
|
|
69
|
+
colorCapable: false,
|
|
60
70
|
printAreaDots: 696,
|
|
61
71
|
leftMarginPins: 12,
|
|
62
72
|
rightMarginPins: 12,
|
|
@@ -66,18 +76,17 @@ export const MEDIA = {
|
|
|
66
76
|
name: '62mm continuous two-color (DK-22251)',
|
|
67
77
|
type: 'continuous',
|
|
68
78
|
widthMm: 62,
|
|
69
|
-
|
|
79
|
+
colorCapable: true,
|
|
70
80
|
printAreaDots: 696,
|
|
71
81
|
leftMarginPins: 12,
|
|
72
82
|
rightMarginPins: 12,
|
|
73
|
-
twoColorTape: true,
|
|
74
83
|
},
|
|
75
84
|
260: {
|
|
76
85
|
id: 260,
|
|
77
86
|
name: '102mm continuous (DK-22243)',
|
|
78
87
|
type: 'continuous',
|
|
79
88
|
widthMm: 102,
|
|
80
|
-
|
|
89
|
+
colorCapable: false,
|
|
81
90
|
printAreaDots: 1164,
|
|
82
91
|
leftMarginPins: 76,
|
|
83
92
|
rightMarginPins: 56,
|
|
@@ -88,7 +97,8 @@ export const MEDIA = {
|
|
|
88
97
|
name: '17×54mm die-cut (DK-11204)',
|
|
89
98
|
type: 'die-cut',
|
|
90
99
|
widthMm: 17,
|
|
91
|
-
|
|
100
|
+
heightMm: 54,
|
|
101
|
+
colorCapable: false,
|
|
92
102
|
printAreaDots: 165,
|
|
93
103
|
leftMarginPins: 0,
|
|
94
104
|
rightMarginPins: 0,
|
|
@@ -99,7 +109,8 @@ export const MEDIA = {
|
|
|
99
109
|
name: '17×87mm die-cut (DK-11203)',
|
|
100
110
|
type: 'die-cut',
|
|
101
111
|
widthMm: 17,
|
|
102
|
-
|
|
112
|
+
heightMm: 87,
|
|
113
|
+
colorCapable: false,
|
|
103
114
|
printAreaDots: 165,
|
|
104
115
|
leftMarginPins: 0,
|
|
105
116
|
rightMarginPins: 0,
|
|
@@ -110,7 +121,8 @@ export const MEDIA = {
|
|
|
110
121
|
name: '23×23mm die-cut',
|
|
111
122
|
type: 'die-cut',
|
|
112
123
|
widthMm: 23,
|
|
113
|
-
|
|
124
|
+
heightMm: 23,
|
|
125
|
+
colorCapable: false,
|
|
114
126
|
printAreaDots: 236,
|
|
115
127
|
leftMarginPins: 0,
|
|
116
128
|
rightMarginPins: 0,
|
|
@@ -121,7 +133,8 @@ export const MEDIA = {
|
|
|
121
133
|
name: '29×90mm die-cut (DK-11201)',
|
|
122
134
|
type: 'die-cut',
|
|
123
135
|
widthMm: 29,
|
|
124
|
-
|
|
136
|
+
heightMm: 90,
|
|
137
|
+
colorCapable: false,
|
|
125
138
|
printAreaDots: 306,
|
|
126
139
|
leftMarginPins: 0,
|
|
127
140
|
rightMarginPins: 0,
|
|
@@ -132,7 +145,8 @@ export const MEDIA = {
|
|
|
132
145
|
name: '38×90mm die-cut (DK-11218)',
|
|
133
146
|
type: 'die-cut',
|
|
134
147
|
widthMm: 38,
|
|
135
|
-
|
|
148
|
+
heightMm: 90,
|
|
149
|
+
colorCapable: false,
|
|
136
150
|
printAreaDots: 413,
|
|
137
151
|
leftMarginPins: 0,
|
|
138
152
|
rightMarginPins: 0,
|
|
@@ -143,7 +157,8 @@ export const MEDIA = {
|
|
|
143
157
|
name: '39×48mm die-cut (DK-11219)',
|
|
144
158
|
type: 'die-cut',
|
|
145
159
|
widthMm: 39,
|
|
146
|
-
|
|
160
|
+
heightMm: 48,
|
|
161
|
+
colorCapable: false,
|
|
147
162
|
printAreaDots: 425,
|
|
148
163
|
leftMarginPins: 0,
|
|
149
164
|
rightMarginPins: 0,
|
|
@@ -154,7 +169,8 @@ export const MEDIA = {
|
|
|
154
169
|
name: '52×29mm die-cut',
|
|
155
170
|
type: 'die-cut',
|
|
156
171
|
widthMm: 52,
|
|
157
|
-
|
|
172
|
+
heightMm: 29,
|
|
173
|
+
colorCapable: false,
|
|
158
174
|
printAreaDots: 578,
|
|
159
175
|
leftMarginPins: 0,
|
|
160
176
|
rightMarginPins: 0,
|
|
@@ -165,7 +181,8 @@ export const MEDIA = {
|
|
|
165
181
|
name: '62×29mm die-cut (DK-11209)',
|
|
166
182
|
type: 'die-cut',
|
|
167
183
|
widthMm: 62,
|
|
168
|
-
|
|
184
|
+
heightMm: 29,
|
|
185
|
+
colorCapable: false,
|
|
169
186
|
printAreaDots: 696,
|
|
170
187
|
leftMarginPins: 0,
|
|
171
188
|
rightMarginPins: 0,
|
|
@@ -176,7 +193,8 @@ export const MEDIA = {
|
|
|
176
193
|
name: '62×100mm die-cut (DK-11202)',
|
|
177
194
|
type: 'die-cut',
|
|
178
195
|
widthMm: 62,
|
|
179
|
-
|
|
196
|
+
heightMm: 100,
|
|
197
|
+
colorCapable: false,
|
|
180
198
|
printAreaDots: 696,
|
|
181
199
|
leftMarginPins: 0,
|
|
182
200
|
rightMarginPins: 0,
|
|
@@ -187,7 +205,8 @@ export const MEDIA = {
|
|
|
187
205
|
name: '102×51mm die-cut (DK-11240)',
|
|
188
206
|
type: 'die-cut',
|
|
189
207
|
widthMm: 102,
|
|
190
|
-
|
|
208
|
+
heightMm: 51,
|
|
209
|
+
colorCapable: false,
|
|
191
210
|
printAreaDots: 1164,
|
|
192
211
|
leftMarginPins: 0,
|
|
193
212
|
rightMarginPins: 0,
|
|
@@ -198,7 +217,8 @@ export const MEDIA = {
|
|
|
198
217
|
name: '102×152mm die-cut (DK-11241)',
|
|
199
218
|
type: 'die-cut',
|
|
200
219
|
widthMm: 102,
|
|
201
|
-
|
|
220
|
+
heightMm: 152,
|
|
221
|
+
colorCapable: false,
|
|
202
222
|
printAreaDots: 1164,
|
|
203
223
|
leftMarginPins: 0,
|
|
204
224
|
rightMarginPins: 0,
|
|
@@ -209,7 +229,8 @@ export const MEDIA = {
|
|
|
209
229
|
name: '12mm Ø die-cut',
|
|
210
230
|
type: 'die-cut',
|
|
211
231
|
widthMm: 12,
|
|
212
|
-
|
|
232
|
+
heightMm: 12,
|
|
233
|
+
colorCapable: false,
|
|
213
234
|
printAreaDots: 94,
|
|
214
235
|
leftMarginPins: 0,
|
|
215
236
|
rightMarginPins: 0,
|
|
@@ -220,7 +241,8 @@ export const MEDIA = {
|
|
|
220
241
|
name: '24mm Ø die-cut (DK-11221)',
|
|
221
242
|
type: 'die-cut',
|
|
222
243
|
widthMm: 24,
|
|
223
|
-
|
|
244
|
+
heightMm: 24,
|
|
245
|
+
colorCapable: false,
|
|
224
246
|
printAreaDots: 236,
|
|
225
247
|
leftMarginPins: 0,
|
|
226
248
|
rightMarginPins: 0,
|
|
@@ -231,17 +253,45 @@ export const MEDIA = {
|
|
|
231
253
|
name: '58mm Ø die-cut (DK-11207)',
|
|
232
254
|
type: 'die-cut',
|
|
233
255
|
widthMm: 58,
|
|
234
|
-
|
|
256
|
+
heightMm: 58,
|
|
257
|
+
colorCapable: false,
|
|
235
258
|
printAreaDots: 618,
|
|
236
259
|
leftMarginPins: 0,
|
|
237
260
|
rightMarginPins: 0,
|
|
238
261
|
dieCutMaskedAreaDots: 618,
|
|
239
262
|
},
|
|
240
263
|
};
|
|
264
|
+
/**
|
|
265
|
+
* Default media when `createPreview()` is called without media and
|
|
266
|
+
* without a detected roll. 62mm continuous (DK-22205) is the common
|
|
267
|
+
* single-colour shipping roll.
|
|
268
|
+
*/
|
|
269
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- DK-22205 is a hard-coded registry key
|
|
270
|
+
export const DEFAULT_MEDIA = MEDIA[259];
|
|
241
271
|
export function findMedia(id) {
|
|
242
272
|
return MEDIA[id];
|
|
243
273
|
}
|
|
244
274
|
export function findMediaByWidth(widthMm, type) {
|
|
245
275
|
return Object.values(MEDIA).filter(m => m.widthMm === widthMm && m.type === type);
|
|
246
276
|
}
|
|
277
|
+
/**
|
|
278
|
+
* Match status-response dimensions to a media registry entry.
|
|
279
|
+
*
|
|
280
|
+
* @param widthMm media width in mm (status byte 10)
|
|
281
|
+
* @param heightMm media length in mm (status byte 17) — 0 = continuous
|
|
282
|
+
* @param twoColorMode true when the status response indicates the
|
|
283
|
+
* printer is configured for two-colour media. When
|
|
284
|
+
* both DK-22205 (259) and DK-22251 (251) match the
|
|
285
|
+
* dimensions, the flag picks the right one.
|
|
286
|
+
*/
|
|
287
|
+
export function findMediaByDimensions(widthMm, heightMm, twoColorMode = false) {
|
|
288
|
+
if (heightMm === 0) {
|
|
289
|
+
const continuousMatches = Object.values(MEDIA).filter(m => m.type === 'continuous' && m.widthMm === widthMm);
|
|
290
|
+
if (continuousMatches.length === 0)
|
|
291
|
+
return undefined;
|
|
292
|
+
const preferred = continuousMatches.find(m => m.colorCapable === twoColorMode);
|
|
293
|
+
return preferred ?? continuousMatches[0];
|
|
294
|
+
}
|
|
295
|
+
return Object.values(MEDIA).find(m => m.type === 'die-cut' && m.widthMm === widthMm && m.heightMm === heightMm);
|
|
296
|
+
}
|
|
247
297
|
//# sourceMappingURL=media.js.map
|
package/dist/media.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.js","sourceRoot":"","sources":["../src/media.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"media.js","sourceRoot":"","sources":["../src/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,MAAM,YAAY,CAAC;AAEjE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,KAAK,GAAmC;IACnD,yBAAyB;IACzB,GAAG,EAAE;QACH,EAAE,EAAE,GAAG;QACP,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,aAAa,EAAE,GAAG;QAClB,cAAc,EAAE,GAAG;QACnB,eAAe,EAAE,EAAE;K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AAY,CAAC,CAAC;QAC/E,OAAO,SAAS,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAC9B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAC9E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type RawImageData } from '@mbtech-nl/bitmap';
|
|
2
|
+
import type { PreviewResult } from '@thermal-label/contracts';
|
|
3
|
+
import { type BrotherQLMedia } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Offline preview without a live printer connection.
|
|
6
|
+
*
|
|
7
|
+
* Two-colour aware: when `media.colorCapable` is true (DK-22251), the
|
|
8
|
+
* image is split into a black and a red plane via `splitTwoColor()` —
|
|
9
|
+
* exactly what `print()` does for that media. Single-colour media
|
|
10
|
+
* returns one black plane.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createPreviewOffline(image: RawImageData, media: BrotherQLMedia): PreviewResult;
|
|
13
|
+
//# sourceMappingURL=preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../src/preview.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,GAAG,aAAa,CAmB9F"}
|
package/dist/preview.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* eslint-disable import-x/consistent-type-specifier-style */
|
|
2
|
+
import { renderImage } from '@mbtech-nl/bitmap';
|
|
3
|
+
import { splitTwoColor } from './colour.js';
|
|
4
|
+
import {} from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Offline preview without a live printer connection.
|
|
7
|
+
*
|
|
8
|
+
* Two-colour aware: when `media.colorCapable` is true (DK-22251), the
|
|
9
|
+
* image is split into a black and a red plane via `splitTwoColor()` —
|
|
10
|
+
* exactly what `print()` does for that media. Single-colour media
|
|
11
|
+
* returns one black plane.
|
|
12
|
+
*/
|
|
13
|
+
export function createPreviewOffline(image, media) {
|
|
14
|
+
if (media.colorCapable) {
|
|
15
|
+
const { black, red } = splitTwoColor(image);
|
|
16
|
+
return {
|
|
17
|
+
planes: [
|
|
18
|
+
{ name: 'black', bitmap: black, displayColor: '#000000' },
|
|
19
|
+
{ name: 'red', bitmap: red, displayColor: '#ff0000' },
|
|
20
|
+
],
|
|
21
|
+
media,
|
|
22
|
+
assumed: false,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const bitmap = renderImage(image, { dither: true });
|
|
26
|
+
return {
|
|
27
|
+
planes: [{ name: 'black', bitmap, displayColor: '#000000' }],
|
|
28
|
+
media,
|
|
29
|
+
assumed: false,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=preview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview.js","sourceRoot":"","sources":["../src/preview.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,OAAO,EAAE,WAAW,EAAqB,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAuB,MAAM,YAAY,CAAC;AAEjD;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAmB,EAAE,KAAqB;IAC7E,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;QAC5C,OAAO;YACL,MAAM,EAAE;gBACN,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE;gBACzD,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE;aACtD;YACD,KAAK;YACL,OAAO,EAAE,KAAK;SACf,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,OAAO;QACL,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;QAC5D,KAAK;QACL,OAAO,EAAE,KAAK;KACf,CAAC;AACJ,CAAC"}
|
package/dist/protocol.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type BrotherQLMedia, type PageData, type JobOptions } from './types.js';
|
|
2
2
|
export declare function buildInvalidate(): Uint8Array;
|
|
3
3
|
export declare function buildStatusRequest(): Uint8Array;
|
|
4
4
|
export declare function buildInitialize(): Uint8Array;
|
|
5
5
|
export declare function buildRasterMode(): Uint8Array;
|
|
6
6
|
export declare function buildStatusNotification(enabled: boolean): Uint8Array;
|
|
7
|
-
export declare function buildPrintInfo(media:
|
|
7
|
+
export declare function buildPrintInfo(media: BrotherQLMedia, rowCount: number, pageIndex: number): Uint8Array;
|
|
8
8
|
export declare function buildVariousMode(autoCut: boolean): Uint8Array;
|
|
9
9
|
export declare function buildExpandedMode(cutAtEnd: boolean, highRes: boolean, twoColor?: boolean): Uint8Array;
|
|
10
10
|
export declare function buildCutEach(n: number): Uint8Array;
|
package/dist/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRo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,GAAG,UAAU,CA4EjF"}
|
package/dist/protocol.js
CHANGED
|
@@ -28,7 +28,7 @@ export function buildPrintInfo(media, rowCount, pageIndex) {
|
|
|
28
28
|
buf[3] = validFlags;
|
|
29
29
|
buf[4] = mediaType;
|
|
30
30
|
buf[5] = media.widthMm;
|
|
31
|
-
buf[6] = media.
|
|
31
|
+
buf[6] = media.heightMm ?? 0;
|
|
32
32
|
// rowCount little-endian at bytes 7-8 (offsets 4-5 in param block)
|
|
33
33
|
buf[7] = rowCount & 0xff;
|
|
34
34
|
buf[8] = (rowCount >> 8) & 0xff;
|
|
@@ -128,11 +128,11 @@ export function encodeJob(pages, options = {}) {
|
|
|
128
128
|
const marginDots = opts.marginDots ?? 35;
|
|
129
129
|
const compress = opts.compress ?? false;
|
|
130
130
|
const { bitmap, media } = page;
|
|
131
|
-
//
|
|
131
|
+
// colorCapable media (e.g. DK-22251) requires two-color mode even for black-only jobs.
|
|
132
132
|
// Auto-create an empty red plane when the tape demands it but caller didn't supply one.
|
|
133
|
-
const twoColor = page.redBitmap !== undefined || media.
|
|
133
|
+
const twoColor = page.redBitmap !== undefined || media.colorCapable;
|
|
134
134
|
const redBitmap = page.redBitmap ??
|
|
135
|
-
(media.
|
|
135
|
+
(media.colorCapable ? createBitmap(bitmap.widthPx, bitmap.heightPx) : undefined);
|
|
136
136
|
if (twoColor && redBitmap !== undefined) {
|
|
137
137
|
if (bitmap.widthPx !== redBitmap.widthPx || bitmap.heightPx !== redBitmap.heightPx) {
|
|
138
138
|
throw new Error('Two-color bitmaps must have identical dimensions');
|
package/dist/protocol.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings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CAAC"}
|
package/dist/status.d.ts
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare function parseStatus(bytes: Uint8Array): PrinterStatus;
|
|
1
|
+
import { type BrotherQLStatus } from './types.js';
|
|
3
2
|
export declare const STATUS_REQUEST: Uint8Array;
|
|
3
|
+
/**
|
|
4
|
+
* Parse a Brother QL 32-byte status response.
|
|
5
|
+
*
|
|
6
|
+
* Fields:
|
|
7
|
+
* byte 8 — error info 1 (bit mask, see ERROR_INFO_1)
|
|
8
|
+
* byte 9 — error info 2 (bit mask, see ERROR_INFO_2)
|
|
9
|
+
* byte 10 — media width (mm)
|
|
10
|
+
* byte 11 — media type (0x0A continuous, 0x0B die-cut)
|
|
11
|
+
* byte 17 — media length (mm), 0 for continuous
|
|
12
|
+
* byte 18 — status type (0x02 = error response)
|
|
13
|
+
*
|
|
14
|
+
* `detectedMedia` is resolved against the media registry via
|
|
15
|
+
* `findMediaByDimensions`. `editorLiteMode` is a driver-specific
|
|
16
|
+
* extension on `BrotherQLStatus` — the status-type byte doesn't
|
|
17
|
+
* actually report it, but keeping the field here means callers can
|
|
18
|
+
* set it from other signals (e.g. mass-storage PID detected during
|
|
19
|
+
* discovery) without changing the return type.
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseStatus(bytes: Uint8Array): BrotherQLStatus;
|
|
4
22
|
//# sourceMappingURL=status.d.ts.map
|
package/dist/status.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,eAAO,MAAM,cAAc,YAAqC,CAAC;AAyBjE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe,CAkC9D"}
|
package/dist/status.js
CHANGED
|
@@ -1,61 +1,76 @@
|
|
|
1
1
|
import {} from './types.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
2
|
+
import { findMediaByDimensions } from './media.js';
|
|
3
|
+
export const STATUS_REQUEST = new Uint8Array([0x1b, 0x69, 0x53]);
|
|
4
|
+
/** Error-info 1 bit → structured PrinterError code + human message. */
|
|
5
|
+
const ERROR_INFO_1 = [
|
|
6
|
+
{ bit: 0, code: 'no_media', message: 'No media' },
|
|
7
|
+
{ bit: 1, code: 'media_end', message: 'End of media' },
|
|
8
|
+
{ bit: 2, code: 'cutter_jam', message: 'Cutter jam' },
|
|
9
|
+
{ bit: 3, code: 'system_error', message: 'Weak battery' },
|
|
10
|
+
{ bit: 4, code: 'not_ready', message: 'Printer in use' },
|
|
11
|
+
{ bit: 6, code: 'system_error', message: 'High voltage adapter' },
|
|
12
|
+
{ bit: 7, code: 'system_error', message: 'Fan motor error' },
|
|
13
|
+
];
|
|
14
|
+
/** Error-info 2 bit → structured PrinterError code + human message. */
|
|
15
|
+
const ERROR_INFO_2 = [
|
|
16
|
+
{ bit: 0, code: 'wrong_media', message: 'Replace media' },
|
|
17
|
+
{ bit: 1, code: 'system_error', message: 'Expansion buffer full' },
|
|
18
|
+
{ bit: 2, code: 'system_error', message: 'Transmission error' },
|
|
19
|
+
{ bit: 3, code: 'system_error', message: 'Communication buffer full' },
|
|
20
|
+
{ bit: 4, code: 'cover_open', message: 'Cover open' },
|
|
21
|
+
{ bit: 5, code: 'not_ready', message: 'Cancel key pressed' },
|
|
22
|
+
{ bit: 6, code: 'media_end', message: 'Media cannot be fed' },
|
|
23
|
+
{ bit: 7, code: 'system_error', message: 'System error' },
|
|
24
|
+
];
|
|
25
|
+
/**
|
|
26
|
+
* Parse a Brother QL 32-byte status response.
|
|
27
|
+
*
|
|
28
|
+
* Fields:
|
|
29
|
+
* byte 8 — error info 1 (bit mask, see ERROR_INFO_1)
|
|
30
|
+
* byte 9 — error info 2 (bit mask, see ERROR_INFO_2)
|
|
31
|
+
* byte 10 — media width (mm)
|
|
32
|
+
* byte 11 — media type (0x0A continuous, 0x0B die-cut)
|
|
33
|
+
* byte 17 — media length (mm), 0 for continuous
|
|
34
|
+
* byte 18 — status type (0x02 = error response)
|
|
35
|
+
*
|
|
36
|
+
* `detectedMedia` is resolved against the media registry via
|
|
37
|
+
* `findMediaByDimensions`. `editorLiteMode` is a driver-specific
|
|
38
|
+
* extension on `BrotherQLStatus` — the status-type byte doesn't
|
|
39
|
+
* actually report it, but keeping the field here means callers can
|
|
40
|
+
* set it from other signals (e.g. mass-storage PID detected during
|
|
41
|
+
* discovery) without changing the return type.
|
|
42
|
+
*/
|
|
21
43
|
export function parseStatus(bytes) {
|
|
22
|
-
if (bytes.length < 32)
|
|
44
|
+
if (bytes.length < 32) {
|
|
23
45
|
throw new Error(`Status response too short: ${bytes.length.toString()} bytes`);
|
|
24
|
-
|
|
25
|
-
// the length check above. DataView avoids the issue: getUint8 returns number.
|
|
46
|
+
}
|
|
26
47
|
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
27
|
-
const errors = [];
|
|
28
48
|
const errInfo1 = view.getUint8(8);
|
|
29
49
|
const errInfo2 = view.getUint8(9);
|
|
30
|
-
for (const [bitStr, msg] of Object.entries(ERROR_INFO_1)) {
|
|
31
|
-
if (errInfo1 & (1 << Number(bitStr)))
|
|
32
|
-
errors.push(msg);
|
|
33
|
-
}
|
|
34
|
-
for (const [bitStr, msg] of Object.entries(ERROR_INFO_2)) {
|
|
35
|
-
if (errInfo2 & (1 << Number(bitStr)))
|
|
36
|
-
errors.push(msg);
|
|
37
|
-
}
|
|
38
50
|
const mediaWidthMm = view.getUint8(10);
|
|
39
51
|
const mediaTypeByte = view.getUint8(11);
|
|
40
52
|
const mediaLengthMm = view.getUint8(17);
|
|
41
|
-
let mediaType = null;
|
|
42
|
-
if (mediaTypeByte === 0x0a)
|
|
43
|
-
mediaType = 'continuous';
|
|
44
|
-
else if (mediaTypeByte === 0x0b)
|
|
45
|
-
mediaType = 'die-cut';
|
|
46
|
-
// Status type is at byte 18, not 14. Byte 14 is an undocumented media-type
|
|
47
|
-
// code that carries non-zero values and is not the status type field.
|
|
48
53
|
const statusType = view.getUint8(18);
|
|
49
|
-
const
|
|
54
|
+
const errors = [];
|
|
55
|
+
for (const { bit, code, message } of ERROR_INFO_1) {
|
|
56
|
+
if (errInfo1 & (1 << bit))
|
|
57
|
+
errors.push({ code, message });
|
|
58
|
+
}
|
|
59
|
+
for (const { bit, code, message } of ERROR_INFO_2) {
|
|
60
|
+
if (errInfo2 & (1 << bit))
|
|
61
|
+
errors.push({ code, message });
|
|
62
|
+
}
|
|
63
|
+
const mediaLoaded = mediaWidthMm > 0 && mediaTypeByte !== 0;
|
|
64
|
+
const detected = mediaLoaded
|
|
65
|
+
? findMediaByDimensions(mediaWidthMm, mediaLengthMm, false)
|
|
66
|
+
: undefined;
|
|
50
67
|
return {
|
|
51
|
-
ready,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
mediaType,
|
|
68
|
+
ready: errors.length === 0 && statusType !== 0x02,
|
|
69
|
+
mediaLoaded,
|
|
70
|
+
...(detected === undefined ? {} : { detectedMedia: detected }),
|
|
55
71
|
errors,
|
|
56
72
|
editorLiteMode: false,
|
|
57
73
|
rawBytes: bytes,
|
|
58
74
|
};
|
|
59
75
|
}
|
|
60
|
-
export const STATUS_REQUEST = new Uint8Array([0x1b, 0x69, 0x53]);
|
|
61
76
|
//# sourceMappingURL=status.js.map
|
package/dist/status.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,UAAU,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAEjE,uEAAuE;AACvE,MAAM,YAAY,GAAqD;IACrE,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE;IACjD,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE;IACtD,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE;IACrD,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE;IACzD,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE;IACxD,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,sBAAsB,EAAE;IACjE,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,iBAAiB,EAAE;CAC7D,CAAC;AAEF,uEAAuE;AACvE,MAAM,YAAY,GAAqD;IACrE,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE;IACzD,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,uBAAuB,EAAE;IAClE,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EA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