From: Robert L K. <rl...@al...> - 2000-02-26 01:42:26
|
Staring at the code, I think I found an error in the code that would produce rather strange looking output (dark areas would be too light, and light areas too dark in some cases -- it would also show up as color shifts). Could somebody please replace escp2_fold in print-escp2.c with the version below and tell me which one works better (printing in variable dot size mode)? Thanks. A good test image is http://www.tiac.net/users/rlk/colors.tif. static void escp2_fold(const unsigned char *line, int single_length, unsigned char *outbuf) { int i; for (i = 0; i < single_length; i++) { outbuf[0] = ((line[0] & (1 << 7)) >> 0) + ((line[0] & (1 << 6)) >> 1) + ((line[0] & (1 << 5)) >> 2) + ((line[0] & (1 << 4)) >> 3) + ((line[single_length] & (1 << 7)) >> 1) + ((line[single_length] & (1 << 6)) >> 2) + ((line[single_length] & (1 << 5)) >> 3) + ((line[single_length] & (1 << 4)) >> 4); outbuf[1] = ((line[0] & (1 << 3)) << 4) + ((line[0] & (1 << 2)) << 3) + ((line[0] & (1 << 1)) << 2) + ((line[0] & (1 << 0)) << 1) + ((line[single_length] & (1 << 3)) << 3) + ((line[single_length] & (1 << 2)) << 2) + ((line[single_length] & (1 << 1)) << 1) + ((line[single_length] & (1 << 0)) << 0); line++; outbuf += 2; } } -- Robert Krawitz <rl...@al...> http://www.tiac.net/users/rlk/ Tall Clubs International -- http://www.tall.org/ or 1-888-IM-TALL-2 Member of the League for Programming Freedom -- mail lp...@uu... Project lead for The Gimp Print -- http://gimp-print.sourceforge.net "Linux doesn't dictate how I work, I dictate how Linux works." --Eric Crampton |