public static < T extends ImageGray < T > > void planarToBitmap ( Planar < T > input , Bitmap output , byte [ ] storage ) { if ( output . getWidth ( ) != input . getWidth ( ) || output . getHeight ( ) != input . getHeight ( ) ) { throw new IllegalArgumentException ( "Image shapes are not the same" ) ; } if ( storage == null ) storage = declareStorage ( output , null ) ; if ( input . getBandType ( ) == GrayU8 . class ) ImplConvertBitmap . planarToArray_U8 ( ( Planar ) input , storage , output . getConfig ( ) ) ; else if ( input . getBandType ( ) == GrayF32 . class ) ImplConvertBitmap . planarToArray_F32 ( ( Planar ) input , storage , output . getConfig ( ) ) ; else throw new IllegalArgumentException ( "Unsupported BoofCV Type" ) ; output . copyPixelsFromBuffer ( ByteBuffer . wrap ( storage ) ) ; }
Converts Planar image into Bitmap .