summaryrefslogtreecommitdiff
path: root/src/cups/backend_canonselphyneo.c
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2017-06-19 08:38:07 +0200
committerDidier Raboud <odyx@debian.org>2017-06-19 08:38:07 +0200
commitaedf3e93e811c6c9d504274172861d266e1c5c97 (patch)
tree95e525108c5b6bd2ea3fa689cf11bfe4a5b982a9 /src/cups/backend_canonselphyneo.c
parent7bd83d89975d166521a0b326b64b4cad80117750 (diff)
New upstream version 5.2.13~pre1
Diffstat (limited to 'src/cups/backend_canonselphyneo.c')
-rw-r--r--src/cups/backend_canonselphyneo.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/src/cups/backend_canonselphyneo.c b/src/cups/backend_canonselphyneo.c
index c29cbe6..e72b9db 100644
--- a/src/cups/backend_canonselphyneo.c
+++ b/src/cups/backend_canonselphyneo.c
@@ -41,7 +41,7 @@
/* Exported */
#define USB_VID_CANON 0x04a9
-#define USB_PID_CANON_CP820 XXX
+#define USB_PID_CANON_CP820 0x327b
#define USB_PID_CANON_CP910 0x327a
#define USB_PID_CANON_CP1000 0x32ae
#define USB_PID_CANON_CP1200 0x32b1
@@ -58,7 +58,7 @@ struct selphyneo_readback {
uint8_t data[12];
} __attribute((packed));
-/* Private data stucture */
+/* Private data structure */
struct selphyneo_ctx {
struct libusb_device_handle *dev;
uint8_t endp_up;
@@ -97,6 +97,8 @@ static char *selphyneo_errors(uint8_t err)
return "Paper Feed";
case 0x03:
return "No Paper";
+ case 0x06:
+ return "Ink Cassette Empty";
case 0x07:
return "No Ink";
case 0x09:
@@ -388,7 +390,7 @@ static void selphyneo_cmdline(void)
struct dyesub_backend canonselphyneo_backend = {
.name = "Canon SELPHY CPneo",
- .version = "0.06",
+ .version = "0.08",
.uri_prefix = "canonselphyneo",
.cmdline_usage = selphyneo_cmdline,
.cmdline_arg = selphyneo_cmdline_arg,
@@ -398,7 +400,7 @@ struct dyesub_backend canonselphyneo_backend = {
.read_parse = selphyneo_read_parse,
.main_loop = selphyneo_main_loop,
.devices = {
-// { USB_VID_CANON, USB_PID_CANON_CP820, P_CP910, ""},
+ { USB_VID_CANON, USB_PID_CANON_CP820, P_CP910, ""},
{ USB_VID_CANON, USB_PID_CANON_CP910, P_CP910, ""},
{ USB_VID_CANON, USB_PID_CANON_CP1000, P_CP910, ""},
{ USB_VID_CANON, USB_PID_CANON_CP1200, P_CP910, ""},
@@ -421,7 +423,7 @@ struct dyesub_backend canonselphyneo_backend = {
32-byte header:
0f 00 00 40 00 00 00 00 00 00 00 00 00 00 01 00
- 01 00 TT 00 00 00 00 00 XX XX XX XX YY YY YY YY
+ 01 00 TT 00 00 00 00 ZZ XX XX XX XX YY YY YY YY
cols (le32) rows (le32)
50 e0 04 50 07 1248 * 1872 (P)
@@ -432,19 +434,17 @@ struct dyesub_backend canonselphyneo_backend = {
== 4c (L)
== 43 (C)
+ ZZ == 00 Y'CbCr data follows
+ == 01 CMY data follows
+
Followed by three planes of image data.
P == 7008800 == 2336256 * 3 + 32 (1872*1248)
L == 5087264 == 1695744 * 3 + 32 (1472*1152)
C == 2180384 == 726784 * 3 + 32 (1088*668)
- It is worth mentioning that the image payload is Y'CbCr rather than the
- traditional YMC (or even BGR) of other dyseubs. Our best guess is that
- we need to use the JPEG coefficients, although we realistically have
- no way of confirming this.
-
- It is hoped that the printers do support YMC data, but as of yet we
- have no way of determining if this is possible.
+ It is worth mentioning that the Y'CbCr image data is surmised to use the
+ JPEG coefficients, although we realistically have no way of confirming this.
Other questions:
@@ -488,4 +488,18 @@ Also, the first time a readback happens after plugging in the printer:
34 44 35 31 01 00 01 00 01 00 45 00 "4D51" ...??
+
+** ** ** ** This is what windows sends if you print over the network:
+
+00 00 00 00 40 00 00 00 02 00 00 00 00 00 04 00 Header [unknown]
+00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+00 00 01 00 HH HH HH HH 02 00 00 00 PP PP PP PP Header2 [unknown] PP == payload len, HH == payload + header2 len [ie + 3 ]
+CC CC CC CC RR RR RR RR 00 00 00 00 LL LL LL LL CC == cols, RR == rows, LL == plane len (ie RR * CC)
+L2 L2 L2 L2 L2 == LL * 2, apparently.
+
+[ ..followed by three planes of LL bytes, totalling PP bytes.. ]
+
*/