class MatrixValues(matrix: Matrix) {val scaleX: Floatval scaleY: Floatval transX: Floatval transY: Floatval skewX : Float val skewY : Floatinit {val fromValues = FloatArray(9)matrix.getValues(fromValues)scaleX = fromValues[Matrix.MSCALE_X]scaleY = fromValues[Matrix.MSCALE_Y]transX = fromValues[Matrix.MTRANS_X]transY = fromValues[Matrix.MTRANS_Y]skewX = fromValues[Matrix.MSKEW_X]skewY = fromValues[Matrix.MSKEW_Y]}fun isEquals(values: MatrixValues): Boolean {return isFloatEquals(scaleX,values.scaleX)&& isFloatEquals(scaleY,values.scaleY)&& isFloatEquals(transX,values.transX)&& isFloatEquals(transY,values.transY)&& isFloatEquals(skewX,values.skewX)&& isFloatEquals(skewY,values.skewY)}private fun isFloatEquals(a: Float, b: Float): Boolean {return Math.abs(a - b) <= 0.001f}
}