public static void fillRectangle ( GrayF64 img , double value , int x0 , int y0 , int width , int height ) { int x1 = x0 + width ; int y1 = y0 + height ; if ( x0 < 0 ) x0 = 0 ; if ( x1 > img . width ) x1 = img . width ; if ( y0 < 0 ) y0 = 0 ; if ( y1 > img . height ) y1 = img . height ; for ( int y = y0 ; y < y1 ; y ++ ) { for ( int x = x0 ; x < x1 ; x ++ ) { img . set ( x , y , value ) ; } } }
Draws a filled rectangle that is aligned along the image axis inside the image .