| 1 | /* |
| 2 | * |
| 3 | * Print plug-in RAW driver for the GIMP. |
| 4 | * |
| 5 | * Copyright 1997-2000 Michael Sweet ([email protected]) and |
| 6 | * Robert Krawitz ([email protected]) |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public License as published by the Free |
| 10 | * Software Foundation; either version 2 of the License, or (at your option) |
| 11 | * any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, but |
| 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 16 | * for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file must include only standard C header files. The core code must |
| 24 | * compile on generic platforms that don't support glib, gimp, gtk, etc. |
| 25 | */ |
| 26 | |
| 27 | /* |
| 28 | * To use this driver, we recommend this: |
| 29 | * |
| 30 | * stp_set_driver(v, "raw-data-8"); // or raw_data-16 |
| 31 | * stp_set_string_parameter(v, "PageSize", "Custom"); |
| 32 | * stp_set_page_height(v, HEIGHT); |
| 33 | * stp_set_page_width(v, WIDTH); |
| 34 | * |
| 35 | * For further details, see compute_thumbnail() in gutenprintui2/panel.c |
| 36 | */ |
| 37 | |
| 38 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:411:9`! |
| 39 | #include <config.h>cxx . . $ `<file>/config.h`/ |
| 40 | #endif |
| 41 | #include <gutenprint/gutenprint.h>cxx . . $ `<file>/include/gutenprint/gutenprint.h`/ |
| 42 | #include "gutenprint-internal.h"cxx . . $ `<file>/src/main/gutenprint-internal.h`/ |
| 43 | #include <gutenprint/gutenprint-intl-internal.h>cxx . . $ `<file>/include/gutenprint/gutenprint-intl-internal.h`/ |
| 44 | #include <string.h> |
| 45 | #include <stdio.h> |
| 46 | |
| 47 | #ifdef __GNUC__cxx . . $ `<built-in>:8:9`! |
| 48 | #define inlinecxx . . $ `src/main/print-raw.c:48:9`! __inline__ |
| 49 | #endif |
| 50 | |
| 51 | typedef structcxx . . $ $anonymous_type_b10e1bfb7fd3d9a2_0# |
| 52 | { |
| 53 | const char *output_typecxx . . $ $anonymous_type_b10e1bfb7fd3d9a2_0#output_type.; |
| 54 | int output_channelscxx . . $ $anonymous_type_b10e1bfb7fd3d9a2_0#output_channels.; |
| 55 | int rotate_channelscxx . . $ $anonymous_type_b10e1bfb7fd3d9a2_0#rotate_channels.; |
| 56 | const char *namecxx . . $ $anonymous_type_b10e1bfb7fd3d9a2_0#name.; |
| 57 | } ink_tcxx . . $ ink_t#; |
| 58 | |
| 59 | typedef struct raw_printercxx . . $ raw_printer# |
| 60 | { |
| 61 | int output_bitscxx . . $ raw_printer#output_bits.; |
| 62 | } raw_printer_tcxx . . $ raw_printer_t#; |
| 63 | |
| 64 | static const raw_printer_tcxx . . $ raw_printer_t# raw_model_capabilitiescxx . . $ raw_model_capabilities.[] = |
| 65 | { |
| 66 | { |
| 67 | 16 |
| 68 | }, |
| 69 | { |
| 70 | 8 |
| 71 | }, |
| 72 | }; |
| 73 | |
| 74 | static const ink_tcxx . . $ ink_t# inkscxx . . $ inks.[] = |
| 75 | { |
| 76 | { "RGB", 3, 0, "RGB" }, |
| 77 | { "CMY", 3, 0, "CMY" }, |
| 78 | { "KCMY", 4, 1, "CMYK" }, |
| 79 | { "KCMY", 4, 0, "KCMY" }, |
| 80 | { "Whitescale", 1, 0, "RGBGray" }, |
| 81 | { "Grayscale", 1, 0, "CMYGray" }, |
| 82 | }; |
| 83 | |
| 84 | static const int ink_countcxx . . $ ink_count. = sizeof(inkscxx . . $ inks.) / sizeof(ink_tcxx . . $ ink_t#); |
| 85 | |
| 86 | static const stp_parameter_tcxx . . $ stp_parameter_t# the_parameterscxx . . $ the_parameters.[] = |
| 87 | { |
| 88 | { |
| 89 | "InkType", N_cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:67:17`!("Ink Type"), "Color=Yes,Category=Advanced Printer Setup", |
| 90 | N_cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:67:17`!("Type of ink in the printer"), |
| 91 | STP_PARAMETER_TYPE_STRING_LISTcxx . . $ STP_PARAMETER_TYPE_STRING_LIST., STP_PARAMETER_CLASS_FEATUREcxx . . $ STP_PARAMETER_CLASS_FEATURE., |
| 92 | STP_PARAMETER_LEVEL_BASICcxx . . $ STP_PARAMETER_LEVEL_BASIC., 1, 1, STP_CHANNEL_NONEcxx . . $ `include/gutenprint/vars.h:154:9`!, 1, 0 |
| 93 | }, |
| 94 | { |
| 95 | "PrintingMode", N_cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:67:17`!("Printing Mode"), "Color=Yes,Category=Core Parameter", |
| 96 | N_cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:67:17`!("Printing Output Mode"), |
| 97 | STP_PARAMETER_TYPE_STRING_LISTcxx . . $ STP_PARAMETER_TYPE_STRING_LIST., STP_PARAMETER_CLASS_COREcxx . . $ STP_PARAMETER_CLASS_CORE., |
| 98 | STP_PARAMETER_LEVEL_BASICcxx . . $ STP_PARAMETER_LEVEL_BASIC., 1, 1, STP_CHANNEL_NONEcxx . . $ `include/gutenprint/vars.h:154:9`!, 1, 0 |
| 99 | }, |
| 100 | { |
| 101 | "PageSize", N_cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:67:17`!("Page Size"), "Color=No,Category=Basic Printer Setup", |
| 102 | N_cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:67:17`!("Size of the paper being printed to"), |
| 103 | STP_PARAMETER_TYPE_STRING_LISTcxx . . $ STP_PARAMETER_TYPE_STRING_LIST., STP_PARAMETER_CLASS_COREcxx . . $ STP_PARAMETER_CLASS_CORE., |
| 104 | STP_PARAMETER_LEVEL_BASICcxx . . $ STP_PARAMETER_LEVEL_BASIC., 1, 1, STP_CHANNEL_NONEcxx . . $ `include/gutenprint/vars.h:154:9`!, 1, 0 |
| 105 | }, |
| 106 | }; |
| 107 | |
| 108 | static const int the_parameter_countcxx . . $ the_parameter_count. = |
| 109 | sizeof(the_parameterscxx . . $ the_parameters.) / sizeof(const stp_parameter_tcxx . . $ stp_parameter_t#); |
| 110 | |
| 111 | static stp_parameter_list_tcxx . . $ stp_parameter_list_t# |
| 112 | raw_list_parameterscxx . . $ raw_list_parameters(817585d40f809196).(const stp_vars_tcxx . . $ stp_vars_t# *v) |
| 113 | { |
| 114 | stp_parameter_list_tcxx . . $ stp_parameter_list_t# *ret = stp_parameter_list_createcxx . . $ stp_parameter_list_create(50c7df7de5344ebb).(); |
| 115 | int i; |
| 116 | (void)v; |
| 117 | for (i = 0; i < the_parameter_countcxx . . $ the_parameter_count.; i++) |
| 118 | stp_parameter_list_add_paramcxx . . $ stp_parameter_list_add_param(9dab94dbd10bbd1f).(ret, &(the_parameterscxx . . $ the_parameters.[i])); |
| 119 | return ret; |
| 120 | } |
| 121 | |
| 122 | static void |
| 123 | raw_parameterscxx . . $ raw_parameters(dfd5b9531b51a6d2).(const stp_vars_tcxx . . $ stp_vars_t# *v, const char *name, |
| 124 | stp_parameter_tcxx . . $ stp_parameter_t# *description) |
| 125 | { |
| 126 | int i; |
| 127 | (void)v; |
| 128 | description->p_typecxx . . $ $anonymous_type_c987533f3b833c82_8#p_type. = STP_PARAMETER_TYPE_INVALIDcxx . . $ STP_PARAMETER_TYPE_INVALID.; |
| 129 | if (name == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 130 | return; |
| 131 | |
| 132 | description->defltcxx . . $ $anonymous_type_c987533f3b833c82_8#deflt..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_10#str. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 133 | for (i = 0; i < the_parameter_countcxx . . $ the_parameter_count.; i++) |
| 134 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, the_parameterscxx . . $ the_parameters.[i].namecxx . . $ $anonymous_type_c987533f3b833c82_8#name.) == 0) |
| 135 | { |
| 136 | stp_fill_parameter_settingscxx . . $ stp_fill_parameter_settings(bb1f9d668495a4b4).(description, &(the_parameterscxx . . $ the_parameters.[i])); |
| 137 | break; |
| 138 | } |
| 139 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "InkType") == 0) |
| 140 | { |
| 141 | description->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str. = stp_string_list_createcxx . . $ stp_string_list_create(f262b3b5e10fad14).(); |
| 142 | for (i = 0; i < ink_countcxx . . $ ink_count.; i++) |
| 143 | stp_string_list_add_stringcxx . . $ stp_string_list_add_string(61ec312b340c2952).(description->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str., |
| 144 | inkscxx . . $ inks.[i].namecxx . . $ $anonymous_type_b10e1bfb7fd3d9a2_0#name., inkscxx . . $ inks.[i].namecxx . . $ $anonymous_type_b10e1bfb7fd3d9a2_0#name.); |
| 145 | description->defltcxx . . $ $anonymous_type_c987533f3b833c82_8#deflt..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_10#str. = |
| 146 | stp_string_list_paramcxx . . $ stp_string_list_param(1d71fb1c8ad3926a).(description->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str., 0)->namecxx . . $ $anonymous_type_cb0224bbe5755622_0#name.; |
| 147 | } |
| 148 | else if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "PrintingMode") == 0) |
| 149 | { |
| 150 | description->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str. = stp_string_list_createcxx . . $ stp_string_list_create(f262b3b5e10fad14).(); |
| 151 | stp_string_list_add_stringcxx . . $ stp_string_list_add_string(61ec312b340c2952). |
| 152 | (description->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str., "Color", _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("Color")); |
| 153 | stp_string_list_add_stringcxx . . $ stp_string_list_add_string(61ec312b340c2952). |
| 154 | (description->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str., "BW", _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("Black and White")); |
| 155 | description->defltcxx . . $ $anonymous_type_c987533f3b833c82_8#deflt..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_10#str. = |
| 156 | stp_string_list_paramcxx . . $ stp_string_list_param(1d71fb1c8ad3926a).(description->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str., 0)->namecxx . . $ $anonymous_type_cb0224bbe5755622_0#name.; |
| 157 | } |
| 158 | else if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "PageSize") == 0) |
| 159 | { |
| 160 | const stp_papersize_list_tcxx . . $ stp_papersize_list_t# *paper_sizes = |
| 161 | stpi_get_standard_papersize_listcxx . . $ stpi_get_standard_papersize_list(d3875b0f088d0326).(); |
| 162 | const stp_papersize_list_item_tcxx . . $ stp_papersize_list_item_t# *ptli = |
| 163 | stpi_papersize_list_get_startcxx . . $ `src/main/gutenprint-internal.h:121:9`!(paper_sizes); |
| 164 | description->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str. = stp_string_list_createcxx . . $ stp_string_list_create(f262b3b5e10fad14).(); |
| 165 | while (ptli) |
| 166 | { |
| 167 | const stp_papersize_tcxx . . $ stp_papersize_t# *pt = stpi_paperlist_item_get_datacxx . . $ `src/main/gutenprint-internal.h:125:9`!(ptli); |
| 168 | stp_string_list_add_stringcxx . . $ stp_string_list_add_string(61ec312b340c2952).(description->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str., |
| 169 | pt->namecxx . . $ $anonymous_type_51fd7f0ef3c7bff0_2#name., gettextcxx . . $ `include/gutenprint/gutenprint-intl-internal.h:61:11`!(pt->text)); |
| 170 | ptli = stpi_paperlist_item_nextcxx . . $ `src/main/gutenprint-internal.h:123:9`!(ptli); |
| 171 | } |
| 172 | description->defltcxx . . $ $anonymous_type_c987533f3b833c82_8#deflt..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_10#str. = |
| 173 | stp_string_list_paramcxx . . $ stp_string_list_param(1d71fb1c8ad3926a).(description->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str., 0)->namecxx . . $ $anonymous_type_cb0224bbe5755622_0#name.; |
| 174 | } |
| 175 | else |
| 176 | description->is_activecxx . . $ $anonymous_type_c987533f3b833c82_8#is_active. = 0; |
| 177 | } |
| 178 | |
| 179 | static void |
| 180 | raw_imageable_areacxx . . $ raw_imageable_area(25e50967534aa153).(const stp_vars_tcxx . . $ stp_vars_t# *v, |
| 181 | stp_dimension_tcxx . . $ stp_dimension_t# *left, |
| 182 | stp_dimension_tcxx . . $ stp_dimension_t# *right, |
| 183 | stp_dimension_tcxx . . $ stp_dimension_t# *bottom, |
| 184 | stp_dimension_tcxx . . $ stp_dimension_t# *top) |
| 185 | { |
| 186 | *left = 0; |
| 187 | *top = 0; |
| 188 | *right = stp_get_page_widthcxx . . $ stp_get_page_width(7f9a8d44e8193bba).(v); |
| 189 | *bottom = stp_get_page_heightcxx . . $ stp_get_page_height(7f9a8d44e8193bba).(v); |
| 190 | } |
| 191 | |
| 192 | static void |
| 193 | raw_limitcxx . . $ raw_limit(25e50967534aa153).(const stp_vars_tcxx . . $ stp_vars_t# *v, /* I */ |
| 194 | stp_dimension_tcxx . . $ stp_dimension_t# *width, stp_dimension_tcxx . . $ stp_dimension_t# *height, |
| 195 | stp_dimension_tcxx . . $ stp_dimension_t# *min_width, stp_dimension_tcxx . . $ stp_dimension_t# *min_height) |
| 196 | { |
| 197 | *width = 65535; |
| 198 | *height = 65535; |
| 199 | *min_width = 1; |
| 200 | *min_height = 1; |
| 201 | (void)v; |
| 202 | } |
| 203 | |
| 204 | static void |
| 205 | raw_describe_resolutioncxx . . $ raw_describe_resolution(5883f070c6139f40).(const stp_vars_tcxx . . $ stp_vars_t# *v, |
| 206 | stp_resolution_tcxx . . $ stp_resolution_t# *x, stp_resolution_tcxx . . $ stp_resolution_t# *y) |
| 207 | { |
| 208 | *x = 72; |
| 209 | *y = 72; |
| 210 | (void)v; |
| 211 | } |
| 212 | |
| 213 | static const char * |
| 214 | raw_describe_outputcxx . . $ raw_describe_output(4be828c28602b542).(const stp_vars_tcxx . . $ stp_vars_t# *v) |
| 215 | { |
| 216 | const char *ink_type = stp_get_string_parametercxx . . $ stp_get_string_parameter(3e3ce5d385745545).(v, "InkType"); |
| 217 | if (ink_type) |
| 218 | { |
| 219 | int i; |
| 220 | for (i = 0; i < ink_countcxx . . $ ink_count.; i++) |
| 221 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(ink_type, inkscxx . . $ inks.[i].namecxx . . $ $anonymous_type_b10e1bfb7fd3d9a2_0#name.) == 0) |
| 222 | return inkscxx . . $ inks.[i].output_typecxx . . $ $anonymous_type_b10e1bfb7fd3d9a2_0#output_type.; |
| 223 | } |
| 224 | return "RGB"; |
| 225 | } |
| 226 | |
| 227 | static int |
| 228 | raw_printcxx . . $ raw_print(be5d09c432b01f95).(const stp_vars_tcxx . . $ stp_vars_t# *v, stp_image_tcxx . . $ stp_image_t# *image) |
| 229 | { |
| 230 | int model = stp_get_model_idcxx . . $ stp_get_model_id(b1be75487ade2f93).(v); |
| 231 | int width = stp_get_page_widthcxx . . $ stp_get_page_width(7f9a8d44e8193bba).(v); |
| 232 | int height = stp_get_page_heightcxx . . $ stp_get_page_height(7f9a8d44e8193bba).(v); |
| 233 | int i, j; |
| 234 | int y; /* Looping vars */ |
| 235 | stp_vars_tcxx . . $ stp_vars_t# *nv = stp_vars_create_copycxx . . $ stp_vars_create_copy(d6c73ebbfa1de3f9).(v); |
| 236 | int out_channels; |
| 237 | unsigned short *final_out = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 238 | int status = 1; |
| 239 | int bytes_per_channel = raw_model_capabilitiescxx . . $ raw_model_capabilities.[model].output_bitscxx . . $ raw_printer#output_bits. / 8; |
| 240 | int ink_channels = 1; |
| 241 | int rotate_output = 0; |
| 242 | const char *ink_type = stp_get_string_parametercxx . . $ stp_get_string_parameter(3e3ce5d385745545).(nv, "InkType"); |
| 243 | stp_image_initcxx . . $ stp_image_init(7010b42a94b47a79).(image); |
| 244 | |
| 245 | if (!stp_verifycxx . . $ stp_verify(60b55b6a36641e80).(nv)) |
| 246 | { |
| 247 | stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(nv, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("Print options not verified; cannot print.\n")); |
| 248 | stp_vars_destroycxx . . $ stp_vars_destroy(1a97b8462f9f913c).(nv); |
| 249 | stp_image_concludecxx . . $ stp_image_conclude(7010b42a94b47a79).(image); |
| 250 | return 0; |
| 251 | } |
| 252 | if (width != stp_image_widthcxx . . $ stp_image_width(ba31fd85910919f2).(image) || height != stp_image_heightcxx . . $ stp_image_height(ba31fd85910919f2).(image)) |
| 253 | { |
| 254 | stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(nv, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("Image dimensions must match paper dimensions")); |
| 255 | stp_vars_destroycxx . . $ stp_vars_destroy(1a97b8462f9f913c).(nv); |
| 256 | stp_image_concludecxx . . $ stp_image_conclude(7010b42a94b47a79).(image); |
| 257 | return 0; |
| 258 | } |
| 259 | if (ink_type) |
| 260 | { |
| 261 | for (i = 0; i < ink_countcxx . . $ ink_count.; i++) |
| 262 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(ink_type, inkscxx . . $ inks.[i].namecxx . . $ $anonymous_type_b10e1bfb7fd3d9a2_0#name.) == 0) |
| 263 | { |
| 264 | stp_set_string_parametercxx . . $ stp_set_string_parameter(7405204ff890c7b8).(nv, "STPIOutputType", inkscxx . . $ inks.[i].output_typecxx . . $ $anonymous_type_b10e1bfb7fd3d9a2_0#output_type.); |
| 265 | ink_channels = inkscxx . . $ inks.[i].output_channelscxx . . $ $anonymous_type_b10e1bfb7fd3d9a2_0#output_channels.; |
| 266 | rotate_output = inkscxx . . $ inks.[i].rotate_channelscxx . . $ $anonymous_type_b10e1bfb7fd3d9a2_0#rotate_channels.; |
| 267 | break; |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | stp_set_boolean_parametercxx . . $ stp_set_boolean_parameter(8ec0183b6ab8ae2d).(nv, "SimpleGamma", 1); |
| 272 | stp_channel_resetcxx . . $ stp_channel_reset(1a97b8462f9f913c).(nv); |
| 273 | for (i = 0; i < ink_channels; i++) |
| 274 | stp_channel_addcxx . . $ stp_channel_add(be410e6e969dd53f).(nv, i, 0, 1.0); |
| 275 | |
| 276 | if (bytes_per_channel == 1) |
| 277 | out_channels = stp_color_initcxx . . $ stp_color_init(8474e95f5358b69d).(nv, image, 256); |
| 278 | else |
| 279 | out_channels = stp_color_initcxx . . $ stp_color_init(8474e95f5358b69d).(nv, image, 65536); |
| 280 | |
| 281 | if (out_channels != ink_channels && out_channels != 1 && ink_channels != 1) |
| 282 | { |
| 283 | stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(nv, "Internal error! Output channels or input channels must be 1\n"); |
| 284 | stp_vars_destroycxx . . $ stp_vars_destroy(1a97b8462f9f913c).(nv); |
| 285 | stp_image_concludecxx . . $ stp_image_conclude(7010b42a94b47a79).(image); |
| 286 | return 0; |
| 287 | } |
| 288 | |
| 289 | if (out_channels != ink_channels) |
| 290 | final_out = stp_malloccxx . . $ stp_malloc(bfcfa4d6b7f7ef64).(width * ink_channels * 2); |
| 291 | |
| 292 | for (y = 0; y < height; y++) |
| 293 | { |
| 294 | unsigned short *out; |
| 295 | unsigned short *real_out; |
| 296 | unsigned zero_mask; |
| 297 | if (stp_color_get_rowcxx . . $ stp_color_get_row(ba7b466a9562988e).(nv, image, y, &zero_mask)) |
| 298 | { |
| 299 | status = 2; |
| 300 | break; |
| 301 | } |
| 302 | out = stp_channel_get_inputcxx . . $ stp_channel_get_input(58f317534f8c8659).(nv); |
| 303 | real_out = out; |
| 304 | if (rotate_output) |
| 305 | { |
| 306 | unsigned short *tmp_out = real_out; |
| 307 | for (i = 0; i < width; i++) |
| 308 | { |
| 309 | unsigned short tmp = tmp_out[0]; |
| 310 | for (j = 0; j < ink_channels - 1; j++) |
| 311 | tmp_out[j] = tmp_out[j + 1]; |
| 312 | tmp_out[ink_channels - 1] = tmp; |
| 313 | tmp_out += ink_channels; |
| 314 | } |
| 315 | } |
| 316 | if (out_channels != ink_channels) |
| 317 | { |
| 318 | real_out = final_out; |
| 319 | if (out_channels < ink_channels) |
| 320 | { |
| 321 | for (i = 0; i < width; i++) |
| 322 | { |
| 323 | for (j = 0; j < ink_channels; j++) |
| 324 | final_out[i * ink_channels + j] = out[i]; |
| 325 | } |
| 326 | } |
| 327 | else |
| 328 | { |
| 329 | for (i = 0; i < width; i++) |
| 330 | { |
| 331 | int avg = 0; |
| 332 | for (j = 0; j < out_channels; j++) |
| 333 | avg += out[i * out_channels + j]; |
| 334 | final_out[i] = avg / out_channels; |
| 335 | } |
| 336 | } |
| 337 | } |
| 338 | if (bytes_per_channel == 1) |
| 339 | { |
| 340 | unsigned char *char_out = (unsigned char *) real_out; |
| 341 | for (i = 0; i < width * ink_channels; i++) |
| 342 | char_out[i] = real_out[i] / 257; |
| 343 | } |
| 344 | stp_zfwritecxx . . $ stp_zfwrite(e7e85bda1a353e8c).((char *) real_out, |
| 345 | width * ink_channels * bytes_per_channel, 1, nv); |
| 346 | } |
| 347 | stp_image_concludecxx . . $ stp_image_conclude(7010b42a94b47a79).(image); |
| 348 | if (final_out) |
| 349 | stp_freecxx . . $ stp_free(5d22bdacc48458e8).(final_out); |
| 350 | stp_vars_destroycxx . . $ stp_vars_destroy(1a97b8462f9f913c).(nv); |
| 351 | return status; |
| 352 | } |
| 353 | |
| 354 | static const stp_printfuncs_tcxx . . $ stp_printfuncs_t# print_raw_printfuncscxx . . $ print_raw_printfuncs. = |
| 355 | { |
| 356 | raw_list_parameterscxx . . $ raw_list_parameters(817585d40f809196)., |
| 357 | raw_parameterscxx . . $ raw_parameters(dfd5b9531b51a6d2)., |
| 358 | stp_default_media_sizecxx . . $ stp_default_media_size(2eafa46ec96dc268)., |
| 359 | raw_imageable_areacxx . . $ raw_imageable_area(25e50967534aa153)., |
| 360 | raw_imageable_areacxx . . $ raw_imageable_area(25e50967534aa153)., |
| 361 | raw_limitcxx . . $ raw_limit(25e50967534aa153)., |
| 362 | raw_printcxx . . $ raw_print(be5d09c432b01f95)., |
| 363 | raw_describe_resolutioncxx . . $ raw_describe_resolution(5883f070c6139f40)., |
| 364 | raw_describe_outputcxx . . $ raw_describe_output(4be828c28602b542)., |
| 365 | stp_verify_printer_paramscxx . . $ stp_verify_printer_params(60b55b6a36641e80)., |
| 366 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 367 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 368 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 369 | stpi_standard_describe_papersizecxx . . $ stpi_standard_describe_papersize(977e5bf217e59ec). |
| 370 | }; |
| 371 | |
| 372 | |
| 373 | |
| 374 | |
| 375 | static stp_family_tcxx . . $ stp_family_t# print_raw_module_datacxx . . $ print_raw_module_data. = |
| 376 | { |
| 377 | &print_raw_printfuncscxx . . $ print_raw_printfuncs., |
| 378 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! |
| 379 | }; |
| 380 | |
| 381 | |
| 382 | static int |
| 383 | print_raw_module_initcxx . . $ print_raw_module_init(b126dc7c1de90089).(void) |
| 384 | { |
| 385 | return stpi_family_registercxx . . $ stpi_family_register(29ae8ff464c7f7e5).(print_raw_module_datacxx . . $ print_raw_module_data..printer_listcxx . . $ stp_family#printer_list.); |
| 386 | } |
| 387 | |
| 388 | |
| 389 | static int |
| 390 | print_raw_module_exitcxx . . $ print_raw_module_exit(b126dc7c1de90089).(void) |
| 391 | { |
| 392 | return stpi_family_unregistercxx . . $ stpi_family_unregister(29ae8ff464c7f7e5).(print_raw_module_datacxx . . $ print_raw_module_data..printer_listcxx . . $ stp_family#printer_list.); |
| 393 | } |
| 394 | |
| 395 | |
| 396 | /* Module header */ |
| 397 | #define stp_module_versioncxx . . $ `src/main/print-raw.c:397:9`! print_raw_LTX_stp_module_version |
| 398 | #define stp_module_datacxx . . $ `src/main/print-raw.c:398:9`! print_raw_LTX_stp_module_data |
| 399 | |
| 400 | stp_module_version_tcxx . . $ stp_module_version_t# stp_module_versioncxx . . $ `src/main/print-raw.c:397:9`! = {0, 0}; |
| 401 | |
| 402 | stp_module_tcxx . . $ stp_module_t# stp_module_datacxx . . $ `src/main/print-raw.c:398:9`! = |
| 403 | { |
| 404 | "raw", |
| 405 | VERSIONcxx . . $ `../../config.h:204:9`!, |
| 406 | "RAW family driver", |
| 407 | STP_MODULE_CLASS_FAMILYcxx . . $ STP_MODULE_CLASS_FAMILY., |
| 408 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 409 | print_raw_module_initcxx . . $ print_raw_module_init(b126dc7c1de90089)., |
| 410 | print_raw_module_exitcxx . . $ print_raw_module_exit(b126dc7c1de90089)., |
| 411 | (void *) &print_raw_module_datacxx . . $ print_raw_module_data. |
| 412 | }; |