#NEWLINE# def get_rgbarray( self , idx , out = None , order = 'RGB' , image_order = 'RGB' ) : #NEWLINE# #INDENT# shape = idx . shape #NEWLINE# depth = len ( order ) #NEWLINE# res_shape = ( shape [ 0 ] , shape [ 1 ] , depth ) #NEWLINE# if ( out is None ) : #NEWLINE# #INDENT# out = numpy . empty ( res_shape , dtype = numpy . uint8 , order = 'C' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert ( res_shape == out . shape ) , RGBMapError ( ( "Output array shape %s doesn't match result shape %s" % ( str ( out . shape ) , str ( res_shape ) ) ) ) #NEWLINE# #UNINDENT# res = RGBPlanes ( out , order ) #NEWLINE# if res . hasAlpha : #NEWLINE# #INDENT# aa = res . get_slice ( 'A' ) #NEWLINE# aa . fill ( 255 ) #NEWLINE# #UNINDENT# ( ri , gi , bi ) = self . get_order_indexes ( res . get_order ( ) , 'RGB' ) #NEWLINE# ( rj , gj , bj ) = self . get_order_indexes ( image_order , 'RGB' ) #NEWLINE# out [ ( ... , ri ) ] = idx [ ( ... , rj ) ] #NEWLINE# out [ ( ... , gi ) ] = idx [ ( ... , gj ) ] #NEWLINE# out [ ( ... , bi ) ] = idx [ ( ... , bj ) ] #NEWLINE# return res