~ubuntu-branches/ubuntu/quantal/gutenprint/quantal

« back to all changes in this revision

Viewing changes to src/main/bit-ops.c

  • Committer: Package Import Robot
  • Author(s): Till Kamppeter
  • Date: 2012-06-19 17:12:48 UTC
  • mfrom: (1.1.15)
  • Revision ID: package-import@ubuntu.com-20120619171248-cbil10m2dqnc71rr
Tags: 5.2.8-0ubuntu1
* New upstream release
   - Added support for Canon PIXMA DS700, DS810, 50i, 80i, 450i, 455i, 470PD,
     475PD, 550i, 560i, 850i, 860i, 865R, 900PD, 950i, 960i, 990i, 6100i,
     6500i, 9100i, 9900i, i450X, i455X, i475D, i550X, i560X, i905D, i965,
     i990, i9950, iP90, iP90v, iP100, iP6320D, MP260, MX320, MX370, MX430,
     MX510, MX710, MX890, E500, E600, PIXUS iP2700, iP3100, iP4100,
     EPSON Stylus NX420, SX420, TX420
   - CD printing on many Canon printers.
   - Non-working Canon's removed.
   - More Japanese models supported.
   - Printer modes for most printer models are now determined by the
     media, based on information from the corresponding Windows
     driver. If an incompatible mode is selected by the user, a
     suitable mode is substituted, based on the other active
     parameters and quality setting. Modes are also substituted
     based on cartridge selection and duplex selection. Inktype is
     then automatically adjusted.
   - Added support for 8-bit inks to Canon backend, and modes using
     them.
   - Adjusted margins and page sizes of Canon printers.
   - Added borderless functionality to most Canon printers.
   - A problem whereby printing did not work at all on some Linux
     distributions has been fixed.
   - Printing on the Epson Stylus NX200, SX200, and SX205 is believed
     to be corrected.
* debian/patches/0002-genppd-don-t-write-color-profile-information-with-br.patch,
  debian/patches/0003-upgrade-getopt.patch,
  debian/patches/0004-no-data-dumper-needed.patch,
  debian/patches/0005-use-dnointerpolate-in-ghostscript-command-lines.patch:
  Removed, change applied upstream.
* debian/rules: Touch ppd-updater file(s) so that they have the time stamp
  of the build of this package The time stamp of the ppd-updater files tells
  CUPS' trigger script whether they come from different package versions or
  not (LP: #932882).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * "$Id: bit-ops.c,v 1.14 2009/06/07 15:21:22 rlk Exp $"
 
2
 * "$Id: bit-ops.c,v 1.15 2012/04/19 14:41:03 gernot2270 Exp $"
3
3
 *
4
4
 *   Softweave calculator for Gutenprint.
5
5
 *
279
279
    }
280
280
}
281
281
 
 
282
void
 
283
stp_fold_8bit(const unsigned char *line,
 
284
                int single_length,
 
285
                unsigned char *outbuf)
 
