mitsu: Use correct buffer for 3D LUT conversion in the D70 code.

This commit is contained in:
Solomon Peachy 2020-02-06 06:57:55 -05:00
parent 959b2de744
commit 4eb4af24d0
3 changed files with 6 additions and 8 deletions

View File

@ -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) {

View File

@ -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;

View File

@ -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) {