android.graphics.Matrix.preConcat()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(195)

本文整理了Java中android.graphics.Matrix.preConcat()方法的一些代码示例,展示了Matrix.preConcat()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Matrix.preConcat()方法的具体详情如下:
包路径:android.graphics.Matrix
类名称:Matrix
方法名:preConcat

Matrix.preConcat介绍

暂无

代码示例

代码示例来源:origin: airbnb/lottie-android

@CallSuper @Override public void getBounds(
    RectF outBounds, Matrix parentMatrix, boolean applyParents) {
 rect.set(0, 0, 0, 0);
 buildParentLayerListIfNeeded();
 boundsMatrix.set(parentMatrix);
 if (applyParents) {
  if (parentLayers != null) {
   for (int i = parentLayers.size() - 1; i >= 0; i--) {
    boundsMatrix.preConcat(parentLayers.get(i).transform.getMatrix());
   }
  } else if (parentLayer != null) {
   boundsMatrix.preConcat(parentLayer.transform.getMatrix());
  }
 }
 boundsMatrix.preConcat(transform.getMatrix());
}

代码示例来源:origin: airbnb/lottie-android

@Override public void getBounds(RectF outBounds, Matrix parentMatrix, boolean applyParents) {
 matrix.set(parentMatrix);
 if (transformAnimation != null) {
  matrix.preConcat(transformAnimation.getMatrix());
 }
 rect.set(0, 0, 0, 0);
 for (int i = contents.size() - 1; i >= 0; i--) {
  Content content = contents.get(i);
  if (content instanceof DrawingContent) {
   ((DrawingContent) content).getBounds(rect, matrix, applyParents);
   outBounds.union(rect);
  }
 }
}

代码示例来源:origin: airbnb/lottie-android

@Override public void draw(Canvas canvas, Matrix parentMatrix, int parentAlpha) {
 if (hidden) {
  return;
 }
 matrix.set(parentMatrix);
 int alpha;
 if (transformAnimation != null) {
  matrix.preConcat(transformAnimation.getMatrix());
  alpha =
    (int) ((transformAnimation.getOpacity().getValue() / 100f * parentAlpha / 255f) * 255);
 } else {
  alpha = parentAlpha;
 }
 for (int i = contents.size() - 1; i >= 0; i--) {
  Object content = contents.get(i);
  if (content instanceof DrawingContent) {
   ((DrawingContent) content).draw(canvas, matrix, alpha);
  }
 }
}

代码示例来源:origin: alexvasilkov/GestureViews

private static void transformMatrixToPager(Matrix matrix, View view, ViewPager pager) {
  if (view.getParent() instanceof View) {
    View parent = (View) view.getParent();
    if (parent != pager) {
      transformMatrixToPager(matrix, parent, pager);
    }
    matrix.preTranslate(-parent.getScrollX(), -parent.getScrollY());
  }
  matrix.preTranslate(view.getLeft(), view.getTop());
  matrix.preConcat(view.getMatrix());
}

代码示例来源:origin: siyamed/android-shape-imageview

1,
});
matrix.preConcat(mat);

代码示例来源:origin: airbnb/lottie-android

@Override public void draw(Canvas canvas, Matrix parentMatrix, int alpha) {
 float copies = this.copies.getValue();
 float offset = this.offset.getValue();
 //noinspection ConstantConditions
 float startOpacity = this.transform.getStartOpacity().getValue() / 100f;
 //noinspection ConstantConditions
 float endOpacity = this.transform.getEndOpacity().getValue() / 100f;
 for (int i = (int) copies - 1; i >= 0; i--) {
  matrix.set(parentMatrix);
  matrix.preConcat(transform.getMatrixForRepeater(i + offset));
  float newAlpha = alpha * MiscUtils.lerp(startOpacity, endOpacity, i / copies);
  contentGroup.draw(canvas, matrix, (int) newAlpha);
 }
}

代码示例来源:origin: robolectric/robolectric

