Compare commits

...

2 Commits

Author SHA1 Message Date
Solomon Peachy 12a3206847 common: Major bugfixes in the rgb8 panorama split code.
* In the blend code, don't double-increment buffer pointer
 * Use correct row count in the blend code

And in the sinfonia code:

 * Set the post-panel-split data buffer lengths correctly
2024-01-20 18:17:51 -05:00
Solomon Peachy b6f7513d52 all: MEDIA_CODE argument is in _hex_ not decimal, so use strtol instead of atoi 2024-01-20 17:59:48 -05:00
15 changed files with 26 additions and 28 deletions

View File

@ -1,7 +1,7 @@
/*
* Canon SELPHY CPneo series CUPS backend
*
* (c) 2016-2022 Solomon Peachy <pizza@shaftnet.org>
* (c) 2016-2024 Solomon Peachy <pizza@shaftnet.org>
*
* The latest version of this program can be found at:
*
@ -229,7 +229,7 @@ static int selphyneo_attach(void *vctx, struct dyesub_connection *conn, uint8_t
rdback.data[2] = 0;
rdback.data[6] = 0x01;
if (getenv("MEDIA_CODE"))
rdback.data[6] = atoi(getenv("MEDIA_CODE"));
rdback.data[6] = strtol(getenv("MEDIA_CODE"), NULL, 16);
}
ctx->marker.color = "#00FFFF#FF00FF#FFFF00";

View File

@ -29,7 +29,7 @@
#include <signal.h>
#include <strings.h> /* For strncasecmp */
#define BACKEND_VERSION "0.130"
#define BACKEND_VERSION "0.131"
#ifndef CORRTABLE_PATH
#ifdef PACKAGE_DATA_DIR
@ -2000,9 +2000,6 @@ static void dyesub_pano_process_rgb8(const struct dnp_panodata *pano,
PROCESS_PIXEL(lhc->rhYMC[0],2); /* B/Y */
}
}
/* Next row */
data += cols * 3;
}
}
@ -2040,7 +2037,7 @@ void dyesub_pano_split_rgb8(const uint8_t *src, uint16_t cols, uint8_t numpanels
}
dyesub_pano_process_rgb8(&panodata, panels[i], lh, rh,
cols, panel_rows[i] - overlap_rows * 2,
cols, panel_rows[i],
overlap_rows, pad_rows);
}
}

View File

@ -1752,7 +1752,7 @@ static int dnpds40_attach(void *vctx, struct dyesub_connection *conn, uint8_t jo
}
if (getenv("MEDIA_CODE"))
ctx->media = atoi(getenv("MEDIA_CODE"));
ctx->media = strtol(getenv("MEDIA_CODE"), NULL, 16);
}
ctx->last_matte = -1;

View File

@ -1,7 +1,7 @@
/*
* HiTi Photo Printer CUPS backend
*
* (c) 2019-2023 Solomon Peachy <pizza@shaftnet.org>
* (c) 2019-2024 Solomon Peachy <pizza@shaftnet.org>
*
* The latest version of this program can be found at:
*
@ -1416,7 +1416,7 @@ static int hiti_attach(void *vctx, struct dyesub_connection *conn, uint8_t jobid
ctx->ribbonvendor = 0x1005; /* CHC, type 2 */
if (getenv("MEDIA_CODE") && strlen(getenv("MEDIA_CODE"))) {
// set fake fw version?
ctx->ribbon.type = atoi(getenv("MEDIA_CODE"));
ctx->ribbon.type = strtol(getenv("MEDIA_CODE"), NULL, 16);
if (ctx->ribbon.type == RIBBON_TYPE_5x7)
ctx->paper.type = PAPER_TYPE_5INCH;
}

View File

