home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_2154 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  1.1 KB  |  31 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. _modes = { }
  5.  
  6. class ModeDescriptor:
  7.     
  8.     def __init__(self, mode, bands, basemode, basetype):
  9.         self.mode = mode
  10.         self.bands = bands
  11.         self.basemode = basemode
  12.         self.basetype = basetype
  13.  
  14.     
  15.     def __str__(self):
  16.         return self.mode
  17.  
  18.  
  19.  
  20. def getmode(mode):
  21.     if not _modes:
  22.         import Image
  23.         for basemode, basetype, bands in Image._MODEINFO.items():
  24.             _modes[m] = ModeDescriptor(m, bands, basemode, basetype)
  25.         
  26.         _modes['LA'] = ModeDescriptor('LA', ('L', 'A'), 'L', 'L')
  27.         _modes['PA'] = ModeDescriptor('PA', ('P', 'A'), 'RGB', 'L')
  28.     
  29.     return _modes[mode]
  30.  
  31.