@Test
public void testPreConcat() {
 final Matrix matrix = new Matrix();
 matrix.preScale(2.0f, 3.0f);
 final Matrix translateMatrix = new Matrix();
 translateMatrix.setTranslate(5.0f, 7.0f);
 matrix.preConcat(translateMatrix);
 assertPointsEqual(mapPoint(matrix, 2.0f, 2.0f), new PointF(14.0f, 27.0f));
 final Matrix rotateMatrix = new Matrix();
 rotateMatrix.setRotate(90.0f);
 matrix.preConcat(rotateMatrix);
 assertPointsEqual(mapPoint(matrix, 2.0f, 2.0f), new PointF(6.0f, 27.0f));
}

代码示例来源:origin: airbnb/lottie-android

matrix.set(parentMatrix);
for (int i = parentLayers.size() - 1; i >= 0; i--) {
 matrix.preConcat(parentLayers.get(i).transform.getMatrix());
  ((parentAlpha / 255f * (float) transform.getOpacity().getValue() / 100f) * 255);
if (!hasMatteOnThisLayer() && !hasMasksOnThisLayer()) {
 matrix.preConcat(transform.getMatrix());
 L.beginSection("Layer#drawLayer");
 drawLayer(canvas, matrix, alpha);
matrix.preConcat(transform.getMatrix());
intersectBoundsWithMask(rect, matrix);

代码示例来源:origin: bufferapp/BufferTextInputLayout

private static void offsetDescendantMatrix(ViewParent target, View view, Matrix m) {
    final ViewParent parent = view.getParent();
    if (parent instanceof View && parent != target) {
      final View vp = (View) parent;
      offsetDescendantMatrix(target, vp, m);
      m.preTranslate(-vp.getScrollX(), -vp.getScrollY());
    }

    m.preTranslate(view.getLeft(), view.getTop());

    if (!view.getMatrix().isIdentity()) {
      m.preConcat(view.getMatrix());
    }
  }
}

代码示例来源:origin: japgolly/svg-android

public void inherit(Gradient parent) {
    Gradient child = this;
    child.xlink = parent.id;
    child.positions = parent.positions;
    child.colors = parent.colors;
    if (child.matrix == null) {
      child.matrix = parent.matrix;
    } else if (parent.matrix != null) {
      Matrix m = new Matrix(parent.matrix);
      m.preConcat(child.matrix);
      child.matrix = m;
    }
  }
}

代码示例来源:origin: wufenglincheng/ImageTrans

public Matrix getMinMatrix() {
  Matrix matrix = new Matrix();
  matrix.setScale(mMinScale, mMinScale);
  matrix.preConcat(mBaseMatrix);
  return matrix;
}

代码示例来源:origin: luhaoaimama1/zone-sdk

public void preConcat_fix3D_MPERSP(Matrix matrix, Context context) {
  Matrix tempMatrix = new Matrix();
  getMatrix_fix3D_MPERSP(tempMatrix, context);
  matrix.preConcat(tempMatrix);
}

代码示例来源:origin: bookdash/bookdash-android-app

static void offsetDescendantMatrix(ViewParent target, View view, Matrix m) {
    final ViewParent parent = view.getParent();
    if (parent instanceof View && parent != target) {
      final View vp = (View) parent;
      offsetDescendantMatrix(target, vp, m);
      m.preTranslate(-vp.getScrollX(), -vp.getScrollY());
    }

    m.preTranslate(view.getLeft(), view.getTop());

    if (!view.getMatrix().isIdentity()) {
      m.preConcat(view.getMatrix());
    }
  }
}

代码示例来源:origin: AriesHoo/UIWidget

static void offsetDescendantMatrix(ViewParent target, View view, Matrix m) {
    final ViewParent parent = view.getParent();
    if (parent instanceof View && parent != target) {
      final View vp = (View) parent;
      offsetDescendantMatrix(target, vp, m);
      m.preTranslate(-vp.getScrollX(), -vp.getScrollY());
    }

    m.preTranslate(view.getLeft(), view.getTop());

    if (!view.getMatrix().isIdentity()) {
      m.preConcat(view.getMatrix());
    }
  }
}

