public class WZCropDimensions extends Object
WZCropDimensions
is a convenience class for calculating the scale and position of one rectangle (the source)
when placed inside another (the destination) and applying a scaling modes (WZMediaConfig.RESIZE_TO_ASPECT
or WZMediaConfig.FILL_VIEW
)Constructor and Description |
---|
WZCropDimensions()
The default constructor
|
WZCropDimensions(WZCropDimensions other)
Construct a new instance using the property values from the specified instance
|
WZCropDimensions(WZSize srcSize,
WZSize destSize)
Construct a new instance by specifying the source and destination rectangle sizes
|
WZCropDimensions(WZSize srcSize,
WZSize destSize,
int scaleMode)
Construct a new instance by specifying the source and destination rectangle sizes and scale mode
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
WZPoint |
getCenterPoint()
Returns the center point of the destination rectangle
|
WZSize |
getDestSize()
Returns the dimensions of the destination rectangle
|
WZPoint |
getOffset()
Returns the offset of the bottom left of the source rectangle within the destination
|
WZSize |
getScaledSize()
Returns the dimensions of the source rectangle after the scale mode has been applied
|
int |
getScaleMode()
Returns the scaling mode used for the placement calculation
|
float |
getScaleX()
Returns the scaling factor applied to the width of the source rectangle
|
float |
getScaleY()
Returns the scaling factor applied to the height of the source rectangle
|
WZSize |
getSrcSize()
Returns the dimensions of the source rectangle
|
void |
set(WZCropDimensions other)
Update the property values of this instance with the property values from the specified instance
|
void |
setDestSize(WZSize destSize)
Update the dimensions of the destination rectangle and recalculate
|
void |
setScaleMode(int scaleMode)
Set the scale mode and recalculate
|
void |
setSrcSize(WZSize srcSize)
Update the dimensions of the source rectangle and recalculate
|
String |
toString()
Returns a human-readable description of this instance
|
public WZCropDimensions(WZSize srcSize, WZSize destSize, int scaleMode)
srcSize
- The dimensions of the source rectangledestSize
- The dimensions of the destination rectanglepublic WZCropDimensions(WZCropDimensions other)
other
- The instance to replicatepublic WZCropDimensions()
public void set(WZCropDimensions other)
other
- The instance with the property values to replicatepublic void setSrcSize(WZSize srcSize)
srcSize
- The dimensions of the source rectanglepublic WZSize getSrcSize()
public void setDestSize(WZSize destSize)
destSize
- The dimensions of the destination rectanglepublic WZSize getDestSize()
public void setScaleMode(int scaleMode)
scaleMode
- The scaling mode used for the placement calculation. One of WZMediaConfig.RESIZE_TO_ASPECT
or WZMediaConfig.FILL_VIEW
public int getScaleMode()
WZMediaConfig.RESIZE_TO_ASPECT
or WZMediaConfig.FILL_VIEW
public WZPoint getOffset()
public WZSize getScaledSize()
public float getScaleX()
public float getScaleY()
public WZPoint getCenterPoint()
© 2016 Wowza Media Systems, LLC. All rights reserved. Terms | Privacy | Trademarks | Legal