@Test public void triangularAnnulus() { KernelJAI kernel = KernelFactory.createAnnulus( OUTER_RADIUS, INNER_RADIUS, KernelFactory.ValueType.TRIANGULAR); Evaluator e = new Evaluator() { public float eval(int maskValue, double dist2) { if (maskValue == 0) { return 0; } else { return (float) (1.0 - Math.sqrt(dist2) / OUTER_RADIUS); } } }; assertKernel(kernel, ANNULUS, e); }
public static KernelJAI createAnnulus(int outerRadius, int innerRadius, ValueType type, float centreValue) { KernelJAI kernel = createAnnulus(outerRadius, innerRadius, type); return KernelUtil.setElement(kernel, outerRadius, outerRadius, centreValue); }
KernelFactory { public static KernelJAI createAnnulus(int outerRadius, int innerRadius, ValueType type, float centreValue) { KernelJAI kernel = createAnnulus(outerRadius, innerRadius, type); return KernelUtil.setElement(kernel, outerRadius, outerRadius, centreValue); } }
KernelFactory { public static KernelJAI createAnnulus(int outerRadius, int innerRadius, ValueType type, float centreValue) { KernelJAI kernel = createAnnulus(outerRadius, innerRadius, type); return KernelUtil.setElement(kernel, outerRadius, outerRadius, centreValue); }  }
KernelFactory { public static KernelJAI createAnnulus(int outerRadius, int innerRadius, ValueType type, float centreValue) { KernelJAI kernel = createAnnulus(outerRadius, innerRadius, type); return KernelUtil.setElement(kernel, outerRadius, outerRadius, centreValue); }  static KernelJAI createCircle(int radius); static KernelJAI createConstantCircle(int radius, float value); static KernelJAI createCircle(int radius, ValueType type, float centreValue); static KernelJAI createCircle(int radius, ValueType type); static KernelJAI createAnnulus(int outerRadius, int innerRadius, ValueType type, float centreValue); static KernelJAI createConstantAnnulus(int outerRadius, int innerRadius, float value); static KernelJAI createAnnulus(int outerRadius, int innerRadius, ValueType type); static KernelJAI createRectangle(int width, int height); static KernelJAI createConstantRectangle(int width, int height, float value); static KernelJAI createConstantRectangle(int width, int height,
            int keyX, int keyY,  float value); static KernelJAI createRectangle(
            int width, int height, ValueType type, int keyX, int keyY, float keyValue); static KernelJAI createRectangle(
            int width, int height, ValueType type, int keyX, int keyY); static KernelJAI createFromShape(Shape shape, AffineTransform transform, ValueType type, int keyX, int keyY, float keyValue); }
KernelFactory { public static KernelJAI createAnnulus(int outerRadius, int innerRadius, ValueType type, float centreValue) { KernelJAI kernel = createAnnulus(outerRadius, innerRadius, type); return KernelUtil.setElement(kernel, outerRadius, outerRadius, centreValue); }  static KernelJAI createCircle(int radius); static KernelJAI createConstantCircle(int radius, float value); static KernelJAI createCircle(int radius, ValueType type, float centreValue); static KernelJAI createCircle(int radius, ValueType type); static KernelJAI createAnnulus(int outerRadius, int innerRadius, ValueType type, float centreValue); static KernelJAI createConstantAnnulus(int outerRadius, int innerRadius, float value); static KernelJAI createAnnulus(int outerRadius, int innerRadius, ValueType type); static KernelJAI createRectangle(int width, int height); static KernelJAI createConstantRectangle(int width, int height, float value); static KernelJAI createConstantRectangle(int width, int height,
            int keyX, int keyY,  float value); static KernelJAI createRectangle(
            int width, int height, ValueType type, int keyX, int keyY, float keyValue); static KernelJAI createRectangle(
            int width, int height, ValueType type, int keyX, int keyY); static KernelJAI createFromShape(Shape shape, AffineTransform transform, ValueType type, int keyX, int keyY, float keyValue);  }