Exemplo n.º 1
0
  @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;
  }
Exemplo n.º 2
0
 @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);
 }
Exemplo n.º 3
0
 @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;
 }
Exemplo n.º 4
0
 @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;
 }
Exemplo n.º 5
0
 @Override
 public boolean reducesOpaquePixels() {
   if (!state.isNop()) {
     return true;
   }
   final Effect input = getInput();
   return input != null && input.reducesOpaquePixels();
 }
Exemplo n.º 6
0
 @Override
 public ImageData filterImageDatas(
     FilterContext fctx, BaseTransform transform, Rectangle outputClip, ImageData... inputs) {
   return state.filterImageDatas(this, fctx, transform, outputClip, inputs);
 }
Exemplo n.º 7
0
 /**
  * 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);
 }
Exemplo n.º 8
0
 /**
  * Returns the angle of the motion effect, in radians.
  *
  * @return the angle of the motion effect, in radians
  */
 public float getAngle() {
   return state.getAngle();
 }
Exemplo n.º 9
0
 /**
  * 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);
 }
Exemplo n.º 10
0
 /**
  * Returns the radius of the Gaussian kernel.
  *
  * @return the radius of the Gaussian kernel
  */
 public float getRadius() {
   return state.getRadius();
 }