~ubuntu-branches/ubuntu/precise/gutenprint/precise

« back to all changes in this revision

Viewing changes to src/main/print-weave.c

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2009-08-14 10:06:24 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090814100624-agjl4bv8obqsjmkn
Tags: 5.2.4-0ubuntu1
* New upstream release
   - Added support for Canon PIXMA iX4000, Canon SELPHY CP-520, EPSON 
     Stylus Photo R2880, EPSON Stylus DX4000
   - Corrections for Epson PM-D600, Epson Stylus Photo R2400, EPSON Artisan
     700/800, Stylus Photo P/TX700/800 series
   - Name corrections for all Ricoh anmd OEM printers and for the
     EPSON Stylus Photo PX700W,EPSON Stylus Photo TX700W, EPSON Stylus Photo
     PX800FW, EPSON Stylus Photo TX800FW
   - The EPSON inkjet utility, escputil, now correctly prints the color name
     for low ink warnings.
   - Printing resolution names have been fixed in non-English locales
     in CUPS PPD files.
   - A Russian translation has been added.  The Danish and Italian
     translations have been updated.
   - Support has been added for L-size paper with tear-off borders.
   - The ordering of inks in quadtone ink sets on Epson printers has
     been corrected.  In addition, support has been added for MIS
     quadtone and 6 tone inks.
   - It is now possible to adjust the ink parameters for quadtone
     inks in CUPS.  Previously, these parameters could only be
     adjusted in the enhanced Print plugin for GIMP and other native
     Gutenprint applications.
   - Updating CUPS PPD files is now faster.
* debian/patches/20_fix_gimpprint_menu_entry.dpatch: Removed, was already
  deactivated for longer time.
* debian/patches/25_sync-ricoh-printer-names-with-openprinting.dpatch:
  Removed, applied upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * "$Id: print-weave.c,v 1.72 2008/10/29 00:10:42 easysw Exp $"
 
2
 * "$Id: print-weave.c,v 1.75 2009/05/24 01:53:53 rlk Exp $"
3
3
 *
4
4
 *   Softweave calculator for Gutenprint.
5
5
 *
1149
1149
  sw->horizontal_width =
1150
1150
    (sw->compute_linewidth)(v, ((sw->linewidth + sw->horizontal_weave - 1) /
1151
1151
                                 sw->horizontal_weave));
 
1152
  stp_dprintf(STP_DBG_WEAVE_PARAMS, v,
 
1153
              "Computing linewidth for linewidth %d weave %d => %d (%d)\n",
 
1154
              sw->linewidth, sw->horizontal_weave, sw->horizontal_width,
 
1155
              ((sw->horizontal_width + 7) / 8));
1152
1156
  sw->horizontal_width = ((sw->horizontal_width + 7) / 8);
1153
1157
 
1154
1158
  for (i = 0; i < sw->vmod; i++)
1173
1177
              sw->oversample, sw->vmod,
1174
1178
              sw->vmod * sw->virtual_jets * sw->bitwidth *
1175
1179
              sw->ncolors * sw->horizontal_width, page_height);
 
1180
  stp_dprintf(STP_DBG_WEAVE_PARAMS, v,
 
1181
              "      ***Buffer limit %d (vj %d bw %d hw %d)\n",
 
1182
              sw->virtual_jets * sw->bitwidth * sw->horizontal_width,
 
1183
              sw->virtual_jets, sw->bitwidth, sw->horizontal_width);
1176
1184
  stp_allocate_component_data(v, "Weave", NULL, stpi_destroy_weave, sw);
1177
1185
  return;
1178
1186
}
1499
1507
  size_t count = linecount->v[color];
1500
1508
  if (place + nbytes > sw->virtual_jets * sw->bitwidth * sw->horizontal_width)
