kodak8810: Rework panorama support. WIP!

This commit is contained in:
Solomon Peachy 2021-07-12 13:55:22 -04:00
parent 32d4bcf244
commit 94c4b86108
5 changed files with 167 additions and 31 deletions

View File

@ -984,8 +984,6 @@ static int shinkos6245_read_parse(void *vctx, const void **vjob, int data_fd, in
if (ctx->dev.conn->type == P_KODAK_8810 && if (ctx->dev.conn->type == P_KODAK_8810 &&
job->jp.rows > 3624) { job->jp.rows > 3624) {
// XXX PANORAMA PANORAMA PANORAMA
#if 0
if (job->copies > 1) { if (job->copies > 1) {
WARNING("Multiple copies of panorama prints is not supported!\n"); WARNING("Multiple copies of panorama prints is not supported!\n");
job->copies = 1; job->copies = 1;
@ -996,21 +994,26 @@ static int shinkos6245_read_parse(void *vctx, const void **vjob, int data_fd, in
return CUPS_BACKEND_CANCEL; return CUPS_BACKEND_CANCEL;
} }
if (job->jp.rows > 9624 && int rval;
ctx->media.ribbon_code != RIBBON_8x12 && int maxrows;
ctx->media.ribbon_code != RIBBON_8x12K) {
/* Sizes over 8x24 require 8x12 media */
ERROR("Incorrect media loaded for print!\n");
return CUPS_BACKEND_HOLD;
}
#endif
ERROR("Panorma not implemented yet!\n"); if (ctx->media.ribbon_code != RIBBON_8x12 &&
return CUPS_BACKEND_CANCEL; ctx->media.ribbon_code != RIBBON_8x12K)
maxrows = 3024;
else
maxrows = 3624;
rval = sinfonia_panorama_splitjob(job, maxrows,
(struct sinfonia_printjob**)vjob);
/* Unconditionally clean up original job regardless */
sinfonia_cleanup_job(job);
return rval;
} else {
*vjob = job;
} }
*vjob = job;
return CUPS_BACKEND_OK; return CUPS_BACKEND_OK;
} }

View File

