public static <T extends ImageBase<T>>
	void bitmapToBoof( Bitmap input , T output , byte[] storage) {

		if( BOverrideConvertAndroid.invokeBitmapToBoof(input,output,storage))
			return;

		switch( output.getImageType().getFamily() ) {
			case GRAY: {
				if( output.getClass() == GrayF32.class )
					bitmapToGray(input, (GrayF32) output, storage);
				else if( output.getClass() == GrayU8.class )
					bitmapToGray(input,(GrayU8)output,storage);
				else
					throw new IllegalArgumentException("Unsupported BoofCV Image Type");
			} break;

			case PLANAR:
				Planar pl = (Planar)output;
				bitmapToPlanar(input,pl,pl.getBandType(),storage);
			break;

			default:
				throw new IllegalArgumentException("Unsupported BoofCV Image Type");
		}
	}
public static < T extends ImageBase < T > > void bitmapToBoof ( Bitmap input , T output , byte [ ] storage ) { if ( BOverrideConvertAndroid . invokeBitmapToBoof ( input , output , storage ) ) return ; switch ( output . getImageType ( ) . getFamily ( ) ) { case GRAY : { if ( output . getClass ( ) == GrayF32 . class ) bitmapToGray ( input , ( GrayF32 ) output , storage ) ; else if ( output . getClass ( ) == GrayU8 . class ) bitmapToGray ( input , ( GrayU8 ) output , storage ) ; else throw new IllegalArgumentException ( "Unsupported BoofCV Image Type" ) ; } break ; case PLANAR : Planar pl = ( Planar ) output ; bitmapToPlanar ( input , pl , pl . getBandType ( ) , storage ) ; break ; default : throw new IllegalArgumentException ( "Unsupported BoofCV Image Type" ) ; } }
Converts a {@link Bitmap} into a BoofCV image.  Type is determined at runtime.
@param input Bitmap image.
@param output Output image.  Automatically resized to match input shape.
@param storage Byte array used for internal storage. If null it will be declared internally.