protected void setImage ( int xsize , int ysize , ByteBuffer buf , Rectangle rect , int bpp ) { int bytespp = bpp / 8 ; int bytespl = ( int ) Math . ceil ( xsize * bpp / 8.0 ) ; api . TessBaseAPISetImage ( handle , buf , xsize , ysize , bytespp , bytespl ) ; if ( rect != null && ! rect . isEmpty ( ) ) { api . TessBaseAPISetRectangle ( handle , rect . x , rect . y , rect . width , rect . height ) ; } }
Sets image to be processed .