Пример #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;
  }
Пример #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);
 }
Пример #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;
 }
Пример #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;
 }
Пример #5
0
 @Override
 public boolean reducesOpaquePixels() {
   if (!state.isNop()) {
     return true;
   }
   final Effect input = getInput();
   return input != null && input.reducesOpaquePixels();
 }
Пример #6
0
 @Override
 public ImageData filterImageDatas(
     FilterContext fctx, BaseTransform transform, Rectangle outputClip, ImageData... inputs) {
   return state.filterImageDatas(this, fctx, transform, outputClip, inputs);
 }
Пример #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);
 }
Пример #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();
 }
Пример #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);
 }
Пример #10
0
 /**
  * Returns the radius of the Gaussian kernel.
  *
  * @return the radius of the Gaussian kernel
  */
 public float getRadius() {
   return state.getRadius();
 }