private int getSourcePixel ( int [ ] srcImage , int x , int y ) { int x1 = Math . max ( 0 , x ) ; x1 = Math . min ( width - 1 , x1 ) ; int y1 = Math . max ( 0 , y ) ; y1 = Math . min ( height - 1 , y1 ) ; return srcImage [ x1 + y1 * width ] ; }
Get pixel source .