public PlanarYUVLuminanceSource buildLuminanceSource ( byte [ ] data , int width , int height ) { Rect rect = getFramingRectInPreview ( ) ; if ( rect == null ) { return null ; } // Go ahead and assume it's YUV rather than die. return new PlanarYUVLuminanceSource ( data , width , height , rect . left , rect . top , rect . width ( ) , rect . height ( ) , false ) ; }
A factory method to build the appropriate LuminanceSource object based on the format of the preview buffers as described by Camera . Parameters .