Ignore:
Timestamp:
Jul 25, 2007, 5:59:35 PM (14 years ago)
Author:
Eugene Romanenko
Message:

DJVU plugin: djvulibre updated to version 3.5.19

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libdjvu/JB2Image.cpp

    r17 r206  
    66//C-
    77//C- This software is subject to, and may be distributed under, the
    8 //C- GNU General Public License, Version 2. The license should have
     8//C- GNU General Public License, either Version 2 of the license,
     9//C- or (at your option) any later version. The license should have
    910//C- accompanied the software or you may obtain a copy of the license
    1011//C- from the Free Software Foundation at http://www.fsf.org .
     
    1516//C- GNU General Public License for more details.
    1617//C-
    17 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
    18 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
    19 //C- Software authorized us to replace the original DjVu(r) Reference
    20 //C- Library notice by the following text (see doc/lizard2002.djvu):
     18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
     19//C- Lizardtech Software.  Lizardtech Software has authorized us to
     20//C- replace the original DjVu(r) Reference Library notice by the following
     21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
    2122//C-
    2223//C-  ------------------------------------------------------------------
     
    2728//C- |
    2829//C- | This software is subject to, and may be distributed under, the
    29 //C- | GNU General Public License, Version 2. The license should have
     30//C- | GNU General Public License, either Version 2 of the license,
     31//C- | or (at your option) any later version. The license should have
    3032//C- | accompanied the software or you may obtain a copy of the license
    3133//C- | from the Free Software Foundation at http://www.fsf.org .
     
    5254//C- +------------------------------------------------------------------
    5355//
    54 // $Id: JB2Image.cpp,v 1.10 2004/04/17 23:56:11 leonb Exp $
    55 // $Name: $
     56// $Id: JB2Image.cpp,v 1.13 2007/03/25 20:48:32 leonb Exp $
     57// $Name: release_3_5_19 $
    5658
    5759#ifdef HAVE_CONFIG_H
     
    471473  int cutoff;
    472474  // Check
    473   if (pctx && ((int)*pctx >= cur_ncell))
     475  if (!pctx || ((int)*pctx >= cur_ncell))
    474476    G_THROW( ERR_MSG("JB2Image.bad_numcontext") );
    475477  // Start all phases
     
    582584      shape2lib[i] = i;
    583585      lib2shape[i] = i;
    584       JB2Shape &jshp = jim.get_shape(i);
    585       libinfo[i].compute_bounding_box(*(jshp.bits));
     586      jim.get_bounding_box(i, libinfo[i]);
    586587    }
    587588}
     
    10611062  }
    10621063  JB2Dict &jim=*gjim;
    1063       // -------------------------
    1064       // THIS IS THE DECODING PART
    1065       // -------------------------
    1066       int rectype;
    1067       JB2Shape tmpshape;
    1068       do
    1069         {
    1070           code_record(rectype, gjim, &tmpshape);       
    1071         }
    1072       while(rectype != END_OF_DATA);
    1073       if (!gotstartrecordp)
    1074         G_THROW( ERR_MSG("JB2Image.no_start") );
    1075       jim.compress();
     1064  // -------------------------
     1065  // THIS IS THE DECODING PART
     1066  // -------------------------
     1067  int rectype;
     1068  JB2Shape tmpshape;
     1069  do {
     1070    code_record(rectype, gjim, &tmpshape);       
     1071  } while(rectype != END_OF_DATA);
     1072  if (!gotstartrecordp)
     1073    G_THROW( ERR_MSG("JB2Image.no_start") );
     1074  // cache bounding boxes
     1075  int nshapes = jim.get_shape_count();
     1076  int ishapes = jim.get_inherited_shape_count();
     1077  jim.boxes.resize(0, nshapes-ishapes-1);
     1078  for (int i = ishapes; i < nshapes; i++)
     1079    jim.boxes[i-ishapes] = libinfo[i];
     1080  // compress
     1081  jim.compress();
    10761082}
    10771083
     
    13631369
    13641370void
    1365 JB2Dict::JB2Codec::LibRect::compute_bounding_box(const GBitmap &bm)
    1366 {
    1367   // First lock the stuff.
     1371JB2Dict::LibRect::compute_bounding_box(const GBitmap &bm)
     1372{
     1373  // Avoid trouble
    13681374  GMonitorLock lock(bm.monitor());
    13691375  // Get size
     
    14131419}
    14141420
     1421
     1422void
     1423JB2Dict::get_bounding_box(int shapeno, LibRect &dest)
     1424{
     1425  if (shapeno < inherited_shapes && inherited_dict)
     1426    {
     1427      inherited_dict->get_bounding_box(shapeno, dest);
     1428    }
     1429  else if (shapeno >= inherited_shapes &&
     1430           shapeno < inherited_shapes + boxes.size())
     1431    {
     1432      dest = boxes[shapeno - inherited_shapes];
     1433    }
     1434  else
     1435    {
     1436      JB2Shape &jshp = get_shape(shapeno);
     1437      dest.compute_bounding_box(*(jshp.bits));
     1438    }
     1439}
     1440
     1441
    14151442GP<JB2Dict>
    14161443JB2Dict::create(void)
Note: See TracChangeset for help on using the changeset viewer.