public class RectHelper
extends java.lang.Object
构造器和说明 |
---|
RectHelper() |
限定符和类型 | 方法和说明 |
---|---|
static float |
computeAngle(android.graphics.PointF point,
android.graphics.PointF cPoint)
计算与中心点的角度
|
static android.graphics.Rect |
computerCenter(org.lasque.tusdk.core.struct.TuSdkSize mainSize,
float ratio)
计算区域中心位置
|
static android.graphics.Rect |
computerCenter(org.lasque.tusdk.core.struct.TuSdkSize mainSize,
org.lasque.tusdk.core.struct.TuSdkSize rectSize)
计算区域中心位置
|
static android.graphics.RectF |
computerCenterRectF(org.lasque.tusdk.core.struct.TuSdkSize mainSize,
float ratio)
计算区域中心位置
|
static android.graphics.RectF |
computerCenterRectF(org.lasque.tusdk.core.struct.TuSdkSize mainSize,
float ratio,
boolean keepRatio)
计算区域中心位置
|
static android.graphics.Rect |
computerMinMaxSideInRegionRatio(org.lasque.tusdk.core.struct.TuSdkSize imageSize,
float minMaxSideratio)
计算长宽区范围内输入最小边与最大边比例区域
|
static android.graphics.Rect |
computerOutCenter(android.graphics.Rect rect,
float ratio,
boolean baseLongSide)
计算图片的范围外缩放比例模式
|
static float |
computerOutScale(android.graphics.Rect rect,
float ratio,
boolean baseLongSide)
计算图片的范围外缩放比例
|
static org.lasque.tusdk.core.struct.TuSdkSize |
computerOutSize(org.lasque.tusdk.core.struct.TuSdkSize size,
float ratio,
boolean baseLongSide)
计算范围外等比缩放长宽
|
static double |
computerPotintDistance(android.graphics.PointF aPoint,
android.graphics.PointF bPoint)
获取两点之间距离
|
static double |
computerPotintDistance(android.graphics.Point aPoint,
android.graphics.Point bPoint)
获取两点之间距离
|
static float[] |
displayCoordinates(ImageOrientation rotation,
android.graphics.RectF rect)
计算显示旋转坐标
|
static float[] |
displayVertices(ImageOrientation rotation,
android.graphics.RectF rect)
计算显示位置坐标
|
static android.graphics.RectF |
fixedCorpPrecentRect(android.graphics.RectF rect,
ImageOrientation orientation)
修正百分比裁剪选取
|
static android.graphics.Rect |
fixedRectF(org.lasque.tusdk.core.struct.TuSdkSize mainSize,
android.graphics.RectF corpRect)
修正截取区域数据
|
static float |
getDistanceOfTwoPoints(float x1,
float y1,
float x2,
float y2)
计算两个点之间的距离
|
static float |
getDistanceOfTwoPoints(android.graphics.PointF end,
android.graphics.PointF start)
计算两个点之间的距离
|
static android.graphics.RectF |
getRectInParent(android.graphics.RectF parentRect,
android.graphics.RectF subPercetRect)
获取在画布上的左上角位置
|
static android.graphics.RectF |
getRectInParent(org.lasque.tusdk.core.struct.TuSdkSize parentSize,
org.lasque.tusdk.core.struct.TuSdkSize subSize,
android.graphics.RectF center)
获取在画布上的左上角位置
|
static android.graphics.Rect |
makeRectWithAspectRatioInsideRect(org.lasque.tusdk.core.struct.TuSdkSize aspectRatio,
android.graphics.Rect boundingRect)
计算在Rect内按比例缩放Size后新的Rect
|
static android.graphics.RectF |
makeRectWithAspectRatioOutsideRect(org.lasque.tusdk.core.struct.TuSdkSize aspectRatio,
android.graphics.RectF boundingRect)
计算在Rect外按比例缩放Size后新的Rect
|
static void |
mergeEnclosingRectangle(android.graphics.RectF rect,
android.graphics.PointF point,
float degree)
合并外接矩形坐标
|
static android.graphics.RectF |
minEnclosingRectangle(android.graphics.PointF cPoint,
org.lasque.tusdk.core.struct.TuSdkSize size,
float degree)
计算旋转后的最小外接矩形坐标
|
static android.graphics.PointF |
rotationWithOrigin(android.graphics.PointF point,
float degree)
围绕原点旋转
|
static android.graphics.RectF |
rotationWithRotation(android.graphics.RectF rect,
ImageOrientation rotation)
旋转范围
|
static android.graphics.Rect |
rotationWithRotation(android.graphics.Rect rect,
org.lasque.tusdk.core.struct.TuSdkSize size,
ImageOrientation rotation)
旋转范围
|
static float[] |
textureCoordinates(ImageOrientation rotation,
android.graphics.RectF rect)
计算材质旋转坐标
|
static float[] |
textureVertices(ImageOrientation rotation,
android.graphics.RectF rect)
计算材质位置坐标
|
public static android.graphics.Rect computerCenter(org.lasque.tusdk.core.struct.TuSdkSize mainSize, org.lasque.tusdk.core.struct.TuSdkSize rectSize)
mainSize
- 主视图长宽rectSize
- 区域长宽public static android.graphics.Rect computerCenter(org.lasque.tusdk.core.struct.TuSdkSize mainSize, float ratio)
mainSize
- 主视图长宽ratio
- 区域比例public static android.graphics.RectF computerCenterRectF(org.lasque.tusdk.core.struct.TuSdkSize mainSize, float ratio)
mainSize
- 主视图长宽ratio
- 区域比例public static android.graphics.RectF computerCenterRectF(org.lasque.tusdk.core.struct.TuSdkSize mainSize, float ratio, boolean keepRatio)
mainSize
- 主视图长宽ratio
- 区域比例keepRatio
- 保持宽高比例public static android.graphics.Rect fixedRectF(org.lasque.tusdk.core.struct.TuSdkSize mainSize, android.graphics.RectF corpRect)
corpRect
- 选取范围mainSize
- 主容器长宽public static android.graphics.RectF fixedCorpPrecentRect(android.graphics.RectF rect, ImageOrientation orientation)
rect
- 裁剪百分比区域orientation
- 方向public static org.lasque.tusdk.core.struct.TuSdkSize computerOutSize(org.lasque.tusdk.core.struct.TuSdkSize size, float ratio, boolean baseLongSide)
size
- 来源长宽ratio
- 目标比例baseLongSide
- 是否按最大边比例作为缩放标准(false: CENTER_CROP[放大], true: FIT_CENTER[缩小])public static android.graphics.Rect computerOutCenter(android.graphics.Rect rect, float ratio, boolean baseLongSide)
rect
- 选取范围ratio
- 图片宽高比例baseLongSide
- 是否按最大边比例作为缩放标准(false: CENTER_CROP[放大], true: FIT_CENTER[缩小])public static float computerOutScale(android.graphics.Rect rect, float ratio, boolean baseLongSide)
rect
- 选取范围ratio
- 图片宽高比例baseLongSide
- 是否按最大边比例作为缩放标准(false: CENTER_CROP[放大], true: FIT_CENTER[缩小])public static float computeAngle(android.graphics.PointF point, android.graphics.PointF cPoint)
point
- 当前点cPoint
- 中心点public static float getDistanceOfTwoPoints(android.graphics.PointF end, android.graphics.PointF start)
end
- 结束点start
- 开始点public static float getDistanceOfTwoPoints(float x1, float y1, float x2, float y2)
x1
- y1
- x2
- y2
- public static android.graphics.Rect computerMinMaxSideInRegionRatio(org.lasque.tusdk.core.struct.TuSdkSize imageSize, float minMaxSideratio)
imageSize
- 图片长宽minMaxSideratio
- 最小变与最大边比例public static android.graphics.RectF minEnclosingRectangle(android.graphics.PointF cPoint, org.lasque.tusdk.core.struct.TuSdkSize size, float degree)
cPoint
- 中心点坐标size
- 缩放后的大小degree
- 旋转角度public static void mergeEnclosingRectangle(android.graphics.RectF rect, android.graphics.PointF point, float degree)
rect
- 外接矩形坐标point
- 坐标点degree
- 旋转角度public static android.graphics.PointF rotationWithOrigin(android.graphics.PointF point, float degree)
point
- 坐标点degree
- 旋转角度public static android.graphics.Rect rotationWithRotation(android.graphics.Rect rect, org.lasque.tusdk.core.struct.TuSdkSize size, ImageOrientation rotation)
rect
- 输入范围size
- 输入长宽rotation
- 旋转角度public static android.graphics.RectF rotationWithRotation(android.graphics.RectF rect, ImageOrientation rotation)
rect
- 输入范围rotation
- 旋转角度public static android.graphics.RectF getRectInParent(org.lasque.tusdk.core.struct.TuSdkSize parentSize, org.lasque.tusdk.core.struct.TuSdkSize subSize, android.graphics.RectF center)
parentSize
- 父层长宽subSize
- 子层长宽center
- 相对中心位置public static android.graphics.RectF getRectInParent(android.graphics.RectF parentRect, android.graphics.RectF subPercetRect)
parentRect
- 父层位置parentRect
- 子层相对位置public static android.graphics.Rect makeRectWithAspectRatioInsideRect(org.lasque.tusdk.core.struct.TuSdkSize aspectRatio, android.graphics.Rect boundingRect)
aspectRatio
- 输入长宽boundingRect
- 区域范围public static android.graphics.RectF makeRectWithAspectRatioOutsideRect(org.lasque.tusdk.core.struct.TuSdkSize aspectRatio, android.graphics.RectF boundingRect)
aspectRatio
- 输入长宽boundingRect
- 区域范围public static double computerPotintDistance(android.graphics.Point aPoint, android.graphics.Point bPoint)
public static double computerPotintDistance(android.graphics.PointF aPoint, android.graphics.PointF bPoint)
public static float[] textureCoordinates(ImageOrientation rotation, android.graphics.RectF rect)
public static float[] displayCoordinates(ImageOrientation rotation, android.graphics.RectF rect)
public static float[] textureVertices(ImageOrientation rotation, android.graphics.RectF rect)
public static float[] displayVertices(ImageOrientation rotation, android.graphics.RectF rect)