public class MultiRect
extends android.graphics.RectF
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<MultiRect> |
CREATOR |
Modifier | Constructor and Description |
---|---|
protected |
MultiRect() |
protected |
MultiRect(float left,
float top,
float right,
float bottom) |
protected |
MultiRect(MultiRect r) |
protected |
MultiRect(android.graphics.Rect r) |
protected |
MultiRect(android.graphics.RectF r) |
Modifier and Type | Method and Description |
---|---|
MultiRect |
addMargin(float margin) |
MultiRect |
addMargin(float marginX,
float marginY) |
MultiRect |
addMargin(float marginLeft,
float marginTop,
float marginRight,
float marginBottom) |
double |
calculateAspect() |
static int |
ceilToMultiOf8(int number) |
void |
flipHorizontal() |
void |
flipVertical() |
void |
forcedRecycle() |
static MultiRect |
generateCenteredRect(double imageWidth,
double imageHeight,
double viewWidth,
double viewHeight)
Gets the rectangular position of a Bitmap if it were placed inside a View
with scale type set to
#CENTER_INSIDE . |
static MultiRect |
generateCenteredRect(double imageWidth,
double imageHeight,
MultiRect bounds)
Gets the rectangular position of a Bitmap if it were placed inside a View
with scale type set to
#CENTER_INSIDE . |
static MultiRect |
generateCenteredRect(MultiRect output,
double imageWidth,
double imageHeight,
double viewWidth,
double viewHeight)
Gets the rectangular position of a Bitmap if it were placed inside a View
with scale type set to
#CENTER_INSIDE . |
static MultiRect |
generateCenteredRect(MultiRect output,
double imageWidth,
double imageHeight,
double viewWidth,
double viewHeight,
boolean fitInside)
Gets the rectangular position of a Bitmap if it were placed inside a View
with scale type set to
#CENTER_INSIDE . |
static MultiRect |
generateCenteredRect(MultiRect output,
double imageWidth,
double imageHeight,
MultiRect bounds)
Gets the rectangular position of a Bitmap if it were placed inside a View
with scale type set to
#CENTER_INSIDE . |
double |
getAspect() |
float |
getBottom() |
float[] |
getEdgePos(RectEdge edge) |
MultiRect |
getEdges(float[] shape) |
static float[] |
getEdges(android.graphics.Rect rect) |
static float[] |
getEdges(android.graphics.RectF rect) |
static void |
getEdges(android.graphics.RectF rect,
float[] shape) |
static void |
getEdges(android.graphics.Rect rect,
float[] shape) |
float |
getHeight() |
float |
getLeft() |
android.graphics.Rect |
getOrigenAndSizeRoundend() |
float |
getRight() |
android.graphics.Rect |
getRounded() |
android.graphics.Rect |
getRoundOut() |
float |
getTop() |
float |
getWidth() |
boolean |
hasFixedAspectRation() |
void |
inset(float dx,
float dy) |
boolean |
intersect(float left,
float top,
float right,
float bottom) |
boolean |
intersect(android.graphics.RectF r) |
MultiRect |
iSetCenter(float x,
float y) |
static boolean |
isFinite(float f) |
static MultiRect |
obtain() |
static MultiRect |
obtain(float left,
float top,
float right,
float bottom) |
static MultiRect |
obtain(int left,
int top,
int right,
int bottom) |
static MultiRect |
obtain(MultiRect r) |
static MultiRect |
obtain(android.graphics.Rect r) |
static MultiRect |
obtain(android.graphics.RectF r) |
static MultiRect |
obtainEmpty() |
void |
offset(float dx,
float dy) |
void |
offsetTo(float newLeft,
float newTop) |
static MultiRect |
permanent() |
static MultiRect |
permanent(float left,
float top,
float right,
float bottom) |
static MultiRect |
permanent(MultiRect r) |
static MultiRect |
permanent(android.graphics.Rect r) |
static MultiRect |
permanent(android.graphics.RectF r) |
void |
readFromParcel(android.os.Parcel in) |
void |
recycle() |
static android.graphics.Rect |
rounded(float left,
float top,
float right,
float bottom) |
static android.graphics.Rect |
roundOut(float left,
float top,
float right,
float bottom) |
void |
roundValues() |
MultiRect |
sampleSize(float sample) |
MultiRect |
scaleCentered(float scale) |
MultiRect |
scaleCentered(float scaleX,
float scaleY) |
MultiRect |
scaleSize(float scale) |
MultiRect |
scaleSize(float scaleX,
float scaleY) |
void |
scaleWidth(float width) |
void |
set(float left,
float top,
float right,
float bottom) |
void |
set(MultiRect src) |
void |
set(android.graphics.Rect src) |
void |
set(android.graphics.RectF src) |
void |
setAspect(double aspect) |
MultiRect |
setBottom(float bottom) |
MultiRect |
setCenter(float x,
float y) |
MultiRect |
setEdgeOffsetTo(RectEdge edge,
float[] pos) |
MultiRect |
setEdgeOffsetTo(RectEdge edge,
float x,
float y) |
MultiRect |
setEdgePos(RectEdge edge,
float[] pos) |
MultiRect |
setEdgePos(RectEdge edge,
float x,
float y) |
void |
setEmpty() |
MultiRect |
setFixedAspectRation(java.math.BigDecimal fixedAspectRation) |
MultiRect |
setFixedAspectRation(double fixedAspectRation) |
void |
setHeight(float height) |
boolean |
setIntersect(android.graphics.RectF a,
android.graphics.RectF b) |
MultiRect |
setLeft(float left) |
MultiRect |
setLimits(android.graphics.Rect maxLimits) |
MultiRect |
setLimits(android.graphics.RectF maxLimits) |
MultiRect |
setLimits(android.graphics.RectF maxLimits,
RectEdge fixedEdge) |
MultiRect |
setMinSize(float minSize) |
MultiRect |
setMinSizeUnlimited() |
MultiRect |
setRight(float right) |
void |
setSize(float height,
float width) |
MultiRect |
setTop(float top) |
void |
setWidth(float width) |
void |
sort() |
float[] |
toShape() |
void |
union(float x,
float y) |
void |
union(float left,
float top,
float right,
float bottom) |
void |
union(android.graphics.RectF r) |
public static final android.os.Parcelable.Creator<MultiRect> CREATOR
protected MultiRect()
protected MultiRect(float left, float top, float right, float bottom)
protected MultiRect(MultiRect r)
protected MultiRect(android.graphics.RectF r)
protected MultiRect(android.graphics.Rect r)
public static MultiRect permanent()
public static MultiRect permanent(float left, float top, float right, float bottom)
public static MultiRect permanent(android.graphics.RectF r)
public static MultiRect permanent(android.graphics.Rect r)
public static MultiRect obtainEmpty()
public static MultiRect obtain(int left, int top, int right, int bottom)
public static MultiRect obtain(float left, float top, float right, float bottom)
public static MultiRect obtain(android.graphics.RectF r)
public static MultiRect obtain(android.graphics.Rect r)
public static MultiRect obtain()
public float getHeight()
public float getWidth()
public void forcedRecycle()
public void recycle()
public MultiRect setFixedAspectRation(double fixedAspectRation)
public MultiRect setFixedAspectRation(java.math.BigDecimal fixedAspectRation)
public boolean hasFixedAspectRation()
public double getAspect()
public double calculateAspect()
public static float[] getEdges(android.graphics.Rect rect)
public static float[] getEdges(android.graphics.RectF rect)
public static void getEdges(android.graphics.Rect rect, float[] shape)
public static void getEdges(android.graphics.RectF rect, float[] shape)
public MultiRect getEdges(float[] shape)
public void setHeight(float height)
public void setWidth(float width)
public void setSize(float height, float width)
public static boolean isFinite(float f)
public void scaleWidth(float width)
public void setAspect(double aspect)
public MultiRect iSetCenter(float x, float y)
public MultiRect setCenter(float x, float y)
public void flipVertical()
public void flipHorizontal()
@NonNull public static MultiRect generateCenteredRect(MultiRect output, double imageWidth, double imageHeight, MultiRect bounds)
#CENTER_INSIDE
.imageWidth
- the Bitmap's widthimageHeight
- the Bitmap's heightbounds
- the parent View's bounds@NonNull public static MultiRect generateCenteredRect(double imageWidth, double imageHeight, MultiRect bounds)
#CENTER_INSIDE
.imageWidth
- the Bitmap's widthimageHeight
- the Bitmap's heightbounds
- the parent View's bounds@NonNull public static MultiRect generateCenteredRect(double imageWidth, double imageHeight, double viewWidth, double viewHeight)
#CENTER_INSIDE
.imageWidth
- the Bitmap's widthimageHeight
- the Bitmap's heightviewWidth
- the parent View's widthviewHeight
- the parent View's height@NonNull public static MultiRect generateCenteredRect(MultiRect output, double imageWidth, double imageHeight, double viewWidth, double viewHeight)
#CENTER_INSIDE
.imageWidth
- the Bitmap's widthimageHeight
- the Bitmap's heightviewWidth
- the parent View's widthviewHeight
- the parent View's height@NonNull public static MultiRect generateCenteredRect(MultiRect output, double imageWidth, double imageHeight, double viewWidth, double viewHeight, boolean fitInside)
#CENTER_INSIDE
.imageWidth
- the Bitmap's widthimageHeight
- the Bitmap's heightviewWidth
- the parent View's widthviewHeight
- the parent View's heightpublic float getLeft()
public MultiRect setLeft(float left)
public float getRight()
public MultiRect setRight(float right)
public float getTop()
public MultiRect setTop(float top)
public float getBottom()
public MultiRect setBottom(float bottom)
public MultiRect setLimits(android.graphics.RectF maxLimits)
public MultiRect setMinSizeUnlimited()
public MultiRect setMinSize(float minSize)
public MultiRect setLimits(android.graphics.Rect maxLimits)
public android.graphics.Rect getRounded()
public void roundValues()
public android.graphics.Rect getOrigenAndSizeRoundend()
public static android.graphics.Rect roundOut(float left, float top, float right, float bottom)
public static android.graphics.Rect rounded(float left, float top, float right, float bottom)
public android.graphics.Rect getRoundOut()
public MultiRect sampleSize(float sample)
public MultiRect scaleSize(float scaleX, float scaleY)
public MultiRect scaleSize(float scale)
public MultiRect addMargin(float margin)
public MultiRect addMargin(float marginX, float marginY)
public MultiRect addMargin(float marginLeft, float marginTop, float marginRight, float marginBottom)
public MultiRect scaleCentered(float scale)
public MultiRect scaleCentered(float scaleX, float scaleY)
public float[] getEdgePos(RectEdge edge)
public static int ceilToMultiOf8(int number)
public void inset(float dx, float dy)
inset
in class android.graphics.RectF
public void offset(float dx, float dy)
offset
in class android.graphics.RectF
public void offsetTo(float newLeft, float newTop)
offsetTo
in class android.graphics.RectF
public void readFromParcel(android.os.Parcel in)
readFromParcel
in class android.graphics.RectF
public void union(float left, float top, float right, float bottom)
union
in class android.graphics.RectF
public void union(android.graphics.RectF r)
union
in class android.graphics.RectF
public void union(float x, float y)
union
in class android.graphics.RectF
public boolean setIntersect(android.graphics.RectF a, android.graphics.RectF b)
setIntersect
in class android.graphics.RectF
public void set(float left, float top, float right, float bottom)
set
in class android.graphics.RectF
public void set(MultiRect src)
public void set(android.graphics.RectF src)
set
in class android.graphics.RectF
public void set(android.graphics.Rect src)
set
in class android.graphics.RectF
public void setEmpty()
setEmpty
in class android.graphics.RectF
public boolean intersect(android.graphics.RectF r)
intersect
in class android.graphics.RectF
public boolean intersect(float left, float top, float right, float bottom)
intersect
in class android.graphics.RectF
public float[] toShape()
public void sort()
sort
in class android.graphics.RectF