@ -200,6 +200,136 @@ int sinfonia_raw10_read_parse(int data_fd, struct sinfonia_printjob *job)
return CUPS_BACKEND_OK; return CUPS_BACKEND_OK;
} }
int sinfonia_panorama_splitjob(struct sinfonia_printjob *injob,
uint16_t max_rows,
struct sinfonia_printjob **newjobs)
{
uint8_t *panels[3] = { NULL, NULL, NULL };
uint16_t panel_rows[3] = { 0, 0, 0 };
uint8_t numpanels;
uint16_t overlap_rows;
uint16_t inrows;
uint16_t cols;
int i;
inrows = injob->jp.rows;
cols = injob->jp.columns;
switch (cols) {
case 1548: /* EK6900/6950 */
if (max_rows != 2136) {
ERROR("Bad pano input\n");
return CUPS_BACKEND_CANCEL;
}
if (inrows > 3036) // 5x10
numpanels = 3;
else
numpanels = 2;
overlap_rows = 600 + 36;
if (numpanels == 3) {
if (inrows > 4536) // 5x15
overlap_rows = 100 + 36;
else
overlap_rows = 600 + 36;
}
break;
case 1844: /* EK6900/6950 */
if (max_rows != 2436) {
ERROR("Bad pano input\n");
return CUPS_BACKEND_CANCEL;
}
overlap_rows = 600 + 36;
if (inrows > 4236) // ie 6x14
numpanels = 3;
else
numpanels = 2;
break;
case 2464: /* EK8810 */
if (max_rows != 3624 && max_rows != 3024) {
ERROR("Bad pano input\n");
return CUPS_BACKEND_CANCEL;
}
overlap_rows = 600 + 24;
if (max_rows == 3024) { /* 8x10 media */
if (inrows > 5424) // 8x18
numpanels = 3;
else
numpanels = 2;
} else { /* 8x12 media */
if (inrows > 6624) // 8x22
numpanels = 3;
else
numpanels = 2;
}
if (numpanels == 3) {
if (max_rows == 3024) {
if (inrows == 6024) // 8x20
overlap_rows = 24;
} else {
if (inrows == 10824) // 8x36
overlap_rows = 24;
}
} else {
if (max_rows == 3024) {
if (inrows == 9024) // 8x30
overlap_rows = 24;
} else {
if (inrows == 7224) // 8x24
overlap_rows = 24;
}
}
break;
default:
ERROR("Unknown pano input cols: %d\n", cols);
return CUPS_BACKEND_CANCEL;
}
/* Work out which number of rows per panel */
if (!panel_rows[0]) {
panel_rows[0] = max_rows;
panel_rows[1] = inrows - panel_rows[0] + overlap_rows;
if (numpanels > 2)
panel_rows[2] = inrows - panel_rows[0] - panel_rows[1] + overlap_rows + overlap_rows;
}
/* Allocate and set up new jobs and buffers */
for (i = 0 ; i < numpanels ; i++) {
newjobs[i] = malloc(sizeof(struct sinfonia_printjob));
if (!newjobs[i]) {
ERROR("Memory allocation failure");
return CUPS_BACKEND_RETRY_CURRENT;
}
panels[i] = malloc(cols * panel_rows[i] * 3);
if (!panels[i]) {
ERROR("Memory allocation failure");
return CUPS_BACKEND_RETRY_CURRENT;
}
/* Fill in header differences */
memcpy(newjobs[i], injob, sizeof(struct sinfonia_printjob));
newjobs[i]->databuf = panels[i];
newjobs[i]->jp.rows = panel_rows[i];
// XXX what else?
}
dyesub_pano_split_rgb8(injob->databuf, cols, inrows,
numpanels, overlap_rows, max_rows,
panels, panel_rows);
// XXX postprocess buffers!
// pano_process_rgb8(numpanels, cols, overlap_rows, panels, panel_rows);
return CUPS_BACKEND_OK;
}
int sinfonia_raw18_read_parse(int data_fd, struct sinfonia_printjob *job) int sinfonia_raw18_read_parse(int data_fd, struct sinfonia_printjob *job)
{ {
struct sinfonia_printcmd18_hdr hdr; struct sinfonia_printcmd18_hdr hdr;

View File

@ -70,6 +70,9 @@ int sinfonia_raw18_read_parse(int data_fd, struct sinfonia_printjob *job);
int sinfonia_raw28_read_parse(int data_fd, struct sinfonia_printjob *job); int sinfonia_raw28_read_parse(int data_fd, struct sinfonia_printjob *job);
void sinfonia_cleanup_job(const void *vjob); void sinfonia_cleanup_job(const void *vjob);
int sinfonia_panorama_splitjob(struct sinfonia_printjob *injob,
uint16_t max_rows,
struct sinfonia_printjob **newjobs);
/* mapping param IDs to names */ /* mapping param IDs to names */
struct sinfonia_param { struct sinfonia_param {

View File

@ -23,35 +23,35 @@ fi
# D90 # D90
case "${model}" in case "${model}" in
kodak-6900|kodak-6950) kodak-6900|kodak-6950)
overlap=600 # XXX Not sure yet overlap=636 # 100 + 36
if [ "${printsize}" eq "6x20" ] ; then if [ "${printsize}" eq "6x20" ] ; then
cols=1844 cols=1844
inrows=6108 # XXX Not sure inrows=6036
drows=2436 drows=2436
elif [ "${printsize}" eq "6x18" ] ; then elif [ "${printsize}" eq "6x18" ] ; then
cols=1844 cols=1844
inrows=5508 # XXX Not sure inrows=5436
drows=2436 drows=2436
elif [ "${printsize}" eq "6x14" ] ; then elif [ "${printsize}" eq "6x14" ] ; then
cols=1844 cols=1844
inrows=4308 # XXX Not sure inrows=4236
drows=2436 drows=2436
elif [ "${printsize}" eq "6x12" ] ; then elif [ "${printsize}" eq "6x12" ] ; then
cols=1844 cols=1844
inrows=3708 # XXX Not sure inrows=3636
drows=2436 drows=2436
elif [ "${printsize}" eq "5x20" ] ; then elif [ "${printsize}" eq "5x20" ] ; then
cols=1548 cols=1548
inrows=6108 # XXX Not sure inrows=6036
overlap=150 # XXX Not sure overlap=136 # 100 + 36
drows=2136 drows=2136
elif [ "${printsize}" eq "5x15" ] ; then elif [ "${printsize}" eq "5x15" ] ; then
cols=1548 cols=1548
inrows=4608 # XXX Not sure inrows=4536
drows=2136 drows=2136
elif [ "${printsize}" eq "5x10" ] ; then elif [ "${printsize}" eq "5x10" ] ; then
cols=1548 cols=1548
inrows=3108 # XXX Not sure inrows=3036
drows=2136 drows=2136
else else
echo "EK69xx supports 6x20, 6x18, 6x14, 6x12, 5x20, 5x15, and 5x10 only"; echo "EK69xx supports 6x20, 6x18, 6x14, 6x12, 5x20, 5x15, and 5x10 only";
@ -59,7 +59,7 @@ case "${model}" in
;; ;;
kodak-8810) kodak-8810)
cols=2464 cols=2464
overlap=360 overlap=360 ### XXX probably wrong?
if [ "${printsize}" eq "8x14" ] ; then if [ "${printsize}" eq "8x14" ] ; then
inrows=4224 inrows=4224
drows=3024 # or 3624 drows=3024 # or 3624
@ -76,7 +76,7 @@ case "${model}" in
inrows=9624 inrows=9624
drows=3624 drows=3624
elif [ "${printsize}" eq "8x36" ] ; then elif [ "${printsize}" eq "8x36" ] ; then
overlap=180 overlap=180 # XXX probably wrong?
inrows=10824 inrows=10824
drows=3624 drows=3624
else else