@ -1,7 +1,7 @@
/*
* Kodak 605 Photo Printer CUPS backend
*
* (c) 2013-2023 Solomon Peachy <pizza@shaftnet.org>
* (c) 2013-2024 Solomon Peachy <pizza@shaftnet.org>
*
* The latest version of this program can be found at:
*
@ -437,7 +437,7 @@ static int kodak605_attach(void *vctx, struct dyesub_connection *conn, uint8_t j
} else {
int media_code = KODAK6_MEDIA_6TR2;
if (getenv("MEDIA_CODE"))
media_code = atoi(getenv("MEDIA_CODE"));
media_code = strtol(getenv("MEDIA_CODE"), NULL, 16);
ctx->media->type = media_code;
}

View File

@ -1,7 +1,7 @@
/*
* Kodak 6800/6850 Photo Printer CUPS backend
*
* (c) 2013-2023 Solomon Peachy <pizza@shaftnet.org>
* (c) 2013-2024 Solomon Peachy <pizza@shaftnet.org>
*
* Development of this backend was sponsored by:
*
@ -711,7 +711,7 @@ static int kodak6800_attach(void *vctx, struct dyesub_connection *conn, uint8_t
} else {
int media_code = KODAK6_MEDIA_6TR2;
if (getenv("MEDIA_CODE"))
media_code = atoi(getenv("MEDIA_CODE"));
media_code = strtol(getenv("MEDIA_CODE"), NULL, 16);
ctx->media_type = media_code;
ctx->supports_sub4x6 = 1;

View File

@ -1,7 +1,7 @@
/*
* Mitsubishi CP-D70/D707 Photo Printer CUPS backend
*
* (c) 2013-2023 Solomon Peachy <pizza@shaftnet.org>
* (c) 2013-2024 Solomon Peachy <pizza@shaftnet.org>
*
* The latest version of this program can be found at:
*
@ -619,7 +619,7 @@ static int mitsu70x_attach(void *vctx, struct dyesub_connection *conn, uint8_t j
} else {
int media_code = 0xf;
if (getenv("MEDIA_CODE"))
media_code = atoi(getenv("MEDIA_CODE")) & 0xf;
media_code = strtol(getenv("MEDIA_CODE"), NULL, 16) & 0xf;
resp.upper.mecha_status[0] = MECHA_STATUS_INIT;
resp.lower.mecha_status[0] = MECHA_STATUS_INIT;

View File

@ -1,7 +1,7 @@
/*
* Mitsubishi CP-9xxx Photo Printer Family CUPS backend
*
* (c) 2014-2023 Solomon Peachy <pizza@shaftnet.org>
* (c) 2014-2024 Solomon Peachy <pizza@shaftnet.org>
*
* The latest version of this program can be found at:
*
@ -401,7 +401,7 @@ static int mitsu9550_attach(void *vctx, struct dyesub_connection *conn, uint8_t
} else {
int media_code = 0x2;
if (getenv("MEDIA_CODE"))
media_code = atoi(getenv("MEDIA_CODE")) & 0xf;
media_code = strtol(getenv("MEDIA_CODE"), NULL, 16) & 0xf;
media.max = cpu_to_be16(400);
media.remain = cpu_to_be16(330);

View File

@ -1,7 +1,7 @@
/*
* Shinko/Sinfonia CHC-S1245 CUPS backend
*
* (c) 2015-2023 Solomon Peachy <pizza@shaftnet.org>
* (c) 2015-2024 Solomon Peachy <pizza@shaftnet.org>
*
* Low-level documentation was provided by Sinfonia, Inc. Thank you!
*
@ -959,7 +959,7 @@ static int shinkos1245_attach(void *vctx, struct dyesub_connection *conn, uint8_
} else {
int media_code = 1;
if (getenv("MEDIA_CODE"))
media_code = atoi(getenv("MEDIA_CODE"));
media_code = strtol(getenv("MEDIA_CODE"), NULL, 16);
ctx->media_8x12 = media_code;
ctx->num_medias = 0;

View File

@ -1,7 +1,7 @@
/*
* Shinko/Sinfonia CHC-S2145 CUPS backend
*
* (c) 2013-2023 Solomon Peachy <pizza@shaftnet.org>
* (c) 2013-2024 Solomon Peachy <pizza@shaftnet.org>
*
* Development of this backend was sponsored by:
*
@ -875,7 +875,7 @@ static int shinkos2145_attach(void *vctx, struct dyesub_connection *conn, uint8_
} else {
int media_code = CODE_6x9;
if (getenv("MEDIA_CODE"))
media_code = atoi(getenv("MEDIA_CODE"));
media_code = strtol(getenv("MEDIA_CODE"), NULL, 16);
media_prints = 680;
ctx->media_code = media_code;

View File

@ -1273,7 +1273,7 @@ static int shinkos6145_attach(void *vctx, struct dyesub_connection *conn, uint8_
} else {
int media_code = RIBBON_6x8;
if (getenv("MEDIA_CODE"))
media_code = atoi(getenv("MEDIA_CODE"));
media_code = strtol(getenv("MEDIA_CODE"), NULL, 16);
ctx->media.ribbon_code = media_code;
}

View File

@ -936,7 +936,7 @@ static int shinkos6245_attach(void *vctx, struct dyesub_connection *conn, uint8_
} else {
int media_code = RIBBON_8x12;
if (getenv("MEDIA_CODE"))
media_code = atoi(getenv("MEDIA_CODE"));
media_code = strtol(getenv("MEDIA_CODE"),NULL,16);
ctx->media.ribbon_code = media_code;
}

View File

@ -327,6 +327,7 @@ int sinfonia_panorama_splitjob(struct sinfonia_printjob *injob,
/* Fill in header differences */
memcpy(newjobs[i], injob, sizeof(struct sinfonia_printjob));
newjobs[i]->databuf = panels[i];
newjobs[i]->datalen = panel_rows[i] * cols;
newjobs[i]->jp.rows = panel_rows[i];
// XXX what else?

View File

@ -1,7 +1,7 @@
/*
* Sony UP-D series Photo Printer CUPS backend
*
* (c) 2013-2023 Solomon Peachy <pizza@shaftnet.org>
* (c) 2013-2024 Solomon Peachy <pizza@shaftnet.org>
*
* The latest version of this program can be found at:
*
@ -318,7 +318,7 @@ static int upd_attach(void *vctx, struct dyesub_connection *conn, uint8_t jobid)
}
if (test_mode >= TEST_MODE_NOATTACH && getenv("MEDIA_CODE")) {
ctx->marker.numtype = atoi(getenv("MEDIA_CODE"));
ctx->marker.numtype = strtol(getenv("MEDIA_CODE"), NULL, 16);
} else {
ctx->marker.numtype = ctx->stsbuf.ribbon;
}

View File

@ -1,7 +1,7 @@
/*
* Sony UP-D series (new) Photo Printer CUPS backend
*
* (c) 2019-2023 Solomon Peachy <pizza@shaftnet.org>
* (c) 2019-2024 Solomon Peachy <pizza@shaftnet.org>
*
* The latest version of this program can be found at:
*
@ -161,7 +161,7 @@ static int updneo_attach(void *vctx, struct dyesub_connection *conn, uint8_t job
}
if (test_mode >= TEST_MODE_NOATTACH && getenv("MEDIA_CODE"))
ctx->marker.numtype = atoi(getenv("MEDIA_CODE"));
ctx->marker.numtype = strtol(getenv("MEDIA_CODE"), NULL, 16);
else
ctx->marker.numtype = (ctx->sts.scmdi >> 12) & 0xfff;