case VR_300X300:
switch (w) {
case 2592: return (modemParams.wd & BIT(WD_1728)) != 0;
+ case 3072: return (modemParams.wd & BIT(WD_2048)) != 0;
+ case 3648: return (modemParams.wd & BIT(WD_2432)) != 0;
+ case 1824: return (modemParams.wd & BIT(WD_1216)) != 0;
+ case 1296: return (modemParams.wd & BIT(WD_864)) != 0;
}
case VR_NORMAL:
case VR_FINE:
switch (vr) {
case VR_300X300:
widths[0] = 2592;
+ widths[1] = 3072;
+ widths[2] = 3648;
+ widths[3] = 1824;
+ widths[4] = 1296;
break;
case VR_R16:
widths[0] = 3456;
void
Class2Params::setPageWidthInMM(u_int w)
{
- // This function is unused and doesn't support VR_300X300 and VR_R16.
- wd = (w == 255 ? WD_2048 : w == 303 ? WD_2432 : WD_1728);
+ /*
+ * We get the width in MM from the q file. Basically,
+ * faxing only deals with three page widths defined by
+ * pixel-widths: 1728, 2048, and 2432 (in R8 resolution).
+ * The associated page size names are A4, B4, and A3.
+ * However, the calculated size in millimeters differs
+ * between pixel-widths and page size.
+ * 1728 pixels = 215 mm : A4 = 209.903 mm
+ * 2048 pixels = 255 mm : B4 = 250.119 mm
+ * 2432 pixels = 303 mm : A3 = 297.039 mm
+ * The client program may therefore use a range of
+ * pagewidth (mm) values. We must interpret wisely.
+ */
+ wd = (w > 270 ? WD_2432 : w > 230 ? WD_2048 : WD_1728);
}
void
//w == 2432 ? WD_1216 : // collision
//w == 1728 ? WD_864 : // collision
w == 2592 ? WD_1728 :
+ w == 3072 ? WD_2048 :
+ w == 3648 ? WD_2432 :
+ w == 1824 ? WD_1216 :
+ w == 1296 ? WD_864 :
WD_1728);
}
ln = (l == (u_int) -1 ? LN_INF :
l <= 280 ? LN_LET :
l <= 300 ? LN_A4 :
- LN_B4);
+ l <= 380 ? LN_B4 :
+ LN_INF);
}
u_int
params.vr == VR_FINE ? 7.7 :
params.vr == VR_200X200 ? 7.87 :
params.vr == VR_R8 ? 15.4 :
- params.vr == VR_200X400 ? 12.81 :
- params.vr == VR_300X300 ? 9.14 : 15.4);
+ params.vr == VR_200X400 ? 15.75 :
+ params.vr == VR_300X300 ? 11.81 : 15.4);
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &v);
float w = v / (params.vr == VR_NORMAL ? 8.0 :
params.vr == VR_200X100 ? 8.00 :
paper=a4;;
*x364)
paper=b4;;
+2432x*|3648x*|4864x*)
+ paper=a3;;
*)
echo "$0: Unsupported page size: $pagewidth x $pagelength";
exit 254;; # causes document to be rejected
case "$paper" in
a4)
case "$pagewidth" in
- 2592) hres=313.65;; # VR_R300X300
+ 2592) hres=313.65;; # VR_300X300
3456) hres=418.20;; # VR_R16
*) hres=209.10;; # everything else, 1728 pixels
esac;;
- b4) # no 300x300 available with B4
+ b4)
case "$pagewidth" in
+ 3072) hres=311.97;; # VR_300X300
4096) hres=415.95;; # VR_R16
*) hres=207.98;; # everything else, 2048 pixels
esac;;
+ a3)
+ case "$pagewidth" in
+ 3648) hres=311.94;; # VR_300X300
+ 4864) hres=415.93;; # VR_R16
+ *) hres=207.96;; # everything else, 2432 pixels
+ esac;;
*) # letter, legal
case "$pagewidth" in
- 2592) hres=304.94;; # VR_R300X300
+ 2592) hres=304.94;; # VR_300X300
3456) hres=406.59;; # VR_R16
*) hres=203.29;; # everything else, 1728 pixels
esac;;
paper=a4;;
*x364)
paper=b4;;
+2432x*|3648x*|4864x*)
+ paper=a3;;
*)
echo "$0: Unsupported page size: $pagewidth x $pagelength";
exit 254;; # causes document to be rejected
case "$paper" in
a4)
case "$pagewidth" in
- 2592) hres=313.65;; # VR_R300X300
+ 2592) hres=313.65;; # VR_300X300
3456) hres=418.20;; # VR_R16
*) hres=209.10;; # everything else, 1728 pixels
esac;;
- b4) # no 300x300 available with B4
+ b4)
case "$pagewidth" in
+ 3072) hres=311.97;; # VR_300X300
4096) hres=415.95;; # VR_R16
*) hres=207.98;; # everything else, 2048 pixels
esac;;
+ a3)
+ case "$pagewidth" in
+ 3648) hres=311.94;; # VR_300X300
+ 4864) hres=415.93;; # VR_R16
+ *) hres=207.96;; # everything else, 2432 pixels
+ esac;;
*) # letter, legal
case "$pagewidth" in
- 2592) hres=304.94;; # VR_R300X300
+ 2592) hres=304.94;; # VR_300X300
3456) hres=406.59;; # VR_R16
*) hres=203.29;; # everything else, 1728 pixels
esac;;