@Override public DirtyRegionContainer getDirtyRegions(Effect defaultInput, DirtyRegionPool regionPool) { Effect di = getDefaultedInput(0, defaultInput); DirtyRegionContainer drc = di.getDirtyRegions(defaultInput, regionPool); drc.grow(state.getHPad(), state.getVPad()); return drc; }
@Override public BaseBounds getBounds(BaseTransform transform, Effect defaultInput) { BaseBounds r = super.getBounds(null, defaultInput); int hpad = state.getHPad(); int vpad = state.getVPad(); BaseBounds ret = new RectBounds(r.getMinX(), r.getMinY(), r.getMaxX(), r.getMaxY()); ((RectBounds) ret).grow(hpad, vpad); return transformBounds(transform, ret); }
@Override public Rectangle getResultBounds( BaseTransform transform, Rectangle outputClip, ImageData... inputDatas) { Rectangle r = super.getResultBounds(transform, outputClip, inputDatas); int hpad = state.getHPad(); int vpad = state.getVPad(); Rectangle ret = new Rectangle(r); ret.grow(hpad, vpad); return ret; }
@Override protected Rectangle getInputClip(int inputIndex, BaseTransform transform, Rectangle outputClip) { // A blur needs as much "fringe" data from its input as it creates // around its output so we use the same expansion as is used in the // result bounds. if (outputClip != null) { int hpad = state.getHPad(); int vpad = state.getVPad(); if ((hpad | vpad) != 0) { outputClip = new Rectangle(outputClip); outputClip.grow(hpad, vpad); } } return outputClip; }
@Override public boolean reducesOpaquePixels() { if (!state.isNop()) { return true; } final Effect input = getInput(); return input != null && input.reducesOpaquePixels(); }
@Override public ImageData filterImageDatas( FilterContext fctx, BaseTransform transform, Rectangle outputClip, ImageData... inputs) { return state.filterImageDatas(this, fctx, transform, outputClip, inputs); }
/** * Sets the angle of the motion effect, in radians. * * <pre> * Min: n/a * Max: n/a * Default: 0.0 * Identity: n/a * </pre> * * @param angle the angle of the motion effect, in radians */ public void setAngle(float angle) { float old = state.getAngle(); state.setAngle(angle); }
/** * Returns the angle of the motion effect, in radians. * * @return the angle of the motion effect, in radians */ public float getAngle() { return state.getAngle(); }
/** * Sets the radius of the Gaussian kernel. * * <pre> * Min: 0.0 * Max: 63.0 * Default: 10.0 * Identity: 0.0 * </pre> * * @param radius the radius of the Gaussian kernel * @throws IllegalArgumentException if {@code radius} is outside the allowable range */ public void setRadius(float radius) { float old = state.getRadius(); state.setRadius(radius); }
/** * Returns the radius of the Gaussian kernel. * * @return the radius of the Gaussian kernel */ public float getRadius() { return state.getRadius(); }