@ Override public ImageSource apply ( ImageSource source ) { if ( radius != 0 ) { if ( source . isGrayscale ( ) ) { return applyGrayscale ( source , radius ) ; } else { return applyRGB ( source , radius ) ; } } else { if ( source . isGrayscale ( ) ) { return applyGrayscale ( source , kernel ) ; } else { return applyRGB ( source , kernel ) ; } } }
Apply filter to an image .