本文整理了Java中java.awt.geom.AffineTransform.createInverse()
方法的一些代码示例,展示了AffineTransform.createInverse()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AffineTransform.createInverse()
方法的具体详情如下:
包路径:java.awt.geom.AffineTransform
类名称:AffineTransform
方法名:createInverse
暂无
代码示例来源:origin: org.apache.poi/poi
public Shape getClip()
{
try
{
return getTrans().createInverse().createTransformedShape(getDeviceclip());
}
catch(Exception _ex)
{
return null;
}
}
代码示例来源:origin: nodebox/nodebox
public boolean invert() {
try {
affineTransform = affineTransform.createInverse();
return true;
} catch (NoninvertibleTransformException e) {
return false;
}
}
代码示例来源:origin: geotools/geotools
/** Apply scaling parameter to the ROI to return the scaled version */
private ROI computeScaledROI(double[] scalingParams) throws NoninvertibleTransformException {
ROI newRoi = null;
if (roi != null) {
AffineTransform sTx =
AffineTransform.getScaleInstance(scalingParams[0], scalingParams[1]);
sTx.concatenate(
AffineTransform.getTranslateInstance(scalingParams[2], scalingParams[3]));
newRoi = roi.transform(sTx.createInverse());
}
return newRoi;
}
代码示例来源:origin: nodebox/nodebox
public AffineTransform getInverseViewTransform() {
if (inverseViewTransform == null) {
try {
inverseViewTransform = getViewTransform().createInverse();
} catch (NoninvertibleTransformException e) {
inverseViewTransform = new AffineTransform();
}
}
return inverseViewTransform;
}
代码示例来源:origin: geotools/geotools
/**
* Calculates transforms suitable for no aspect ratio matching.
*
* @param requestedBounds requested display area in world coordinates
*/
private void calculateSimpleTransforms(ReferencedEnvelope requestedBounds) {
double xscale = screenArea.getWidth() / requestedBounds.getWidth();
double yscale = screenArea.getHeight() / requestedBounds.getHeight();
worldToScreen =
new AffineTransform(
xscale,
0,
0,
-yscale,
-xscale * requestedBounds.getMinX(),
yscale * requestedBounds.getMaxY());
try {
screenToWorld = worldToScreen.createInverse();
} catch (NoninvertibleTransformException ex) {
throw new RuntimeException("Unable to create coordinate transforms.", ex);
}
}
代码示例来源:origin: geotools/geotools
/**
* Calculates transforms suitable for aspect ratio matching. The world bounds will be centred in
* the screen area.
*/
private void calculateCenteringTransforms() {
double xscale = screenArea.getWidth() / bounds.getWidth();
double yscale = screenArea.getHeight() / bounds.getHeight();
double scale = Math.min(xscale, yscale);
double xoff = bounds.getMedian(0) * scale - screenArea.getCenterX();
double yoff = bounds.getMedian(1) * scale + screenArea.getCenterY();
worldToScreen = new AffineTransform(scale, 0, 0, -scale, -xoff, yoff);
try {
screenToWorld = worldToScreen.createInverse();
} catch (NoninvertibleTransformException ex) {
throw new RuntimeException("Unable to create coordinate transforms.", ex);
}
hasCenteringTransforms = true;
}
代码示例来源:origin: apache/pdfbox
rat = shading.getMatrix().createAffineTransform().createInverse();
rat.concatenate(matrix.createAffineTransform().createInverse());
rat.concatenate(xform.createInverse());
代码示例来源:origin: geotools/geotools
final double det = m00 * m11 - m01 * m10;
if (!(Math.abs(det) > Double.MIN_VALUE)) {
return transform.createInverse().deltaTransform(source, dest);
代码示例来源:origin: geotools/geotools
m.setGridRange(new GridEnvelope2D(paintArea));
m.setEnvelope(genvelope);
return m.createAffineTransform().createInverse();
} catch (MismatchedDimensionException e) {
LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);
代码示例来源:origin: geotools/geotools
m.setGridRange(new GridEnvelope2D(paintArea));
m.setEnvelope(genvelope);
return m.createAffineTransform().createInverse();
} catch (MismatchedDimensionException e) {
LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);
代码示例来源:origin: apache/pdfbox
rat = matrix.createAffineTransform().createInverse();
rat.concatenate(xform.createInverse());
代码示例来源:origin: geotools/geotools
public void testOGCScaleAffineProjected() throws Exception {
// 1 pixel == 500 m => 0.00028 m [ screen] == 500 m [world]
// => scaleDenominator = 500/0.00028
final AffineTransform screenToWord = AffineTransform.getScaleInstance(500, 500);
final AffineTransform worldToScreen = screenToWord.createInverse();
final CoordinateReferenceSystem crs = DefaultEngineeringCRS.CARTESIAN_2D;
double scale;
scale = RendererUtilities.calculateOGCScaleAffine(crs, worldToScreen, new HashMap());
assertEquals(500 / 0.00028, scale, 0.0001);
worldToScreen.rotate(1.0);
scale = RendererUtilities.calculateOGCScaleAffine(crs, worldToScreen, new HashMap());
assertEquals(500 / 0.00028, scale, 0.0001);
worldToScreen.translate(100.0, 100.0);
scale = RendererUtilities.calculateOGCScaleAffine(crs, worldToScreen, new HashMap());
assertEquals(500 / 0.00028, scale, 0.0001);
}
代码示例来源:origin: geotools/geotools
public void testOGCScaleAffineGeographic() throws Exception {
// 1 pixel == 0.5 degree => 0.00028 m [ screen] == 0.5 degree * OGC_DEGREE_TO_METERS m
// [world]
// => scaleDenominator = 0.5 * OGC_DEGREE_TO_METERS/0.00028
final AffineTransform screenToWord = AffineTransform.getScaleInstance(0.5, 0.5);
final AffineTransform worldToScreen = screenToWord.createInverse();
final CoordinateReferenceSystem crs = DefaultGeographicCRS.WGS84;
double scale;
scale = RendererUtilities.calculateOGCScaleAffine(crs, worldToScreen, new HashMap());
assertEquals(0.5 * RendererUtilities.OGC_DEGREE_TO_METERS / 0.00028, scale, 0.0001);
worldToScreen.rotate(1.0);
scale = RendererUtilities.calculateOGCScaleAffine(crs, worldToScreen, new HashMap());
assertEquals(0.5 * RendererUtilities.OGC_DEGREE_TO_METERS / 0.00028, scale, 0.0001);
worldToScreen.translate(100.0, 100.0);
scale = RendererUtilities.calculateOGCScaleAffine(crs, worldToScreen, new HashMap());
assertEquals(0.5 * RendererUtilities.OGC_DEGREE_TO_METERS / 0.00028, scale, 0.0001);
}
代码示例来源:origin: apache/pdfbox
rat = matrix.createAffineTransform().createInverse();
rat.concatenate(xform.createInverse());
代码示例来源:origin: geotools/geotools
finalGridToWorld = finalWorldToGrid.createInverse();
} else {
final GridToEnvelopeMapper gridToEnvelopeMapper = new GridToEnvelopeMapper();
gridToEnvelopeMapper.setEnvelope(destinationEnvelope);
finalGridToWorld = new AffineTransform(gridToEnvelopeMapper.createAffineTransform());
finalWorldToGrid = finalGridToWorld.createInverse();
代码示例来源:origin: geotools/geotools
rasterSpaceGeometry = JTS.transform(roi, new AffineTransform2D(mt2d.createInverse()));
} catch (MismatchedDimensionException e) {
throw new ProcessException(e);
代码示例来源:origin: geotools/geotools
try {
worldToGridTransform =
ProjectiveTransform.create(gridToWorldTransformCorrected.createInverse());
} catch (NoninvertibleTransformException e) {
代码示例来源:origin: geotools/geotools
AffineTransform trans = tr.get(i).createInverse();
newROI = covROI.transform(trans);
} catch (NoninvertibleTransformException e) {
代码示例来源:origin: geotools/geotools
new GridEnvelope2D(bufferedTargetArea),
PixelInCell.CELL_CORNER,
new AffineTransform2D(worldToScreenTransform.createInverse()),
originalMapExtent.getCoordinateReferenceSystem(),
null);
代码示例来源:origin: geotools/geotools
ReferencedEnvelope.reference(envelope),
new Rectangle(0, 0, 50, 50),
gtoem.createAffineTransform().createInverse());
内容来源于网络,如有侵权,请联系作者删除!