📄 pclcap.c
字号:
/* More than 65535 levels cannot be represented in a Configure Raster Data command with format 2. *//* Combinations of resolutions and intensity levels */static const eprn_ResLev rl_basic[] = { {basic_resolutions, two_levels}, {NULL, NULL} }, rl_basic_without_100[] = { {basic_without_100, two_levels}, {NULL, NULL} }, rl_hpdj6xx_black[] = { {basic_resolutions, two_levels}, {six_by_three, two_levels}, {sixhundred, two_levels}, {NULL, NULL} }, rl_hpdj6xx_colour[] = { {basic_resolutions, two_levels}, {six_by_three, two_levels}, {NULL, NULL} }, rl_three[] = { {threehundred, two_levels}, {NULL, NULL} }, rl_six[] = { {sixhundred, two_levels}, {NULL, NULL} }, rl_hpdj85x_black[] = { {basic_without_100, two_levels}, {sixhundred, two_levels}, {NULL, NULL} }, rl_three_with_levels_2_4[] = { {threehundred, two_to_four_levels}, {NULL, NULL} }, rl_three_with_levels_3_4[] = { {threehundred, three_to_four_levels}, {NULL, NULL} }, rl_three_with_levels_4[] = { {threehundred, four_levels}, {NULL, NULL} }, rl_hpdj1120c_black[] = { {rel_hpdj1120c_black, two_levels}, {threehundred, four_levels}, {NULL, NULL} }, rl_150_and_300[] = { {rel_150_and_300, two_levels}, {NULL, NULL} }, rl_any_two_levels[] = { /* Any resolution, but only two intensity levels */ {NULL, two_levels}, {NULL, NULL} }, rl_any[] = { {NULL, any_levels}, {NULL, NULL} };/*****************************************************************************//* Colour capability lists */static const eprn_ColourInfo ci_old_mono[] = { /* DeskJet 5xx monochrome printers */ { eprn_DeviceGray, {rl_basic, NULL} }, { eprn_DeviceGray, {NULL, NULL} } }, ci_hpdj500c[] = { /* HP DeskJet 500C: black or CMY cartridge */ { eprn_DeviceGray, {rl_basic, NULL} }, { eprn_DeviceCMY, {rl_basic, NULL} }, { eprn_DeviceGray, {NULL, NULL} } }, ci_hpdj540[] = { /* HP DeskJet 540: black or CMY cartridge */ { eprn_DeviceGray, {rl_basic_without_100, NULL} }, { eprn_DeviceCMY, {rl_basic_without_100, NULL} }, { eprn_DeviceGray, {NULL, NULL} } }, ci_hpdj5xx_cmyk[] = { /* HP DeskJet 550C or 560C: black and CMY cartridges, but the inks should not mix. */ { eprn_DeviceGray, {rl_basic, NULL} }, { eprn_DeviceCMY, {rl_basic, NULL} }, { eprn_DeviceCMY_plus_K, {rl_basic, NULL} }, { eprn_DeviceGray, {NULL, NULL} } }, ci_hpdj600[] = { /* HP DeskJet 600: black or CMY cartridge */ { eprn_DeviceGray, {rl_hpdj6xx_black, NULL} }, { eprn_DeviceCMY, {rl_hpdj6xx_colour, NULL} }, { eprn_DeviceGray, {NULL, NULL} } }, ci_hpdj6xx[] = { /* Series-600 CMYK printers */ { eprn_DeviceGray, {rl_hpdj6xx_black, NULL} }, { eprn_DeviceCMY, {rl_hpdj6xx_colour, NULL} }, { eprn_DeviceCMYK, {rl_hpdj6xx_colour, NULL} }, { eprn_DeviceCMYK, {rl_six, rl_three} }, { eprn_DeviceGray, {NULL, NULL} } }, ci_hpdj85x[] = { { eprn_DeviceGray, {rl_hpdj85x_black, NULL} }, { eprn_DeviceCMY, {rl_basic_without_100, NULL} }, { eprn_DeviceCMYK, {rl_basic_without_100, NULL} }, /* The following I have determined experimentally on a DJ 850C: */ { eprn_DeviceGray, {rl_three_with_levels_4, NULL} }, { eprn_DeviceCMYK, {rl_six, rl_three_with_levels_2_4} }, { eprn_DeviceCMYK, {rl_three_with_levels_4, rl_three_with_levels_3_4} }, { eprn_DeviceGray, {NULL, NULL} } }, ci_hpdj1120c[] = { /* DJ1120C p. 48 */ { eprn_DeviceGray, {rl_hpdj1120c_black, NULL} }, { eprn_DeviceCMYK, {rl_six, rl_three_with_levels_4} }, { eprn_DeviceCMYK, {rl_six, rl_three} }, { eprn_DeviceCMYK, {rl_three_with_levels_4, rl_three_with_levels_3_4} }, { eprn_DeviceCMYK, {rl_150_and_300, NULL} }, /* The following are combined from DJ1120C pp. 36 and 52. */ { eprn_DeviceGray, {rl_hpdj85x_black, NULL} }, { eprn_DeviceCMY, {rl_basic_without_100, NULL} }, { eprn_DeviceCMYK, {rl_basic_without_100, NULL} }, { eprn_DeviceGray, {NULL, NULL} } }, ci_any[] = { { eprn_DeviceGray, {rl_any, NULL} }, { eprn_DeviceRGB, {rl_any_two_levels, NULL} }, { eprn_DeviceCMY, {rl_any, NULL} }, { eprn_DeviceCMYK, {rl_any, rl_any} }, { eprn_DeviceGray, {NULL, NULL} } };/*****************************************************************************//* Descriptions of known PCL printers */const pcl_PrinterDescription pcl3_printers[] = { /* For the HP DeskJet and the HP DeskJet Plus I am guessing that they can be treated like the DJ 500. This seems reasonable because several HP documents group the HP DeskJet, the HP DeskJet Plus and the 500 and 500C DeskJets together. */ { HPDeskJet, pcl_level_3plus_DJ500, { "HP DeskJet", hpdj500_sizes, NULL, 0.0, ci_old_mono } }, { HPDeskJetPlus, pcl_level_3plus_DJ500, { "HP DeskJet Plus", hpdj500_sizes, NULL, 0.0, ci_old_mono } }, { HPDJPortable, pcl_level_3plus_S5, { "HP DeskJet Portable", hpdj3xx_sizes, NULL, 0.0, ci_old_mono } }, /* DJ3/4 p. 2: This printer behaves as the 550C without the colour cartridge. */ { HPDJ310, pcl_level_3plus_S5, { "HP DeskJet 310", hpdj3xx_sizes, NULL, 50*BP_PER_DOT, ci_hpdj500c } }, /* DJ3/4 p. 3: The 3xx DeskJets with the black cartridge installed behave identically to the DJ Portable, with the colour cartridge they can be treated as the DJ 500C. */ { HPDJ320, pcl_level_3plus_S5, { "HP DeskJet 320", hpdj3xx_sizes, NULL, 50*BP_PER_DOT, ci_hpdj500c } }, { HPDJ340, pcl_level_3plus_S5, { "HP DeskJet 340", hpdj3xx_sizes, NULL, 50*BP_PER_DOT, ci_hpdj500c } }, { HPDJ400, pcl_level_3plus_S5, { "HP DeskJet 400", hpdj400_sizes, NULL, 0.0, ci_hpdj500c } }, /* DJ3/4 p. 3 and p. 6. */ { HPDJ500, pcl_level_3plus_DJ500, {"HP DeskJet 500", hpdj500_sizes, NULL, 0.0, ci_old_mono } }, { HPDJ500C, pcl_level_3plus_S5, { "HP DeskJet 500C", hpdj500c_sizes, NULL, 0.17*BP_PER_IN, ci_hpdj500c } }, { HPDJ510, pcl_level_3plus_S5, { "HP DeskJet 510", common_sizes, NULL, 0.0, ci_old_mono } }, { HPDJ520, pcl_level_3plus_S5, { "HP DeskJet 520", common_sizes, NULL, 0.0, ci_old_mono } }, { HPDJ540, pcl_level_3plus_S68, { "HP DeskJet 540", hpdj540_sizes, hpdj540_custom_sizes, 0.13*BP_PER_IN, ci_hpdj540 } }, { HPDJ550C, pcl_level_3plus_S5, { "HP DeskJet 550C", common_sizes, NULL, 0.13*BP_PER_IN, ci_hpdj5xx_cmyk }}, { HPDJ560C, pcl_level_3plus_S5, { "HP DeskJet 560C", common_sizes, NULL, 0.13*BP_PER_IN, ci_hpdj5xx_cmyk }}, { pcl3_generic_old, pcl_level_3plus_ERG_both, { "unspecified PCL-3+ printer (old)", common_sizes, NULL, 0.0, ci_any } }, { HPDJ600, pcl_level_3plus_S68, { "HP DeskJet 600", hpdj6xx_and_8xx_sizes, hpdj_6xx_and_8xx_custom_sizes, 0.13*BP_PER_IN, ci_hpdj600 } }, { HPDJ660C, pcl_level_3plus_S68, { "HP DeskJet 660C", hpdj660c_sizes, hpdj_6xx_and_8xx_custom_sizes, 0.13*BP_PER_IN, ci_hpdj6xx } }, { HPDJ670C, pcl_level_3plus_S68, { "HP DeskJet 670C", hpdj660c_sizes, hpdj_6xx_and_8xx_custom_sizes, 0.13*BP_PER_IN, ci_hpdj6xx } }, /* This printer can be treated as the DJ 660C (DJ6/8 p. 2). */ { HPDJ680C, pcl_level_3plus_S68, { "HP DeskJet 680C", hpdj680c_sizes, hpdj_6xx_and_8xx_custom_sizes, 0.13*BP_PER_IN, ci_hpdj6xx } }, { HPDJ690C, pcl_level_3plus_S68, { "HP DeskJet 690C", hpdj680c_sizes, hpdj_6xx_and_8xx_custom_sizes, 0.13*BP_PER_IN, ci_hpdj6xx } }, { HPDJ850C, pcl_level_3plus_S68, { "HP DeskJet 850C", hpdj850c_sizes, hpdj850c_custom_sizes, 0.0, ci_hpdj85x } }, { HPDJ855C, pcl_level_3plus_S68, { "HP DeskJet 855C", hpdj850c_sizes, hpdj850c_custom_sizes, 0.0, ci_hpdj85x } }, /* I'm treating the 870C and the 890C just as the 85xCs. */ { HPDJ870C, pcl_level_3plus_S68, { "HP DeskJet 870C", hpdj850c_sizes, hpdj850c_custom_sizes, 0.0, ci_hpdj85x } }, { HPDJ890C, pcl_level_3plus_S68, { "HP DeskJet 890C", hpdj850c_sizes, hpdj850c_custom_sizes, 0.0, ci_hpdj85x } }, { HPDJ1120C, pcl_level_3plus_S68, { "HP DeskJet 1120C", hpdj1120c_sizes, hpdj1120c_custom_sizes, 0.0, ci_hpdj1120c } }, { pcl3_generic_new, pcl_level_3plus_S68, {"unspecified PCL-3+ printer", hpdj850c_sizes, any_custom_sizes, 0.0, ci_any }}};/*****************************************************************************/#ifndef NDEBUGstatic int checked = 0;static void check(void){ int j; /* Check that 'pcl3_printers[]' is indexed by printer code */ for (j = 0; j < array_size(pcl3_printers); j++) assert(pcl3_printers[j].id == j); checked = 1; return;}#endif /* !NDEBUG *//****************************************************************************** Function: pcl3_fill_defaults This function overwrites all fields in '*data' irrespective of their old contents and replaces them with default values acceptable for the printer. In particular, everything which is printer-specific and cannot be chosen by the user will be set in accordance with 'printer'.******************************************************************************/void pcl3_fill_defaults(pcl_Printer printer, pcl_FileData *data){#ifndef NDEBUG if (!checked) check();#endif /* !NDEBUG */ /* Set everything to zero */ memset(data, 0, sizeof(pcl_FileData)); /* Data which must not be zero */ /* At present, every printer listed here supports 300 ppi monochrome data with two intensity levels. Hence we need not look at the printer description. */ data->number_of_colorants = 1; data->colorant_array[0].hres = data->colorant_array[0].vres = 300; data->colorant_array[0].levels = 2; /* Data which are fixed by the printer model */ data->level = pcl3_printers[printer].level; /* Data for which zero is acceptable but not sensible */ data->duplex = -1; /* no simplex/duplex requests */ data->dry_time = -1; /* request no dry time */ switch (printer) { case HPDeskJet: /*FALLTHROUGH*/ case HPDeskJetPlus: /*FALLTHROUGH*/ case HPDJ500: /* The DJ 500 does not support method 9 but it does support method 3 (TRG500). I am guessing that the same is true for the HP DeskJet and the HP DeskJet Plus. */ data->compression = pcl_cm_delta; break; case pcl3_generic_old: /*FALLTHROUGH*/ case pcl3_generic_new: /* All HP drivers I have seen use method 2 when writing a PCL file to disk. Presumably, this is the most portable compression method. */ data->compression = pcl_cm_tiff; break; default: /* The best compression method, but not always supported. */ data->compression = pcl_cm_crdr; } /* Derived data */ pcl3_set_oldquality(data); return;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -