java.awt.geom.AffineTransform.getShearY()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(161)

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

AffineTransform.getShearY介绍

暂无

代码示例

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

  1. writer.setValue(Double.toString(atx.getScaleX()));
  2. writer.endNode();
  3. writer.startNode("scaleY");
  4. writer.setValue(Double.toString(atx.getScaleY()));
  5. writer.endNode();
  6. writer.startNode("shearX");
  7. writer.setValue(Double.toString(atx.getShearX()));
  8. writer.endNode();
  9. writer.startNode("shearY");
  10. writer.setValue(Double.toString(atx.getShearY()));
  11. writer.endNode();
  12. writer.startNode("translateX");

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

  1. /**
  2. * Returns the magnitude of scale factor <var>y</var> by cancelling the effect of eventual flip
  3. * and rotation. This factor is calculated by <IMG
  4. * src="{@docRoot}/org/geotools/display/canvas/doc-files/scaleY0.png">.
  5. */
  6. public static double getScaleY0(final AffineTransform tr) {
  7. final double scale = tr.getScaleY();
  8. final double shear = tr.getShearY();
  9. if (shear == 0) return Math.abs(scale); // Optimization for a very common case.
  10. if (scale == 0) return Math.abs(shear); // Not as common as above, but still common enough.
  11. return Math.hypot(scale, shear);
  12. }

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

  1. } else {
  2. AffineTransform tx = graphics.getTransform();
  3. if (Math.abs(tx.getShearX()) >= EPS || Math.abs(tx.getShearY()) > EPS) {
  4. graphics.fill(outline);
  5. } else {

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

  1. @Override
  2. @SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
  3. public boolean equals(Object obj) {
  4. if (!(obj instanceof AffineTransform)) {
  5. return false;
  6. }
  7. AffineTransform a = (AffineTransform) obj;
  8. return Utilities.equals(getScaleX(), a.getScaleX())
  9. && Utilities.equals(getScaleY(), a.getScaleY())
  10. && Utilities.equals(getShearX(), a.getShearY())
  11. && Utilities.equals(getTranslateX(), a.getTranslateX())
  12. && Utilities.equals(getTranslateY(), a.getTranslateY());
  13. }
  14. }

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

  1. /**
  2. * Implements {@link SVGMatrix#setD(float)}.
  3. */
  4. public void setD(float d) throws DOMException {
  5. AffineTransform at = getAffineTransform();
  6. at.setTransform(at.getScaleX(),
  7. at.getShearY(),
  8. at.getShearX(),
  9. d,
  10. at.getTranslateX(),
  11. at.getTranslateY());
  12. }

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

  1. /**
  2. * Implements {@link SVGMatrix#setA(float)}.
  3. */
  4. public void setA(float a) throws DOMException {
  5. AffineTransform at = getAffineTransform();
  6. at.setTransform(a,
  7. at.getShearY(),
  8. at.getShearX(),
  9. at.getScaleY(),
  10. at.getTranslateX(),
  11. at.getTranslateY());
  12. }

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

  1. AffineTransform aTX = (AffineTransform) geometry.getGridToCRS();
  2. writer.write("<geoTransform>");
  3. writer.write("<scaleX>" + aTX.getScaleX() + "</scaleX>\n");
  4. writer.write("<scaleY>" + aTX.getScaleY() + "</scaleY>\n");
  5. writer.write("<shearX>" + aTX.getShearX() + "</shearX>\n");
  6. writer.write("<shearY>" + aTX.getShearY() + "</shearY>\n");
  7. writer.write("<translateX>" + aTX.getTranslateX() + "</translateX>\n");
  8. writer.write("<translateY>" + aTX.getTranslateY() + "</translateY>\n");

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

  1. /**
  2. * Implements {@link SVGMatrix#setC(float)}.
  3. */
  4. public void setC(float c) throws DOMException {
  5. AffineTransform at = getAffineTransform();
  6. at.setTransform(at.getScaleX(),
  7. at.getShearY(),
  8. c,
  9. at.getScaleY(),
  10. at.getTranslateX(),
  11. at.getTranslateY());
  12. }

代码示例来源:origin: apache/batik

  1. /**
  2. * Implements {@link SVGMatrix#setD(float)}.
  3. */
  4. public void setD(float d) throws DOMException {
  5. AffineTransform at = getAffineTransform();
  6. at.setTransform(at.getScaleX(),
  7. at.getShearY(),
  8. at.getShearX(),
  9. d,
  10. at.getTranslateX(),
  11. at.getTranslateY());
  12. }

代码示例来源:origin: apache/batik

  1. /**
  2. * Implements {@link SVGMatrix#setA(float)}.
  3. */
  4. public void setA(float a) throws DOMException {
  5. AffineTransform at = getAffineTransform();
  6. at.setTransform(a,
  7. at.getShearY(),
  8. at.getShearX(),
  9. at.getScaleY(),
  10. at.getTranslateX(),
  11. at.getTranslateY());
  12. }

代码示例来源:origin: net.sf.cssbox/pdf2dom

  1. private BufferedImage rotateImage(BufferedImage outputImage)
  2. {
  3. // x, y and size are handled by css attributes but still need to rotate the image so pulling
  4. // only rotation out of the matrix so no giant whitespace offset from translations
  5. Matrix ctm = getGraphicsState().getCurrentTransformationMatrix();
  6. AffineTransform tr = ctm.createAffineTransform();
  7. double rotate = Math.atan2(tr.getShearY(), tr.getScaleY()) - Math.toRadians(pdpage.getRotation());
  8. outputImage = ImageUtils.rotateImage(outputImage, rotate);
  9. return outputImage;
  10. }

代码示例来源:origin: org.geotools/gt2-coverage

  1. /**
  2. * Checks the transformation is a pure scale/translate instance (using a tolerance)
  3. * @param transform
  4. * @return
  5. */
  6. protected final boolean isScaleTranslate(MathTransform transform) {
  7. if(!(transform instanceof AffineTransform))
  8. return false;
  9. AffineTransform at = (AffineTransform) transform;
  10. return at.getShearX() < EPS && at.getShearY() < EPS;
  11. }

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

  1. /** Gets the derivative of this transform at a point. */
  2. @Override
  3. public Matrix derivative(final Point2D point) {
  4. final AffineTransform tr = new AffineTransform();
  5. getAffineTransform(point.getX(), point.getY(), tr);
  6. return new Matrix2(
  7. tr.getScaleX(), tr.getShearX(),
  8. tr.getShearY(), tr.getScaleY());
  9. }

代码示例来源:origin: apache/batik

  1. /**
  2. * Implements {@link SVGMatrix#setC(float)}.
  3. */
  4. public void setC(float c) throws DOMException {
  5. AffineTransform at = getAffineTransform();
  6. at.setTransform(at.getScaleX(),
  7. at.getShearY(),
  8. c,
  9. at.getScaleY(),
  10. at.getTranslateX(),
  11. at.getTranslateY());
  12. }

代码示例来源:origin: org.geotools/gt2-coverage

  1. /**
  2. * Checks the transformation is a pure scale/translate instance (using a
  3. * tolerance)
  4. *
  5. * @param transform
  6. * @return
  7. */
  8. protected final boolean isScaleTranslate(MathTransform transform) {
  9. if (!(transform instanceof AffineTransform))
  10. return false;
  11. AffineTransform at = (AffineTransform) transform;
  12. return at.getShearX() < EPS && at.getShearY() < EPS;
  13. }

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

  1. /**
  2. * @param ls
  3. * @param at
  4. * @param generalize
  5. * @param maxDistance
  6. */
  7. public void init(LineString ls, AffineTransform at, boolean generalize, float maxDistance) {
  8. if (at == null) at = new AffineTransform();
  9. _init(ls, at, generalize, maxDistance);
  10. xScale =
  11. (float)
  12. Math.sqrt(
  13. (at.getScaleX() * at.getScaleX())
  14. + (at.getShearX() * at.getShearX()));
  15. yScale =
  16. (float)
  17. Math.sqrt(
  18. (at.getScaleY() * at.getScaleY())
  19. + (at.getShearY() * at.getShearY()));
  20. }

代码示例来源:origin: apache/pdfbox

  1. /**
  2. * Creates a matrix with the same elements as the given AffineTransform.
  3. * @param at
  4. */
  5. public Matrix(AffineTransform at)
  6. {
  7. single = new float[DEFAULT_SINGLE.length];
  8. System.arraycopy(DEFAULT_SINGLE, 0, single, 0, DEFAULT_SINGLE.length);
  9. single[0] = (float)at.getScaleX();
  10. single[1] = (float)at.getShearY();
  11. single[3] = (float)at.getShearX();
  12. single[4] = (float)at.getScaleY();
  13. single[6] = (float)at.getTranslateX();
  14. single[7] = (float)at.getTranslateY();
  15. }

代码示例来源:origin: apache/pdfbox

  1. /**
  2. * Set the values of the matrix from the AffineTransform.
  3. *
  4. * @param af The transform to get the values from.
  5. * @deprecated Use the {@link #Matrix(AffineTransform)} constructor instead.
  6. */
  7. @Deprecated
  8. public void setFromAffineTransform( AffineTransform af )
  9. {
  10. single[0] = (float)af.getScaleX();
  11. single[1] = (float)af.getShearY();
  12. single[3] = (float)af.getShearX();
  13. single[4] = (float)af.getScaleY();
  14. single[6] = (float)af.getTranslateX();
  15. single[7] = (float)af.getTranslateY();
  16. }

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

  1. /**
  2. * Sets this matrix to the specified affine transform.
  3. *
  4. * @since 2.3
  5. */
  6. public void setMatrix(final AffineTransform transform) {
  7. mat.a11 = transform.getScaleX();
  8. mat.a12 = transform.getShearX();
  9. mat.a13 = transform.getTranslateX();
  10. mat.a21 = transform.getShearY();
  11. mat.a22 = transform.getScaleY();
  12. mat.a23 = transform.getTranslateY();
  13. mat.a31 = 0;
  14. mat.a32 = 0;
  15. mat.a33 = 1;
  16. }

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

  1. /**
  2. * Returns {@code true} if this matrix is equals to the specified affine transform.
  3. *
  4. * @since 2.3
  5. */
  6. public boolean equalsAffine(final AffineTransform transform) {
  7. return mat.a11 == transform.getScaleX()
  8. && mat.a12 == transform.getShearX()
  9. && mat.a13 == transform.getTranslateX()
  10. && mat.a21 == transform.getShearY()
  11. && mat.a22 == transform.getScaleY()
  12. && mat.a23 == transform.getTranslateY()
  13. && mat.a31 == 0
  14. && mat.a32 == 0
  15. && mat.a33 == 1;
  16. }

相关文章