private void flood ( ) throws Exception { /* define directions */ // Initialise the vector to a supposed dimension, if the number of // unresolved pixel overload the vector there are a method which resized // the vectors. pitsStackSize = ( int ) ( nCols * nRows * 0.1 ) ; pstack = pitsStackSize ; dn = new int [ pitsStackSize ] ; currentPitRows = new int [ pitsStackSize ] ; currentPitCols = new int [ pitsStackSize ] ; ipool = new int [ pstack ] ; jpool = new int [ pstack ] ; firstCol = 0 ; firstRow = 0 ; lastCol = nCols ; lastRow = nRows ; setdf ( ) ; }
Takes the elevation matrix and calculate a matrix with pits filled using the flooding algorithm .