1501
1509
    {
1502
 
      stp_eprintf(v, "Buffer overflow: limit %d, actual %ld, count %ld\n",
 
1510
      int i;
 
1511
      stp_eprintf(v, "ERROR: %s\n", _("Fatal error!"));
 
1512
      stp_eprintf(v, "ERROR: Static weave data follows:\n");
 
1513
      stp_eprintf(v, "ERROR:    jets: %d\n", sw->jets);
 
1514
      stp_eprintf(v, "ERROR:    virtual_jets: %d\n", sw->virtual_jets);
 
1515
      stp_eprintf(v, "ERROR:    separation: %d\n", sw->separation);
 
1516
      stp_eprintf(v, "ERROR:    horizontal_weave: %d\n", sw->horizontal_weave);
 
1517
      stp_eprintf(v, "ERROR:    vertical_subpasses: %d\n", sw->vertical_subpasses);
 
1518
      stp_eprintf(v, "ERROR:    vmod: %d\n", sw->vmod);
 
1519
      stp_eprintf(v, "ERROR:    oversample: %d\n", sw->oversample);
 
1520
      stp_eprintf(v, "ERROR:    repeat_count: %d\n", sw->repeat_count);
 
1521
      stp_eprintf(v, "ERROR:    ncolors: %d\n", sw->ncolors);
 
1522
      stp_eprintf(v, "ERROR:    linewidth: %d\n", sw->linewidth);
 
1523
      stp_eprintf(v, "ERROR:    vertical_height: %d\n", sw->vertical_height);
 
1524
      stp_eprintf(v, "ERROR:    firstline: %d\n", sw->firstline);
 
1525
      stp_eprintf(v, "ERROR:    bitwidth: %d\n", sw->bitwidth);
 
1526
      stp_eprintf(v, "ERROR:    vertical_oversample: %d\n", sw->vertical_oversample);
 
1527
      stp_eprintf(v, "ERROR:    horizontal_width: %d\n", sw->horizontal_width);
 
1528
      if (sw->head_offset)
 
1529
        {
 
1530
          stp_eprintf(v, "ERROR:    head_offset:\n");
 
1531
          for (i = 0; i < sw->ncolors; i++)
 
1532
            stp_eprintf(v, "ERROR:      head %d: %d\n", i, sw->head_offset[i]);
 
1533
        }
 
1534
      stp_eprintf(v, "ERROR: Dynamic weave data follows:\n");
 
1535
      stp_eprintf(v, "ERROR:    last_pass_offset: %d\n", sw->last_pass_offset);
 
1536
      stp_eprintf(v, "ERROR:    last_pass: %d\n", sw->last_pass);
 
1537
      stp_eprintf(v, "ERROR:    lineno: %d\n", sw->lineno);
 
1538
      stp_eprintf(v, "ERROR:    current_vertical_subpass: %d\n", sw->current_vertical_subpass);
 
1539
      stp_eprintf(v, "ERROR:    rcache: %d\n", sw->rcache);
 
1540
      stp_eprintf(v, "ERROR:    vcache: %d\n", sw->vcache);
 
1541
      stp_eprintf(v, "ERROR: Other parameters: row %d color %d setactive %d hpass %d\n",
 
1542
                  row, color, setactive, h_pass);
 
1543
      stp_eprintf(v, "ERROR: Buffer overflow: limit %d (jets %d bits %d horizontal %d), actual %ld (current %d added %d), count %ld\n",
1503
1544
                  sw->virtual_jets * sw->bitwidth * sw->horizontal_width,
1504
 
                  (long)(place + nbytes), (long)count);
 
1545
                  sw->virtual_jets, sw->bitwidth, sw->horizontal_width,
 
1546
                  (long) (place + nbytes), (int) place, (int) nbytes, (long) count);
 
1547
      stp_eprintf(v, "ERROR: %s\n", _("Please report the above information to gimp-print-devel@lists.sourceforge.net"));
1505
1548
      stp_abort();
1506
1549
    }
1507
1550
  memcpy(bufs->v[color] + lineoffs->v[color], buf, nbytes);
1582
1625
  int cpass = sw->current_vertical_subpass * h_passes;
1583
1626
 
1584
1627
  if (!sw->fold_buf)
1585
 
    sw->fold_buf = stp_zalloc(sw->bitwidth * ylength);
 
1628
    {
 
1629
      stp_dprintf(STP_DBG_WEAVE_PARAMS, v,
 
1630
                  "fold buffer allocation: length %d lw %d weave %d xlength %d ylength %d\n",
 
1631
                  length, sw->linewidth, sw->horizontal_weave, xlength, ylength);
 
1632
      stp_dprintf(STP_DBG_WEAVE_PARAMS, v,
 
1633
                  "Allocating fold buf %d * %d (%d)\n", ylength, sw->bitwidth,
 
1634
                  sw->bitwidth * ylength);
 
1635
      sw->fold_buf = stp_zalloc(sw->bitwidth * ylength);
 
1636
    }
