summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-02-06 06:57:55 -0500
committerSolomon Peachy <pizza@shaftnet.org>2020-02-06 06:57:55 -0500
commit234870a55c551b5ff86b09a28515d6b8c49376cd (patch)
tree64d7466f60bd12f9b66f61a22db42b678ce9895e
parent8c576b13b2c1d511a5bb046e0e20837601ec90ba (diff)
downloadselphy_print-234870a55c551b5ff86b09a28515d6b8c49376cd.tar.gz
selphy_print-234870a55c551b5ff86b09a28515d6b8c49376cd.tar.bz2
selphy_print-234870a55c551b5ff86b09a28515d6b8c49376cd.zip
mitsu: Use correct buffer for 3D LUT conversion in the D70 code.
-rw-r--r--backend_mitsu.c11
-rw-r--r--backend_mitsu.h1
-rw-r--r--backend_mitsu70x.c2
3 files changed, 6 insertions, 8 deletions
diff --git a/backend_mitsu.c b/backend_mitsu.c
index bcc8cfa..7e9c6da 100644
--- a/backend_mitsu.c
+++ b/backend_mitsu.c
@@ -31,6 +31,8 @@ int mitsu_loadlib(struct mitsu_lib *lib, int type)
{
DL_INIT();
+ memset(lib, 0, sizeof(*lib));
+
#if defined(WITH_DYNAMIC)
DEBUG("Attempting to load image processing library\n");
lib->dl_handle = DL_OPEN(LIB_NAME_RE);
@@ -51,7 +53,6 @@ int mitsu_loadlib(struct mitsu_lib *lib, int type)
return CUPS_BACKEND_FAILED;
}
- lib->Get3DColorTable = DL_SYM(lib->dl_handle, "CColorConv3D_Get3DColorTable");
lib->Load3DColorTable = DL_SYM(lib->dl_handle, "CColorConv3D_Load3DColorTable");
lib->Destroy3DColorTable = DL_SYM(lib->dl_handle, "CColorConv3D_Destroy3DColorTable");
lib->DoColorConv = DL_SYM(lib->dl_handle, "CColorConv3D_DoColorConv");
@@ -61,7 +62,7 @@ int mitsu_loadlib(struct mitsu_lib *lib, int type)
lib->DoImageEffect70 = DL_SYM(lib->dl_handle, "do_image_effect70");
lib->DoImageEffect80 = DL_SYM(lib->dl_handle, "do_image_effect80");
lib->SendImageData = DL_SYM(lib->dl_handle, "send_image_data");
- if (!lib->Get3DColorTable || !lib->Load3DColorTable ||
+ if (!lib->Load3DColorTable ||
!lib->Destroy3DColorTable || !lib->DoColorConv ||
!lib->GetCPCData || !lib->DestroyCPCData ||
!lib->DoImageEffect60 || !lib->DoImageEffect70 ||
@@ -133,10 +134,8 @@ int mitsu_apply3dlut(struct mitsu_lib *lib, char *lutfname, uint8_t *databuf,
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_RETRY_CURRENT;
}
- if ((i = lib->Get3DColorTable(buf, lutfname))) {
- ERROR("Unable to open LUT file '%s' (%d)\n", lutfname, i);
- return CUPS_BACKEND_CANCEL;
- }
+ if ((i = dyesub_read_file(lutfname, buf, LUT_LEN, NULL)))
+ return i;
lib->lut = lib->Load3DColorTable(buf);
free(buf);
if (!lib->lut) {
diff --git a/backend_mitsu.h b/backend_mitsu.h
index 95e401e..e69383d 100644
--- a/backend_mitsu.h
+++ b/backend_mitsu.h
@@ -61,7 +61,6 @@ typedef int (*send_image_dataFN)(struct BandImage *out, void *context,
struct mitsu_lib {
void *dl_handle;
lib70x_getapiversionFN GetAPIVersion;
- Get3DColorTableFN Get3DColorTable;
Load3DColorTableFN Load3DColorTable;
Destroy3DColorTableFN Destroy3DColorTable;
DoColorConvFN DoColorConv;
diff --git a/backend_mitsu70x.c b/backend_mitsu70x.c
index a0450fe..52476cc 100644
--- a/backend_mitsu70x.c
+++ b/backend_mitsu70x.c
@@ -1157,7 +1157,7 @@ repeat:
/* Run through basic LUT, if present and enabled */
if (job->lutfname) {
int ret = mitsu_apply3dlut(&ctx->lib, job->lutfname,
- job->databuf, job->cols,
+ job->spoolbuf, job->cols,
job->rows, job->cols * 3,
COLORCONV_BGR);
if (ret) {