mitsud90: Disable in-printer sharpening with pano prints

We don't want it messing with the blended areas

Will have to figure out a way to do the sharpening pre-split, but the
mitsu image algorithms are all set up to sharpen post-gamma.
This commit is contained in:
Solomon Peachy 2024-01-11 20:30:20 -05:00
parent a14219959e
commit fe230371db
1 changed files with 16 additions and 8 deletions

View File

@ -972,6 +972,8 @@ static int mitsud90_panorama_splitjob(struct mitsud90_printjob *injob, struct mi
memcpy(newjobs[i], injob, sizeof(struct mitsud90_printjob));
newjobs[i]->databuf = panels[i];
newjobs[i]->hdr.rows = cpu_to_be16(panel_rows[i]);
newjobs[i]->hdr.sharp_h = 0; // XXX do sharpening _before_ split
newjobs[i]->hdr.sharp_v = 0;
newjobs[i]->hdr.pano.on = 1;
newjobs[i]->hdr.pano.total = numpanels;
newjobs[i]->hdr.pano.page = i;
@ -992,11 +994,14 @@ static int mitsud90_panorama_splitjob(struct mitsud90_printjob *injob, struct mi
panels[i] += sizeof(struct mitsud90_plane_hdr);
}
/* Last panel gets the footer, if any */
newjobs[numpanels - 1]->has_footer = injob->has_footer;
if (injob->has_footer) {
newjobs[numpanels - 1]->has_footer = injob->has_footer;
memcpy(&newjobs[numpanels-1]->footer, &injob->footer, sizeof(injob->footer));
}
dyesub_pano_split_rgb8(injob->databuf, cols, numpanels,
overlap_rows, pad_rows,
panel_rows, panels);
dyesub_pano_split_rgb8(injob->databuf, cols, numpanels,
overlap_rows, pad_rows,
panel_rows, panels);
return CUPS_BACKEND_OK;
}
@ -1264,6 +1269,7 @@ read_data:
if (job->is_pano) {
int rval;
// XXX do any print sharpening here! If possible..
rval = mitsud90_panorama_splitjob(job, (struct mitsud90_printjob**)vjob);
/* Clean up original parsed job regardless */
mitsud90_cleanup_job(job);
@ -1390,7 +1396,9 @@ static int mitsud90_main_loop(void *vctx, const void *vjob, int wait_for_return)
gammatab = ASK5_CPC_G1_FNAME;
}
cpc = ctx->lib.M1_GetCPCData(corrtable_path, ASK5_CPC_FNAME, gammatab);
} else if (ctx->conn->type == P_MITSU_D90) { // XXX not used in this code path yet...
} else if (ctx->conn->type == P_MITSU_D90) {
// XXX not used in this code path yet...
// Note that these CSVs are actually BGR->YMC gamma!
if (job->m1_colormode == 1)
gammatab = CPD90_CPC_3_1_FNAME;
else
@ -1407,7 +1415,6 @@ static int mitsud90_main_loop(void *vctx, const void *vjob, int wait_for_return)
cpc = ctx->lib.M1_GetCPCData(corrtable_path, CPM1_CPC_FNAME, gammatab);
}
if (!cpc) {
ERROR("Cannot read data tables\n");
free(convbuf);
@ -1415,7 +1422,8 @@ static int mitsud90_main_loop(void *vctx, const void *vjob, int wait_for_return)
}
/* Do gamma conversion */
ctx->lib.M1_Gamma8to14(cpc, &input, &output);
if (ctx->conn->type != P_MITSU_D90)
ctx->lib.M1_Gamma8to14(cpc, &input, &output);
if (job->hdr.sharp_h || job->hdr.sharp_v) {
/* 0 is off, 1-7 corresponds to level 0-6 */
@ -2424,7 +2432,7 @@ static const char *mitsud90_prefixes[] = {
/* Exported */
const struct dyesub_backend mitsud90_backend = {
.name = "Mitsubishi CP-D90/CP-M1/CP-W5000",
.version = "0.47" " (lib " LIBMITSU_VER ")",
.version = "0.48" " (lib " LIBMITSU_VER ")",
.uri_prefixes = mitsud90_prefixes,
.cmdline_arg = mitsud90_cmdline_arg,
.cmdline_usage = mitsud90_cmdline,