Debian Codegraph @

src/cups/backend_mitsu.c

raw symbols SCIP
1 /*
2 * Mitsubishi Photo Printer Comon Code
3 *
4 * (c) 2013-2024 Solomon Peachy <[email protected]>
5 *
6 * The latest version of this program can be found at:
7 *
8 * https://git.shaftnet.org/gitea/slp/selphy_print.git
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the Free
12 * Software Foundation; either version 2 of the License, or (at your option)
13 * any later version.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, see <https://www.gnu.org/licenses/>.
22 *
23 * SPDX-License-Identifier: GPL-2.0+
24 *
25 */
26
27 #include "backend_common.h"cxx . . $ `<file>/src/cups/backend_common.h`/
28 #include "backend_mitsu.h"cxx . . $ `<file>/src/cups/backend_mitsu.h`/
29
30 int mitsu_loadlibcxx . . $ mitsu_loadlib(9c3d640f682a40b7).(struct mitsu_libcxx . . $ mitsu_lib# *lib, int type)
31 {
32 memsetcxx . . $ memset(d1de1e4fb215f1c6).(lib, 0, sizeof(*lib));
33
34 #if defined(WITH_DYNAMICcxx . . $ `src/cups/backend_common.h:404:9`!)
35 DL_INITcxx . . $ `src/cups/backend_common.h:406:9`!();
36
37 DEBUGcxx . . $ `src/cups/backend_common.h:59:9`!("Attempting to load image processing library\n");
38 lib->dl_handlecxx . . $ mitsu_lib#dl_handle. = DL_OPENcxx . . $ `src/cups/backend_common.h:407:9`!(LIB_NAME_REcxx . . $ `src/cups/backend_mitsu.h:102:9`!);
39 if (!lib->dl_handlecxx . . $ mitsu_lib#dl_handle.)
40 WARNINGcxx . . $ `src/cups/backend_common.h:62:9`!("Image processing library not found, using internal fallback code\n");
41 if (lib->dl_handlecxx . . $ mitsu_lib#dl_handle.) {
42 lib->GetAPIVersioncxx . . $ mitsu_lib#GetAPIVersion. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "lib70x_getapiversion");
43 if (!lib->GetAPIVersioncxx . . $ mitsu_lib#GetAPIVersion.) {
44 ERRORcxx . . $ `src/cups/backend_common.h:63:9`!("Problem resolving API Version symbol in imaging processing library, too old or not installed?\n");
45 DL_CLOSEcxx . . $ `src/cups/backend_common.h:409:9`!(lib->dl_handle);
46 lib->dl_handlecxx . . $ mitsu_lib#dl_handle. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
47 return CUPS_BACKEND_FAILEDcxx . . $ `src/cups/backend_common.h:368:9`!;
48 }
49 if (lib->GetAPIVersioncxx . . $ mitsu_lib#GetAPIVersion.() != REQUIRED_LIB_APIVERSIONcxx . . $ `src/cups/backend_mitsu.h:97:9`!) {
50 ERRORcxx . . $ `src/cups/backend_common.h:63:9`!("Image processing library API version mismatch! (%d vs %d)\n", lib->GetAPIVersion(), REQUIRED_LIB_APIVERSIONcxx . . $ `src/cups/backend_mitsu.h:97:9`!);
51 DL_CLOSEcxx . . $ `src/cups/backend_common.h:409:9`!(lib->dl_handle);
52 lib->dl_handlecxx . . $ mitsu_lib#dl_handle. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
53 return CUPS_BACKEND_FAILEDcxx . . $ `src/cups/backend_common.h:368:9`!;
54 }
55 lib->DumpAnnouncecxx . . $ mitsu_lib#DumpAnnounce. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "dump_announce");
56
57 lib->Get3DColorTablecxx . . $ mitsu_lib#Get3DColorTable. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "CColorConv3D_Get3DColorTable");
58 lib->Load3DColorTablecxx . . $ mitsu_lib#Load3DColorTable. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "CColorConv3D_Load3DColorTable");
59 lib->Destroy3DColorTablecxx . . $ mitsu_lib#Destroy3DColorTable. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "CColorConv3D_Destroy3DColorTable");
60 lib->DoColorConvcxx . . $ mitsu_lib#DoColorConv. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "CColorConv3D_DoColorConv");
61 lib->DoColorConvPlanecxx . . $ mitsu_lib#DoColorConvPlane. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "CColorConv3D_DoColorConvPlane");
62 lib->GetCPCDatacxx . . $ mitsu_lib#GetCPCData. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "get_CPCData");
63 lib->DestroyCPCDatacxx . . $ mitsu_lib#DestroyCPCData. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "destroy_CPCData");
64 lib->DoImageEffect60cxx . . $ mitsu_lib#DoImageEffect60. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "do_image_effect60");
65 lib->DoImageEffect70cxx . . $ mitsu_lib#DoImageEffect70. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "do_image_effect70");
66 lib->DoImageEffect80cxx . . $ mitsu_lib#DoImageEffect80. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "do_image_effect80");
67 lib->SendImageDatacxx . . $ mitsu_lib#SendImageData. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "send_image_data");
68 lib->CP98xx_DoConvertcxx . . $ mitsu_lib#CP98xx_DoConvert. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "CP98xx_DoConvert");
69 lib->CP98xx_GetDatacxx . . $ mitsu_lib#CP98xx_GetData. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "CP98xx_GetData");
70 lib->CP98xx_DestroyDatacxx . . $ mitsu_lib#CP98xx_DestroyData. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "CP98xx_DestroyData");
71 lib->M1_GetCPCDatacxx . . $ mitsu_lib#M1_GetCPCData. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "M1_GetCPCData");
72 lib->M1_DestroyCPCDatacxx . . $ mitsu_lib#M1_DestroyCPCData. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "M1_DestroyCPCData");
73 lib->M1_Gamma8to14cxx . . $ mitsu_lib#M1_Gamma8to14. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "M1_Gamma8to14");
74 lib->M1_CLocalEnhancercxx . . $ mitsu_lib#M1_CLocalEnhancer. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "M1_CLocalEnhancer");
75 lib->M1_CalcRGBRatecxx . . $ mitsu_lib#M1_CalcRGBRate. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "M1_CalcRGBRate");
76 lib->M1_CalcOpRateMattecxx . . $ mitsu_lib#M1_CalcOpRateMatte. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "M1_CalcOpRateMatte");
77 lib->M1_CalcOpRateGlosscxx . . $ mitsu_lib#M1_CalcOpRateGloss. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "M1_CalcOpRateGloss");
78 lib->CPD30_GetDatacxx . . $ mitsu_lib#CPD30_GetData. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "CPD30_GetData");
79 lib->CPD30_DestroyDatacxx . . $ mitsu_lib#CPD30_DestroyData. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "CPD30_DestroyData");
80 lib->CPD30_DoConvertcxx . . $ mitsu_lib#CPD30_DoConvert. = DL_SYMcxx . . $ `src/cups/backend_common.h:408:9`!(lib->dl_handle, "CPD30_DoConvert");
81
82 if (!lib->Get3DColorTablecxx . . $ mitsu_lib#Get3DColorTable. || !lib->Load3DColorTablecxx . . $ mitsu_lib#Load3DColorTable. ||
83 !lib->CP98xx_DoConvertcxx . . $ mitsu_lib#CP98xx_DoConvert. || !lib->CP98xx_GetDatacxx . . $ mitsu_lib#CP98xx_GetData. ||
84 !lib->CP98xx_DestroyDatacxx . . $ mitsu_lib#CP98xx_DestroyData. ||
85 !lib->M1_GetCPCDatacxx . . $ mitsu_lib#M1_GetCPCData. || !lib->M1_DestroyCPCDatacxx . . $ mitsu_lib#M1_DestroyCPCData. ||
86 !lib->M1_Gamma8to14cxx . . $ mitsu_lib#M1_Gamma8to14. || !lib->M1_CLocalEnhancercxx . . $ mitsu_lib#M1_CLocalEnhancer. ||
87 !lib->M1_CalcOpRateMattecxx . . $ mitsu_lib#M1_CalcOpRateMatte. || !lib->M1_CalcOpRateGlosscxx . . $ mitsu_lib#M1_CalcOpRateGloss. ||
88 !lib->M1_CalcRGBRatecxx . . $ mitsu_lib#M1_CalcRGBRate. ||
89 !lib->CPD30_GetDatacxx . . $ mitsu_lib#CPD30_GetData. || !lib->CPD30_DestroyDatacxx . . $ mitsu_lib#CPD30_DestroyData. ||
90 !lib->CPD30_DoConvertcxx . . $ mitsu_lib#CPD30_DoConvert. ||
91 !lib->Destroy3DColorTablecxx . . $ mitsu_lib#Destroy3DColorTable. || !lib->DoColorConvcxx . . $ mitsu_lib#DoColorConv. ||
92 !lib->DoColorConvPlanecxx . . $ mitsu_lib#DoColorConvPlane. ||
93 !lib->GetCPCDatacxx . . $ mitsu_lib#GetCPCData. || !lib->DestroyCPCDatacxx . . $ mitsu_lib#DestroyCPCData. ||
94 !lib->DoImageEffect60cxx . . $ mitsu_lib#DoImageEffect60. || !lib->DoImageEffect70cxx . . $ mitsu_lib#DoImageEffect70. ||
95 !lib->DoImageEffect80cxx . . $ mitsu_lib#DoImageEffect80. || !lib->SendImageDatacxx . . $ mitsu_lib#SendImageData.) {
96 ERRORcxx . . $ `src/cups/backend_common.h:63:9`!("Problem resolving symbols in imaging processing library\n");
97 DL_CLOSEcxx . . $ `src/cups/backend_common.h:409:9`!(lib->dl_handle);
98 lib->dl_handlecxx . . $ mitsu_lib#dl_handle. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
99 return CUPS_BACKEND_FAILEDcxx . . $ `src/cups/backend_common.h:368:9`!;
100 } else {
101 DEBUGcxx . . $ `src/cups/backend_common.h:59:9`!("Image processing library successfully loaded\n");
102 if (!stats_onlycxx . . $ stats_only. && lib->DumpAnnouncecxx . . $ mitsu_lib#DumpAnnounce.)
103 lib->DumpAnnouncecxx . . $ mitsu_lib#DumpAnnounce.(loggercxx . . $ logger.);
104 }
105 }
106
107 switch (type) {
108 case P_MITSU_D80cxx . . $ P_MITSU_D80.:
109 lib->DoImageEffectcxx . . $ mitsu_lib#DoImageEffect. = lib->DoImageEffect80cxx . . $ mitsu_lib#DoImageEffect80.;
110 break;
111 case P_MITSU_K60cxx . . $ P_MITSU_K60.:
112 case P_KODAK_305cxx . . $ P_KODAK_305.:
113 lib->DoImageEffectcxx . . $ mitsu_lib#DoImageEffect. = lib->DoImageEffect60cxx . . $ mitsu_lib#DoImageEffect60.;
114 break;
115 case P_MITSU_D70Xcxx . . $ P_MITSU_D70X.:
116 case P_FUJI_ASK300cxx . . $ P_FUJI_ASK300.:
117 case P_DNP_DSX80cxx . . $ P_DNP_DSX80.:
118 lib->DoImageEffectcxx . . $ mitsu_lib#DoImageEffect. = lib->DoImageEffect70cxx . . $ mitsu_lib#DoImageEffect70.;
119 break;
120 case P_MITSU_9800cxx . . $ P_MITSU_9800.:
121 case P_MITSU_9800Scxx . . $ P_MITSU_9800S.:
122 case P_MITSU_9810cxx . . $ P_MITSU_9810.:
123 default:
124 lib->DoImageEffectcxx . . $ mitsu_lib#DoImageEffect. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
125 }
126
127 return CUPS_BACKEND_OKcxx . . $ `src/cups/backend_common.h:367:9`!;
128 #else
129 ERROR("Need dynamic library support for library loading!\n");
130 return CUPS_BACKEND_FAILED;
131 #endif
132 }
133
134 int mitsu_destroylibcxx . . $ mitsu_destroylib(9b3b7107c7f9892a).(struct mitsu_libcxx . . $ mitsu_lib# *lib)
135 {
136 #if defined(WITH_DYNAMICcxx . . $ `src/cups/backend_common.h:404:9`!)
137 if (lib->dl_handlecxx . . $ mitsu_lib#dl_handle.) {
138 if (lib->cpcdatacxx . . $ mitsu_lib#cpcdata.)
139 lib->DestroyCPCDatacxx . . $ mitsu_lib#DestroyCPCData.(lib->cpcdatacxx . . $ mitsu_lib#cpcdata.);
140 if (lib->ecpcdatacxx . . $ mitsu_lib#ecpcdata.)
141 lib->DestroyCPCDatacxx . . $ mitsu_lib#DestroyCPCData.(lib->ecpcdatacxx . . $ mitsu_lib#ecpcdata.);
142 if (lib->lutcxx . . $ mitsu_lib#lut.)
143 lib->Destroy3DColorTablecxx . . $ mitsu_lib#Destroy3DColorTable.(lib->lutcxx . . $ mitsu_lib#lut.);
144 DL_CLOSEcxx . . $ `src/cups/backend_common.h:409:9`!(lib->dl_handle);
145 }
146
147 memsetcxx . . $ memset(d1de1e4fb215f1c6).(lib, 0, sizeof(*lib));
148 DL_EXITcxx . . $ `src/cups/backend_common.h:410:9`!();
149
150 #endif
151 return CUPS_BACKEND_OKcxx . . $ `src/cups/backend_common.h:367:9`!;
152 }
153
154 int mitsu_apply3dlut_packedcxx . . $ mitsu_apply3dlut_packed(fdcb6ac18ff06d28).(struct mitsu_libcxx . . $ mitsu_lib# *lib, const char *lutfname, uint8_tcxx . . $ uint8_t# *databuf,
155 uint16_tcxx . . $ uint16_t# cols, uint16_tcxx . . $ uint16_t# rows, uint16_tcxx . . $ uint16_t# stride,
156 int rgb_bgr)
157 {
158 #if defined(WITH_DYNAMICcxx . . $ `src/cups/backend_common.h:404:9`!)
159 char full[2048];
160 int i;
161
162 if (!lutfname)
163 return CUPS_BACKEND_OKcxx . . $ `src/cups/backend_common.h:367:9`!;
164 if (!lib->dl_handlecxx . . $ mitsu_lib#dl_handle.)
165 return CUPS_BACKEND_OKcxx . . $ `src/cups/backend_common.h:367:9`!;
166
167 snprintfcxx . . $ snprintf(ea502d73e74c754c).(full, sizeof(full), "%s/%s", corrtable_pathcxx . . $ corrtable_path., lutfname);
168
169 if (!lib->lutcxx . . $ mitsu_lib#lut.) {
170 uint8_tcxx . . $ uint8_t# *buf = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(LUT_LENcxx . . $ `src/cups/backend_mitsu.h:36:9`!);
171 if (!buf) {
172 ERRORcxx . . $ `src/cups/backend_common.h:63:9`!("Memory allocation failure!\n");
173 return CUPS_BACKEND_RETRY_CURRENTcxx . . $ `src/cups/backend_common.h:374:9`!;
174 }
175 if ((i = dyesub_read_filecxx . . $ `src/cups/backend_common.h:281:9`!(full, buf, LUT_LENcxx . . $ `src/cups/backend_mitsu.h:36:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)))
176 return i;
177 lib->lutcxx . . $ mitsu_lib#lut. = lib->Load3DColorTablecxx . . $ mitsu_lib#Load3DColorTable.(buf);
178 freecxx . . $ free(5d22bdacc48458e8).(buf);
179 if (!lib->lutcxx . . $ mitsu_lib#lut.) {
180 ERRORcxx . . $ `src/cups/backend_common.h:63:9`!("Unable to parse LUT file '%s'!\n", full);
181 return CUPS_BACKEND_CANCELcxx . . $ `src/cups/backend_common.h:372:9`!;
182 }
183 }
184
185 if (lib->lutcxx . . $ mitsu_lib#lut.) {
186 DEBUGcxx . . $ `src/cups/backend_common.h:59:9`!("Running print data through 3D LUT\n");
187 lib->DoColorConvcxx . . $ mitsu_lib#DoColorConv.(lib->lutcxx . . $ mitsu_lib#lut., databuf, cols, rows, stride, rgb_bgr);
188 }
189 #endif
190 return CUPS_BACKEND_OKcxx . . $ `src/cups/backend_common.h:367:9`!;
191 }
192
193 int mitsu_apply3dlut_planecxx . . $ mitsu_apply3dlut_plane(360a1387484245d8).(struct mitsu_libcxx . . $ mitsu_lib# *lib, const char *lutfname,
194 uint8_tcxx . . $ uint8_t# *data_r, uint8_tcxx . . $ uint8_t# *data_g, uint8_tcxx . . $ uint8_t# *data_b,
195 uint16_tcxx . . $ uint16_t# cols, uint16_tcxx . . $ uint16_t# rows)
196 {
197 #if defined(WITH_DYNAMICcxx . . $ `src/cups/backend_common.h:404:9`!)
198 char full[2048];
199 int i;
200
201 if (!lutfname)
202 return CUPS_BACKEND_OKcxx . . $ `src/cups/backend_common.h:367:9`!;
203 if (!lib->dl_handlecxx . . $ mitsu_lib#dl_handle.)
204 return CUPS_BACKEND_OKcxx . . $ `src/cups/backend_common.h:367:9`!;
205
206 snprintfcxx . . $ snprintf(ea502d73e74c754c).(full, sizeof(full), "%s/%s", corrtable_pathcxx . . $ corrtable_path., lutfname);
207
208 if (!lib->lutcxx . . $ mitsu_lib#lut.) {
209 uint8_tcxx . . $ uint8_t# *buf = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(LUT_LENcxx . . $ `src/cups/backend_mitsu.h:36:9`!);
210 if (!buf) {
211 ERRORcxx . . $ `src/cups/backend_common.h:63:9`!("Memory allocation failure!\n");
212 return CUPS_BACKEND_RETRY_CURRENTcxx . . $ `src/cups/backend_common.h:374:9`!;
213 }
214 if ((i = dyesub_read_filecxx . . $ `src/cups/backend_common.h:281:9`!(full, buf, LUT_LENcxx . . $ `src/cups/backend_mitsu.h:36:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)))
215 return i;
216 lib->lutcxx . . $ mitsu_lib#lut. = lib->Load3DColorTablecxx . . $ mitsu_lib#Load3DColorTable.(buf);
217 freecxx . . $ free(5d22bdacc48458e8).(buf);
218 if (!lib->lutcxx . . $ mitsu_lib#lut.) {
219 ERRORcxx . . $ `src/cups/backend_common.h:63:9`!("Unable to parse LUT file '%s'!\n", full);
220 return CUPS_BACKEND_CANCELcxx . . $ `src/cups/backend_common.h:372:9`!;
221 }
222 }
223
224 if (lib->lutcxx . . $ mitsu_lib#lut.) {
225 DEBUGcxx . . $ `src/cups/backend_common.h:59:9`!("Running print data through 3D LUT\n");
226 lib->DoColorConvPlanecxx . . $ mitsu_lib#DoColorConvPlane.(lib->lutcxx . . $ mitsu_lib#lut., data_r, data_g, data_b, cols * rows);
227 }
228 #endif
229 return CUPS_BACKEND_OKcxx . . $ `src/cups/backend_common.h:367:9`!;
230 }
231
232 int mitsu_readlamdatacxx . . $ mitsu_readlamdata(9e68d7da9333b61d).(const char *fname, uint16_tcxx . . $ uint16_t# lamstride,
233 uint8_tcxx . . $ uint8_t# *databuf, uint32_tcxx . . $ uint32_t# *datalen,
234 uint16_tcxx . . $ uint16_t# rows, uint16_tcxx . . $ uint16_t# cols, uint8_tcxx . . $ uint8_t# bpp)
235 {
236 int i, j, fd;
237 char full[2048];
238
239 snprintfcxx . . $ snprintf(ea502d73e74c754c).(full, sizeof(full), "%s/%s", corrtable_pathcxx . . $ corrtable_path., fname);
240
241 DEBUGcxx . . $ `src/cups/backend_common.h:59:9`!("Reading %d bytes of matte data from disk (%d/%d)\n", cols * rows * bpp, cols, lamstride);
242 fd = opencxx . . $ open(e156e3aa1e5c4ad1).(full, O_RDONLYcxx . . $ `<external>/14578502075116107718/fcntl-linux.h:43:9`!);
243 if (fd < 0) {
244 ERRORcxx . . $ `src/cups/backend_common.h:63:9`!("Unable to open matte lamination data file '%s'\n", full);
245 return CUPS_BACKEND_CANCELcxx . . $ `src/cups/backend_common.h:372:9`!;
246 }
247
248 /* Read in the matte data plane */
249 for (j = 0 ; j < rows ; j++) {
250 int remain = lamstride * bpp;
251
252 /* Read one row of lamination data at a time */
253 while (remain) {
254 i = readcxx . . $ read(7e34d0a36f355389).(fd, databuf + *datalen, remain);
255 if (i < 0)
256 return CUPS_BACKEND_CANCELcxx . . $ `src/cups/backend_common.h:372:9`!;
257 if (i == 0) {
258 /* We hit EOF, restart from beginning */
259 lseekcxx . . $ lseek(f1afe674ac17c82e).(fd, 0, SEEK_SETcxx . . $ `<external>/14710646456994434043/fcntl.h:137:10`!);
260 continue;
261 }
262 *datalen += i;
263 remain -= i;
264 }
265 /* Back off the buffer so we "wrap" on the print row. */
266 *datalen -= ((lamstride - cols) * bpp);
267 }
268
269 return CUPS_BACKEND_OKcxx . . $ `src/cups/backend_common.h:367:9`!;
270 }
271
272 const char *mitsu_temperaturescxx . . $ mitsu_temperatures(42624c5f3be67010).(uint8_tcxx . . $ uint8_t# temp)
273 {
274 switch(temp) {
275 case TEMPERATURE_NORMALcxx . . $ `src/cups/backend_mitsu.h:150:9`!:
276 return "Normal";
277 case TEMPERATURE_PREHEATcxx . . $ `src/cups/backend_mitsu.h:151:9`!:
278 return "Warming Up";
279 case TEMPERATURE_COOLINGcxx . . $ `src/cups/backend_mitsu.h:152:9`!:
280 return "Cooling Down";
281 default:
282 break;
283 }
284 return "Unknown Temperature Status";
285 }
286
287 const char *mitsu_media_typescxx . . $ mitsu_media_types(c1683707af617231).(int printer, uint8_tcxx . . $ uint8_t# brand, uint8_tcxx . . $ uint8_t# type)
288 {
289 if (brand == 0xff) { /* Mitsubishi */
290 if (printer == P_MITSU_M1cxx . . $ P_MITSU_M1.) {
291 if (type == 0x02)
292 return "CK-M46S (4x6)";
293 else if (type == 0x04)
294 return "CK-M57S (5x7)";
295 else if (type == 0x0f)
296 return "CK-M68S (6x8)";
297 } else if (printer == P_MITSU_D80cxx . . $ P_MITSU_D80.) {
298 if (type == 0x0f)
299 return "CK-D868 (6x8)";
300 } else if (printer == P_MITSU_D90cxx . . $ P_MITSU_D90.) {
301 if (type == 0x0f)
302 return "CK-D768/CK-D868 (6x8)";
303 }
304
305 /* Mitsu D70, and D90 fallthrough */
306 if (type == 0x01)
307 return "CK-D735 (3.5x5)";
308 else if (type == 0x02)
309 return "CK-D746 (4x6)";
310 else if (type == 0x04)
311 return "CK-D757 (5x7)";
312 else if (type == 0x05)
313 return "CK-D769 (6x9)";
314 else if (type == 0x0f)
315 return "CK-D768 (6x8)";
316 } else if (brand == 0xe0) { /* SilverLab */
317 if (type == 0x0f)
318 return "CK-D868 SL (6x8)";
319 } else if (brand == 0x61) { /* Mitsubishi (K60 series & W5000 series) */
320 if (type == 0x84)
321 return "CK-K57R (5x7)";
322 else if (type == 0x8f)
323 return "CK-K76R (6x8)";
324 else if (type == 0xb2)
325 return "PK58125 + CK5000";
326 } else if (brand == 0x6c) { /* Kodak */
327 if (type == 0x84)
328 return "Kodak 5R (5x7)";
329 else if (type == 0x8f)
330 return "Kodak 6R (6x8)";
331 } else if (brand == 0x7a ||
332 brand == 0xda) { /* Fujifilm*/
333 if (type == 0x01)
334 return "RL-CF900 (3.5x5)";
335 else if (type == 0x02)
336 return "RK-CF800/4R (4x6)";
337 else if (type == 0x04)
338 return "R2L-CF460/5R (5x7)";
339 else if (type == 0x0f)
340 return "R68-CF400/6R (6x8)";
341 } else if (brand == 0xd1) { /* Mitsubishi (D70/D80 -S series) */
342 if (type == 0x02)
343 return "CK-D715 (4x6)";
344 else if (type == 0x04)
345 return "CK-D718 (5x7)";
346 else if (type == 0x05)
347 return "CK-D723 (6x9)";
348 else if (type == 0x0f)
349 return "CK-D720 (6x8)";
350 } else if (brand == 0xd6) { /* DNP */
351 if (type == 0x74)
352 return "DNP 5x7";
353 else if (type == 0x7f)
354 return "DNP 6x8";
355 else if (type == 0x90)
356 return "DNP 4x8";
357 }
358
359 /* Default fallback */
360 if ((type & 0xf) == 0x01)
361 return "Unknown (3.5x5)";
362 else if ((type & 0xf) == 0x02)
363 return "Unknown (4x6)";
364 else if ((type & 0xf) == 0x04)
365 return "Unknown (5x7)";
366 else if ((type & 0xf) == 0x05)
367 return "Unknown (6x9)";
368 else if ((type & 0xf) == 0x0f)
369 return "Unknown (6x8)";
370
371 return "Unknown";
372
373 // Also CK-D746-U for D70-U model
374 // CK-D820 (6x8) for D80-S model
375 // D90 can use _all_ of these types except for the -U!
376
377 // CK-M15S (6x4 for M15)
378 // CK-M18S (5x7 for M15)
379 // CK-M20S (6x8 for M15)
380 }