package pl.vgtworld.imagedraw.filters.edgedetect;

import pl.vgtworld.imagedraw.ImageDrawEntity;
import pl.vgtworld.imagedraw.filters.ImageDrawFilter;
import pl.vgtworld.imagedraw.filters.matrix.MatrixFilter;

public class EdgeDetectFilter implements ImageDrawFilter {
	
	private static final int DEFAULT_STRENGTH = 1;
	
	private float strength;
	
	public EdgeDetectFilter() {
		strength = DEFAULT_STRENGTH;
	}
	
	public EdgeDetectFilter(float strength) {
		this.strength = strength;
	}
	
	@Override
	public void doFilter(ImageDrawEntity image, int x, int y, int width, int height) {
		float[][] matrix = new float[][] {
				{ 0, strength, 0 },
				{ strength, -4 * strength, strength },
				{ 0, strength, 0 }
		};
		MatrixFilter filter = new MatrixFilter(matrix);
		filter.doFilter(image, x, y, width, height);
	}
	
}

@@ -203,16 +203,68 @@
 ilter;%0A%0A
+/**%0A * Filter applying edge detection to image.%0A */%0A
 public c
@@ -398,71 +398,288 @@
 %0A%09%0A%09
-public EdgeDetectFilter() %7B%0A%09%09strength = DEFAULT_STRENGTH;%0A%09%7D%0A%09
+/**%0A%09 * Creates filter with default configuration.%0A%09 * %0A%09 * %3Cp%3E%0A%09 * Edge detection strength is set to 1.%0A%09 */%0A%09public EdgeDetectFilter() %7B%0A%09%09strength = DEFAULT_STRENGTH;%0A%09%7D%0A%09%0A%09/**%0A%09 * Creates filter with custom configuration.%0A%09 * %0A%09 * @param strength Edge detection strength.%0A%09 */
 %0A%09pu

Add documentation.