代码示例来源:origin: gigabytedevelopers/FireFiles

static void offsetDescendantMatrix(ViewParent target, View view, Matrix m) {
    final ViewParent parent = view.getParent();
    if (parent instanceof View && parent != target) {
      final View vp = (View) parent;
      offsetDescendantMatrix(target, vp, m);
      m.preTranslate(-vp.getScrollX(), -vp.getScrollY());
    }

    m.preTranslate(view.getLeft(), view.getTop());

    if (!view.getMatrix().isIdentity()) {
      m.preConcat(view.getMatrix());
    }
  }
}

代码示例来源:origin: VyacheslavShmakin/GpCollapsingToolbar

static void offsetDescendantMatrix(ViewParent target, View view, Matrix m) {
    final ViewParent parent = view.getParent();
    if (parent instanceof View && parent != target) {
      final View vp = (View) parent;
      offsetDescendantMatrix(target, vp, m);
      m.preTranslate(-vp.getScrollX(), -vp.getScrollY());
    }

    m.preTranslate(view.getLeft(), view.getTop());

    if (!view.getMatrix().isIdentity()) {
      m.preConcat(view.getMatrix());
    }
  }
}

代码示例来源:origin: yavski/fab-speed-dial

static void offsetDescendantMatrix(ViewParent target, View view, Matrix m) {
    final ViewParent parent = view.getParent();
    if (parent instanceof View && parent != target) {
      final View vp = (View) parent;
      offsetDescendantMatrix(target, vp, m);
      m.preTranslate(-vp.getScrollX(), -vp.getScrollY());
    }

    m.preTranslate(view.getLeft(), view.getTop());

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      if (!view.getMatrix().isIdentity()) {
        m.preConcat(view.getMatrix());
      }
    }
  }
}

代码示例来源:origin: HemendraGangwar/IntentSharingAnim

static void offsetDescendantMatrix(ViewParent target, View view, Matrix m) {
    final ViewParent parent = view.getParent();
    if (parent instanceof View && parent != target) {
      final View vp = (View) parent;
      offsetDescendantMatrix(target, vp, m);
      m.preTranslate(-vp.getScrollX(), -vp.getScrollY());
    }

    m.preTranslate(view.getLeft(), view.getTop());

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      if (!view.getMatrix().isIdentity()) {
        m.preConcat(view.getMatrix());
      }
    }
  }
}

代码示例来源:origin: com.caverock/androidsvg

private void addObjectToClip(SVG.Use obj, Path combinedPath, Matrix combinedPathMatrix)
{
 updateStyleForElement(state, obj);
 if (!display())
   return;
 if (!visible())
   return;
 if (obj.transform != null)
   combinedPathMatrix.preConcat(obj.transform);
 // Locate the referenced object
 SVG.SvgObject  ref = obj.document.resolveIRI(obj.href);
 if (ref == null) {
   error("Use reference '%s' not found", obj.href);
   return;
 }
 checkForClipPath(obj);
 
 addObjectToClip(ref, false, combinedPath, combinedPathMatrix);
}

代码示例来源:origin: com.caverock/androidsvg

private void addObjectToClip(SVG.Path obj, Path combinedPath, Matrix combinedPathMatrix)
{
 updateStyleForElement(state, obj);
 if (!display())
   return;
 if (!visible())
   return;
 if (obj.transform != null)
   combinedPathMatrix.preConcat(obj.transform);
 Path  path = (new PathConverter(obj.d)).getPath();
 if (obj.boundingBox == null) {
   obj.boundingBox = calculatePathBounds(path);
 }
 checkForClipPath(obj);
 //path.setFillType(getClipRuleFromState());
 combinedPath.setFillType(getClipRuleFromState());
 combinedPath.addPath(path, combinedPathMatrix);
}

相关文章