286
{
 
287
  int i;
 
288
  memset(outbuf, 0, single_length * 8);
 
289
  for (i = 0; i < single_length; i++)
 
290
    {
 
291
      unsigned char l0 = line[0];
 
292
      unsigned char l1 = line[single_length];
 
293
      unsigned char l2 = line[single_length*2];
 
294
      unsigned char l3 = line[single_length*3];
 
295
      unsigned char l4 = line[single_length*4];
 
296
      unsigned char l5 = line[single_length*5];
 
297
      unsigned char l6 = line[single_length*6];
 
298
      unsigned char l7 = line[single_length*7];
 
299
      if (l0 || l1 || l2 || l3 || l4 || l5 || l6 || l7)
 
300
        {
 
301
          outbuf[0] =           /* H7 G7 F7 E7 D7 C7 B7 A7 */
 
302
            ((l7 & (1 << 7)) >> 0)|
 
303
            ((l6 & (1 << 7)) >> 1)|
 
304
            ((l5 & (1 << 7)) >> 2)|
 
305
            ((l4 & (1 << 7)) >> 3)|
 
306
            ((l3 & (1 << 7)) >> 4)|
 
307
            ((l2 & (1 << 7)) >> 5)|
 
308
            ((l1 & (1 << 7)) >> 6)|
 
309
            ((l0 & (1 << 7)) >> 7);
 
310
 
 
311
          outbuf[1] =           /* H6 G6 F6 E6 D6 C6 B6 A6 */
 
312
            ((l7 & (1 << 6)) << 1)|
 
313
            ((l6 & (1 << 6)) >> 0)|
 
314
            ((l5 & (1 << 6)) >> 1)|
 
315
            ((l4 & (1 << 6)) >> 2)|
 
316
            ((l3 & (1 << 6)) >> 3)|
 
317
            ((l2 & (1 << 6)) >> 4)|
 
318
            ((l1 & (1 << 6)) >> 5)|
 
319
            ((l0 & (1 << 6)) >> 6);
 
320
 
 
321
          outbuf[2] =           /* H5 G5 F5 E5 D5 C5 B5 A5 */
 
322
            ((l7 & (1 << 5)) << 2)|
 
323
            ((l6 & (1 << 5)) << 1)|
 
324
            ((l5 & (1 << 5)) >> 0)|
 
325
            ((l4 & (1 << 5)) >> 1)|
 
326
            ((l3 & (1 << 5)) >> 2)|
 
327
            ((l2 & (1 << 5)) >> 3)|
 
328
            ((l1 & (1 << 5)) >> 4)|
 
329
            ((l0 & (1 << 5)) >> 5);
 
330
 
 
331
          outbuf[3] =           /* H4 G4 F4 E4 D4 C4 B4 A4 */
 
332
            ((l7 & (1 << 4)) << 3)|
 
333
            ((l6 & (1 << 4)) << 2)|
 
334
            ((l5 & (1 << 4)) << 1)|
 
335
            ((l4 & (1 << 4)) >> 0)|
 
336
            ((l3 & (1 << 4)) >> 1)|
 
337
            ((l2 & (1 << 4)) >> 2)|
 
338
            ((l1 & (1 << 4)) >> 3)|
 
339
            ((l0 & (1 << 4)) >> 4);
 
340
          outbuf[4] =           /* H3 G3 F3 E3 D3 C3 B3 A3 */
 
341
            ((l7 & (1 << 3)) << 4)|
 
342
            ((l6 & (1 << 3)) << 3)|
 
343
            ((l5 & (1 << 3)) << 2)|
 
344
            ((l4 & (1 << 3)) << 1)|
 
345
            ((l3 & (1 << 3)) >> 0)|
 
346
            ((l2 & (1 << 3)) >> 1)|
 
347
            ((l1 & (1 << 3)) >> 2)|
 
348
            ((l0 & (1 << 3)) >> 3);
 
349
 
 
350
          outbuf[5] =           /* H2 G2 F2 E2 D2 C2 B2 A2 */
 
351
            ((l7 & (1 << 2)) << 5)|
 
352
            ((l6 & (1 << 2)) << 4)|
 
353
            ((l5 & (1 << 2)) << 3)|
 
354
            ((l4 & (1 << 2)) << 2)|
 
355
            ((l3 & (1 << 2)) << 1)|
 
356
            ((l2 & (1 << 2)) >> 0)|
 
357
            ((l1 & (1 << 2)) >> 1)|
 
358
            ((l0 & (1 << 2)) >> 2);
 
359
 
 
360
          outbuf[6] =           /* H1 G1 F1 E1 D1 C1 B1 A1 */
 
361
            ((l7 & (1 << 1)) << 6)|
 
362
            ((l6 & (1 << 1)) << 5)|
 
363
            ((l5 & (1 << 1)) << 4)|
 
364
            ((l4 & (1 << 1)) << 3)|
 
365
            ((l3 & (1 << 1)) << 2)|
 
366
            ((l2 & (1 << 1)) << 1)|
 
367
            ((l1 & (1 << 1)) >> 0)|
 
368
            ((l0 & (1 << 1)) >> 1);
 
369
 
 
370
          outbuf[7] =           /* H0 G0 F0 E0 D0 C0 B0 A0 */
 
371
            ((l7 & (1 << 0)) << 7)|
 
372
            ((l6 & (1 << 0)) << 6)|
 
373
            ((l5 & (1 << 0)) << 5)|
 
374
            ((l4 & (1 << 0)) << 4)|
 
375
            ((l3 & (1 << 0)) << 3)|
 
376
            ((l2 & (1 << 0)) << 2)|
 
377
            ((l1 & (1 << 0)) << 1)|
 
378
            ((l0 & (1 << 0)) >> 0);
 
379
        }
 
380
      line++;
 
381
      outbuf += 8;
 
382
    }
 
383
}
 
384
 
282
385
#define SPLIT_MASK(k, b) (((1 << (b)) - 1) << ((k) * (b)))
283
386
 
284
387
#define SPLIT_STEP(k, b, i, o, in, r, inc, rl)  \