public static void render ( List < Contour > contours , int colors [ ] , BufferedImage out ) { colors = checkColors ( colors , contours . size ( ) ) ; for ( int i = 0 ; i < contours . size ( ) ; i ++ ) { Contour c = contours . get ( i ) ; int color = colors [ i ] ; for ( Point2D_I32 p : c . external ) { out . setRGB ( p . x , p . y , color ) ; } } }
Renders only the external contours . Each contour is individually colored as specified by colors