protected void updatePdfImage ( int x0 , int y0 , int x1 , int y1 ) { for ( int y = y0 ; y < y1 ; y ++ ) { int indexOut = pdf . startIndex + pdf . stride * y + x0 ; for ( int x = x0 ; x < x1 ; x ++ , indexOut ++ ) { if ( pdf . data [ indexOut ] < 0 ) pdf . data [ indexOut ] = targetModel . compute ( x , y ) ; } } // update the dirty region if ( dirty . x0 > x0 ) dirty . x0 = x0 ; if ( dirty . y0 > y0 ) dirty . y0 = y0 ; if ( dirty . x1 < x1 ) dirty . x1 = x1 ; if ( dirty . y1 < y1 ) dirty . y1 = y1 ; }
Computes the PDF only inside the image as needed amd update the dirty rectangle