Ignore:
Timestamp:
May 3, 2006, 10:14:37 AM (15 years ago)
Author:
Eugene Romanenko
Message:

update makefiles, remove absolute paths, update djvulibre to version 3.5.17

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libdjvu/DjVuInfo.cpp

    r15 r17  
    5252//C- +------------------------------------------------------------------
    5353//
    54 // $Id: DjVuInfo.cpp,v 1.9 2003/11/07 22:08:21 leonb Exp $
    55 // $Name: release_3_5_16 $
     54// $Id: DjVuInfo.cpp,v 1.10 2005/12/24 12:45:01 leonb Exp $
     55// $Name: $
    5656
    5757#ifdef HAVE_CONFIG_H
     
    9090    version(DJVUVERSION),
    9191#endif
    92     dpi(300), gamma(2.2), compressable(false), orientation(GRect::BULRNR)
     92    dpi(300), gamma(2.2), orientation(0)
    9393{
    9494}
     
    103103  dpi = 300;
    104104  gamma = 2.2;
    105   compressable=false;
    106   orientation=GRect::BULRNR;
     105  orientation=0;
    107106  // Read data
    108107  unsigned char buffer[10];
     
    135134  if (dpi < 25 || dpi > 6000)
    136135    dpi = 300;
    137   if(flags&COMPRESSABLE_FLAG)
    138     compressable=true;
    139   if(version>=DJVUVERSION_ORIENTATION)
     136  switch (flags & 0x7)
    140137  {
    141     orientation=(GRect::Orientations)(flags&((int)GRect::BOTTOM_UP|(int)GRect::MIRROR|(int)GRect::ROTATE90_CW));
     138    case 6:  orientation=1; break;
     139    case 2:  orientation=2; break;
     140    case 5:  orientation=3; break;
     141    default: orientation=0; break;
    142142  }
    143143}
     
    153153  bs.write8(dpi >> 8);
    154154  bs.write8((int)(10.0*gamma+0.5) );
    155   unsigned char flags=orientation;
    156   if(compressable)
     155  unsigned char flags;
     156  switch (orientation)
    157157  {
    158     flags|=COMPRESSABLE_FLAG;
     158    default: flags=0; break;
     159    case 1:  flags=6; break;
     160    case 2:  flags=2; break;
     161    case 3:  flags=5; break;
    159162  }
    160163  bs.write8(flags);
     
    170173DjVuInfo::get_paramtags(void) const
    171174{
    172   const int angle=GRect::findangle(orientation);
    173175  GUTF8String retval;
    174   if(angle)
    175   {
    176     retval+="<PARAM name=\"ROTATE\" value=\""+GUTF8String(angle)+"\" />\n";
    177   }
    178   if(orientation == GRect::rotate(angle,GRect::TDLRNR))
    179   {
    180     retval+="<PARAM name=\"VFLIP\" value=\"true\" />\n";
    181   }
     176  if(orientation)
     177    retval+="<PARAM name=\"ROTATE\" value=\""
     178      +GUTF8String(((4-orientation)%4)*90)+"\" />\n";
    182179  if(dpi)
    183   {
    184     retval+="<PARAM name=\"DPI\" value=\""+GUTF8String(dpi)+"\" />\n";
    185   }
     180    retval+="<PARAM name=\"DPI\" value=\""
     181      +GUTF8String(dpi)+"\" />\n";
    186182  if(gamma)
    187   {
    188     retval+="<PARAM name=\"GAMMA\" value=\""+GUTF8String(gamma)+"\" />\n";
    189   }
     183    retval+="<PARAM name=\"GAMMA\" value=\""
     184      +GUTF8String(gamma)+"\" />\n";
    190185  return retval;
    191186}
Note: See TracChangeset for help on using the changeset viewer.