1586
1637
  if (!sw->comp_buf)
1587
 
    sw->comp_buf = stp_zalloc(sw->bitwidth *
1588
 
                              (sw->compute_linewidth)(v,ylength));
 
1638
    {
 
1639
      stp_dprintf(STP_DBG_WEAVE_PARAMS, v,
 
1640
                  "Allocating compression buffer based on %d, %d\n",
 
1641
                  sw->bitwidth, ylength);
 
1642
      sw->comp_buf = stp_zalloc(sw->bitwidth *
 
1643
                                (sw->compute_linewidth)(v,ylength));
 
1644
    }
1589
1645
  if (sw->current_vertical_subpass == 0)
1590
1646
    initialize_row(v, sw, sw->lineno, xlength, cols);
1591
1647
 
1622
1678
            }
1623
1679
          else
1624
1680
            in = cols[j];
1625
 
          switch (sw->horizontal_weave)
1626
 
            {
1627
 
            case 1:
1628
 
              memcpy(sw->s[0], in, length * sw->bitwidth);
1629
 
              break;
1630
 
            case 2:
1631
 
              stp_unpack_2(length, sw->bitwidth, in, sw->s[0], sw->s[1]);
1632
 
              break;
1633
 
            case 4:
1634
 
              stp_unpack_4(length, sw->bitwidth, in,
1635
 
                           sw->s[0], sw->s[1], sw->s[2], sw->s[3]);
1636
 
              break;
1637
 
            case 8:
1638
 
              stp_unpack_8(length, sw->bitwidth, in,
1639
 
                           sw->s[0], sw->s[1], sw->s[2], sw->s[3],
1640
 
                           sw->s[4], sw->s[5], sw->s[6], sw->s[7]);
1641
 
              break;
1642
 
            case 16:
1643
 
              stp_unpack_16(length, sw->bitwidth, in,
1644
 
                            sw->s[0], sw->s[1], sw->s[2], sw->s[3],
1645
 
                            sw->s[4], sw->s[5], sw->s[6], sw->s[7],
1646
 
                            sw->s[8], sw->s[9], sw->s[10], sw->s[11],
1647
 
                            sw->s[12], sw->s[13], sw->s[14], sw->s[15]);
1648
 
              break;
1649
 
            }
1650
 
          switch (sw->vertical_subpasses)
1651
 
            {
1652
 
            case 4:
1653
 
              for (idx = 0; idx < sw->horizontal_weave; idx++)
1654
 
                stp_split_4(length, sw->bitwidth, sw->s[idx], sw->s[idx],
1655
 
                            sw->s[idx + sw->horizontal_weave],
1656
 
                            sw->s[idx + sw->horizontal_weave * 2],
1657
 
                            sw->s[idx + sw->horizontal_weave * 3]);
1658
 
              break;
1659
 
            case 2:
1660
 
              for (idx = 0; idx < sw->horizontal_weave; idx++)
1661
 
                stp_split_2(length, sw->bitwidth, sw->s[idx], sw->s[idx],
1662
 
                            sw->s[idx + sw->horizontal_weave]);
1663
 
              break;
1664
 
              /* case 1 is taken care of because the various unpack */
1665
 
              /* functions will do the trick themselves */
 
1681
          if (sw->horizontal_weave == 1)
 
1682
            memcpy(sw->s[0], in, length * sw->bitwidth);
 
1683
          else
 
1684
            stp_unpack(length, sw->bitwidth, sw->horizontal_weave, in, sw->s);
 
1685
          if (sw->vertical_subpasses > 1)
 
1686
            {
 
1687
              for (idx = 0; idx < sw->horizontal_weave; idx++)
 
1688
                stp_split(length, sw->bitwidth, sw->vertical_subpasses,
 
1689
                          sw->s[idx], sw->horizontal_weave, &(sw->s[idx]));
1666
1690
            }
1667
1691
          for (i = 0; i < h_passes; i++)
1668
1692
            {