def getmode(mode):
 global _modes
 if (not _modes):
  from . import Image
  modes = {}
  for (m, (basemode, basetype, bands)) in Image._MODEINFO.items():
   modes[m] = ModeDescriptor(m, bands, basemode, basetype)
  modes['RGBa'] = ModeDescriptor('RGBa', ('R', 'G', 'B', 'a'), 'RGB', 'L')
  modes['LA'] = ModeDescriptor('LA', ('L', 'A'), 'L', 'L')
  modes['La'] = ModeDescriptor('La', ('L', 'a'), 'L', 'L')
  modes['PA'] = ModeDescriptor('PA', ('P', 'A'), 'RGB', 'L')
  modes['I;16'] = ModeDescriptor('I;16', 'I', 'L', 'L')
  modes['I;16L'] = ModeDescriptor('I;16L', 'I', 'L', 'L')
  modes['I;16B'] = ModeDescriptor('I;16B', 'I', 'L', 'L')
  _modes = modes
 return _modes[mode]

def getmode ( mode ) : global _modes if ( not _modes ) : from . import Image modes = { } for ( m , ( basemode , basetype , bands ) ) in Image . _MODEINFO . items ( ) : modes [ m ] = ModeDescriptor ( m , bands , basemode , basetype ) modes [ 'RGBa' ] = ModeDescriptor ( 'RGBa' , ( 'R' , 'G' , 'B' , 'a' ) , 'RGB' , 'L' ) modes [ 'LA' ] = ModeDescriptor ( 'LA' , ( 'L' , 'A' ) , 'L' , 'L' ) modes [ 'La' ] = ModeDescriptor ( 'La' , ( 'L' , 'a' ) , 'L' , 'L' ) modes [ 'PA' ] = ModeDescriptor ( 'PA' , ( 'P' , 'A' ) , 'RGB' , 'L' ) modes [ 'I;16' ] = ModeDescriptor ( 'I;16' , 'I' , 'L' , 'L' ) modes [ 'I;16L' ] = ModeDescriptor ( 'I;16L' , 'I' , 'L' , 'L' ) modes [ 'I;16B' ] = ModeDescriptor ( 'I;16B' , 'I' , 'L' , 'L' ) _modes = modes return _modes [ mode ]
gets a mode descriptor for the given mode .