public static void bufferDepthToU16 ( ByteBuffer input , GrayU16 output ) { int indexIn = 0 ; for ( int y = 0 ; y < output . height ; y ++ ) { int indexOut = output . startIndex + y * output . stride ; for ( int x = 0 ; x < output . width ; x ++ , indexOut ++ ) { output . data [ indexOut ] = ( short ) ( ( input . get ( indexIn ++ ) & 0xFF ) | ( ( input . get ( indexIn ++ ) & 0xFF ) << 8 ) ) ; } } }
Converts data in a ByteBuffer into a 16bit depth image