本文整理了Java中org.openimaj.math.geometry.shape.Rectangle.getHeight
方法的一些代码示例,展示了Rectangle.getHeight
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rectangle.getHeight
方法的具体详情如下:
包路径:org.openimaj.math.geometry.shape.Rectangle
类名称:Rectangle
方法名:getHeight
暂无
代码示例来源:origin: openimaj/openimaj
@Override
public double getHeight() {
return this.calculateRegularBoundingBox().getHeight();
}
代码示例来源:origin: openimaj/openimaj
/**
* Removes zero-valued pixels from around the outside of the image.
* Analagous to {@link String#trim()}.
*
* @return A new image containing the trimmed image.
*/
public I trim() {
final Rectangle rect = this.getContentArea();
return this.extractROI((int) rect.minX(), (int) rect.minY(), (int) (rect.getWidth()), (int) (rect.getHeight()));
}
代码示例来源:origin: org.openimaj/core-image
/**
* Removes zero-valued pixels from around the outside of the image.
* Analagous to {@link String#trim()}.
*
* @return A new image containing the trimmed image.
*/
public I trim() {
final Rectangle rect = this.getContentArea();
return this.extractROI((int) rect.minX(), (int) rect.minY(), (int) (rect.getWidth()), (int) (rect.getHeight()));
}
代码示例来源:origin: org.openimaj/core-image
switch (sty.getVerticalAlignment()) {
case VERTICAL_BOTTOM:
y -= rect.getHeight();
break;
case VERTICAL_HALF:
y -= rect.getHeight()/2f;
break;
default:
代码示例来源:origin: openimaj/openimaj
switch (sty.getVerticalAlignment()) {
case VERTICAL_BOTTOM:
y -= rect.getHeight();
break;
case VERTICAL_HALF:
y -= rect.getHeight()/2f;
break;
default:
代码示例来源:origin: openimaj/openimaj
/**
* Create a transform to transform from one rectangle to another.
*
* @param from
* first rectangle
* @param to
* second rectangle
* @return the transform
*/
public static Matrix makeTransform(Rectangle from, Rectangle to) {
final Point2d trans = to.getTopLeft().minus(from.getTopLeft());
final double scaleW = to.getWidth() / from.getWidth();
final double scaleH = to.getHeight() / from.getHeight();
return TransformUtilities.scaleMatrix(scaleW, scaleH).times(
TransformUtilities.translateMatrix(trans.getX(), trans.getY()));
}
内容来源于网络,如有侵权,请联系作者删除!