View File

@ -182,12 +182,12 @@ kodak-8810,0x040a,0x404d,0x12,PageSize=w432h576
kodak-8810,0x040a,0x404d,0x11,PageSize=w288h576;StpLaminate=Glossy kodak-8810,0x040a,0x404d,0x11,PageSize=w288h576;StpLaminate=Glossy
kodak-8810,0x040a,0x404d,0x11,PageSize=w288h576;StpLaminate=Satin kodak-8810,0x040a,0x404d,0x11,PageSize=w288h576;StpLaminate=Satin
#Panorama sizes disabled for now #Panorama sizes disabled for now
#kodak-8810,0x040a,0x404d,0x12,PageSize=w576h1008 kodak-8810,0x040a,0x404d,0x12,PageSize=w576h1008
#kodak-8810,0x040a,0x404d,0x12,PageSize=w576h1152 kodak-8810,0x040a,0x404d,0x12,PageSize=w576h1152
#kodak-8810,0x040a,0x404d,0x12,PageSize=w576h1440 kodak-8810,0x040a,0x404d,0x12,PageSize=w576h1440
#kodak-8810,0x040a,0x404d,0x12,PageSize=w576h1728 kodak-8810,0x040a,0x404d,0x12,PageSize=w576h1728
#kodak-8810,0x040a,0x404d,0x12,PageSize=w576h2304 kodak-8810,0x040a,0x404d,0x12,PageSize=w576h2304
#kodak-8810,0x040a,0x404d,0x12,PageSize=w576h2592 kodak-8810,0x040a,0x404d,0x12,PageSize=w576h2592
# #
sony-updr150,0x054c,0x01e8,,PageSize=w288h432 sony-updr150,0x054c,0x01e8,,PageSize=w288h432
sony-updr150,0x054c,0x01e8,,PageSize=w432h576 sony-updr150,0x054c,0x01e8,,PageSize=w432h576

1 #gp_printername,vid,pid,type,gp_options[,pano_options]
182 kodak-8810,0x040a,0x404d,0x11,PageSize=w288h576;StpLaminate=Glossy
183 kodak-8810,0x040a,0x404d,0x11,PageSize=w288h576;StpLaminate=Satin
184 #Panorama sizes disabled for now
185 #kodak-8810,0x040a,0x404d,0x12,PageSize=w576h1008 kodak-8810,0x040a,0x404d,0x12,PageSize=w576h1008
186 #kodak-8810,0x040a,0x404d,0x12,PageSize=w576h1152 kodak-8810,0x040a,0x404d,0x12,PageSize=w576h1152
187 #kodak-8810,0x040a,0x404d,0x12,PageSize=w576h1440 kodak-8810,0x040a,0x404d,0x12,PageSize=w576h1440
188 #kodak-8810,0x040a,0x404d,0x12,PageSize=w576h1728 kodak-8810,0x040a,0x404d,0x12,PageSize=w576h1728
189 #kodak-8810,0x040a,0x404d,0x12,PageSize=w576h2304 kodak-8810,0x040a,0x404d,0x12,PageSize=w576h2304
190 #kodak-8810,0x040a,0x404d,0x12,PageSize=w576h2592 kodak-8810,0x040a,0x404d,0x12,PageSize=w576h2592
191 #
192 sony-updr150,0x054c,0x01e8,,PageSize=w288h432
193 sony-updr150,0x054c,0x01e8,,PageSize=w432h576