类android.graphics.Camera源码实例Demo

下面列出了怎么用android.graphics.Camera的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: styT   文件: RotationDrawStrategy.java
/**
 * 根据角度绘制图标的类
 * @param canvas 画布
 * @param fraction 完成时间百分比
 * @param icon 图标
 * @param width view宽度
 * @param height view高度
 */
private void drawIconOne(Canvas canvas, float fraction, Bitmap icon, int width, int height) {
    Camera camera = new Camera();
    Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
    canvas.save();
    int centerX = width / 2;
    int centerY = height / 2 - 200;
    int x = centerX - icon.getWidth()/2;
    int y = centerY - icon.getHeight()/2;
    Matrix matrix = new Matrix();
    matrix.postScale(1.7f, 1.7f, centerX, centerY);
    canvas.concat(matrix);
    canvas.clipRect(x, y, x + icon.getWidth() * fraction * 0.5f, y + icon.getHeight() * fraction * 0.5f);
    canvas.translate(centerX, centerY);
    camera.save();
    camera.rotateX(180);
    camera.rotateY(-180);
    camera.applyToCanvas(canvas);
    camera.restore();
    canvas.translate(-centerX, -centerY);
    canvas.drawBitmap(icon, x, y, paint);
    canvas.restore();
}
 
源代码2 项目: appcan-android   文件: EBrowserAnimation.java
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
    final float fromDegrees = m_fromDegree;
    float degrees = fromDegrees + ((m_toDegree - fromDegrees) * interpolatedTime);
    final float centerX = m_centerX;
    final float centerY = m_centerY;
    final Camera camera = m_camera;
    final Matrix matrix = t.getMatrix();
    camera.save();
    if (m_reverse) {
        camera.translate(0.0f, 0.0f, m_depthZ * interpolatedTime);
    } else {
        camera.translate(0.0f, 0.0f, m_depthZ * (1.0f - interpolatedTime));
    }
    camera.rotateY(degrees);
    camera.getMatrix(matrix);
    camera.restore();
    matrix.preTranslate(-centerX, -centerY);
    matrix.postTranslate(centerX, centerY);
}
 
源代码3 项目: WanAndroid   文件: RotateView.java
public RotateView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.RotateView);
    BitmapDrawable bitmapDrawable = (BitmapDrawable) array.getDrawable(R.styleable.RotateView_viewBackgound2);
    array.recycle();

    if (bitmapDrawable != null) {

        bitmap = bitmapDrawable.getBitmap();
        byte[] bytes = BitmapUtil.bitmap2Bytes(bitmap);
        bitmap = BitmapUtil.resizeBitmapBytes(bytes);
    }else {
        bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
    }

    camera = new Camera();
    paint = new Paint(Paint.ANTI_ALIAS_FLAG);
    DisplayMetrics metrics = getResources().getDisplayMetrics();
    float newZ = -metrics.density * 6;
    camera.setLocation(0, 0, newZ);
}
 
源代码4 项目: WheelPicker   文件: WheelView.java
/**
 * 初始化并设置默认值
 *
 * @param context 上下文
 */
private void initValue(Context context) {
    ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
    mMaxFlingVelocity = viewConfiguration.getScaledMaximumFlingVelocity();
    mMinFlingVelocity = viewConfiguration.getScaledMinimumFlingVelocity();
    mScroller = new Scroller(context);
    mDrawRect = new Rect();
    mCamera = new Camera();
    mMatrix = new Matrix();
    if (!isInEditMode()) {
        mSoundHelper = SoundHelper.obtain();
        initDefaultVolume(context);
    }
    calculateTextSize();
    updateTextAlign();
}
 
源代码5 项目: RecyclerWheelPicker   文件: RecyclerWheelPicker.java
private void init(Context context) {
    initSound();

    setOverScrollMode(OVER_SCROLL_NEVER);
    setHasFixedSize(true);

    mDecorationPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mUnitTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
    mDecorationRect = new Rect();
    mDecoration = new DefaultDecoration();

    mAdapter = new WheelAdapter(context);
    super.setAdapter(mAdapter);
    mLayoutManager = new WheelPickerLayoutManager(this);
    super.setLayoutManager(mLayoutManager);
    new LinearSnapHelper().attachToRecyclerView(this);

    mCamera = new Camera();
    mMatrix = new Matrix();
}
 
源代码6 项目: SphereLayout   文件: SphereLayout.java
public SphereLayout(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SphereLayout);
    mRadius = a.getDimensionPixelSize(R.styleable.SphereLayout_radius, 0);//球体半径
    mOrientation = a.getInt(R.styleable.SphereLayout_snapOrientation, HORIZONTAL);//标记位于背面的视图是以Y轴水平翻转到达正面 或是以X轴竖直翻转可到达正面
    mHideBack = a.getBoolean(R.styleable.SphereLayout_hideBack, false);//是否隐藏处在背面的布局
    a.recycle();
    mCenter = new Point();
    mCamera = new Camera();
    mDependencyOffset = new int[2];
    //mCamera.setLocation(0, 0, -20);
    mMatrix = new Matrix();
    mPositiveChildren = new ArrayList<>();//depth为正的childview集合
    mNegativeChildren = new ArrayList<>();//depth为负的childview集合
    mDensity = getResources().getDisplayMetrics().density;
}
 
源代码7 项目: FancyView   文件: RotationDrawStrategy.java
/**
 * 根据角度绘制图标的类
 * @param canvas 画布
 * @param fraction 完成时间百分比
 * @param icon 图标
 * @param width view宽度
 * @param height view高度
 */
private void drawIconOne(Canvas canvas, float fraction, Bitmap icon, int width, int height) {
    Camera camera = new Camera();
    Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
    canvas.save();
    int centerX = width / 2;
    int centerY = height / 2 - 200;
    int x = centerX - icon.getWidth()/2;
    int y = centerY - icon.getHeight()/2;
    Matrix matrix = new Matrix();
    matrix.postScale(1.7f, 1.7f, centerX, centerY);
    canvas.concat(matrix);
    canvas.clipRect(x, y, x + icon.getWidth() * fraction * 0.5f, y + icon.getHeight() * fraction * 0.5f);
    canvas.translate(centerX, centerY);
    camera.save();
    camera.rotateX(180);
    camera.rotateY(-180);
    camera.applyToCanvas(canvas);
    camera.restore();
    canvas.translate(-centerX, -centerY);
    canvas.drawBitmap(icon, x, y, paint);
    canvas.restore();
}
 
源代码8 项目: FragmentRigger   文件: Rotate3dAnimation.java
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
  final float fromDegrees = mFromDegrees;
  float degrees = fromDegrees + ((mToDegrees - fromDegrees) * interpolatedTime);

  final float centerX = mCenterX;
  final float centerY = mCenterY;
  final Camera camera = mCamera;
  final Matrix matrix = t.getMatrix();
  camera.save();
  if (mReverse) {
    camera.translate(0.0f, 0.0f, mDepthZ * interpolatedTime);
  } else {
    camera.translate(0.0f, 0.0f, mDepthZ * (1.0f - interpolatedTime));
  }
  camera.rotateY(degrees);
  camera.getMatrix(matrix);
  camera.restore();

  matrix.preTranslate(-centerX, -centerY);
  matrix.postTranslate(centerX, centerY);
}
 
源代码9 项目: FragmentRigger   文件: Rotate3d.java
@Override
  protected void applyTransformation(float interpolatedTime, Transformation t) {
    Camera camera = new Camera();
    camera.save();

    // 设置camera动作为绕Y轴旋转
    // 总共旋转180度,因此计算在每个补间时间点interpolatedTime的角度即为两着相乘
//    camera.rotateX(deg * interpolatedTime);
    camera.rotateY(180 * interpolatedTime);
//    camera.rotateZ(180 * interpolatedTime);
//
    // 根据camera动作产生一个matrix,赋给Transformation的matrix,以用来设置动画效果
    Matrix matrix = t.getMatrix();
    camera.getMatrix(matrix);

    camera.restore();
    //经过以下平移,才能以view的中心点进行翻转
    matrix.preTranslate(-view.getWidth() / 2, -view.getHeight() / 2);
    matrix.postTranslate(view.getWidth() / 2, view.getHeight() / 2);
  }
 
源代码10 项目: android-tv-launcher   文件: Rotate3dAnimation.java
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
    final float fromDegrees = mFromDegrees;
    float degrees = fromDegrees + ((mToDegrees - fromDegrees) * interpolatedTime);

    final float centerX = mCenterX;
    final float centerY = mCenterY;
    final Camera camera = mCamera;

    final Matrix matrix = t.getMatrix();

    camera.save();
    if (mReverse) {
        camera.translate(0.0f, 0.0f, mDepthZ * interpolatedTime);
    } else {
        camera.translate(0.0f, 0.0f, mDepthZ * (1.0f - interpolatedTime));
    }
    camera.rotateY(degrees);
    camera.getMatrix(matrix);
    camera.restore();

    matrix.preTranslate(-centerX, -centerY);
    matrix.postTranslate(centerX, centerY);
}
 
源代码11 项目: BookLoadingView   文件: Rotate3dAnimation.java
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
    final float fromDegrees = mFromDegrees;
    float degrees = fromDegrees + ((mToDegrees - fromDegrees) * interpolatedTime);

    final float centerX = mCenterX;
    final float centerY = mCenterY;
    final Camera camera = mCamera;

    final Matrix matrix = t.getMatrix();

    camera.save();
    if (mReverse) {
        camera.translate(0.0f, 0.0f, mDepthZ * interpolatedTime);
    } else {
        camera.translate(0.0f, 0.0f, mDepthZ * (1.0f - interpolatedTime));
    }
    camera.rotateY(degrees);
    camera.getMatrix(matrix);
    camera.restore();

    matrix.preTranslate(-centerX, -centerY);
    matrix.postTranslate(centerX, centerY);
}
 
源代码12 项目: Jreader   文件: Rotate3DAnimation.java
/**
 * 执行顺序 matrix.preTranslate() -->  camera.rotateY(degrees) -->   matrix.postTranslate() -->   matrix.postScale()
 * @param interpolatedTime
 * @param t
 */
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
    float degrees = mReverse ? mToDegrees + (mFromDegrees - mToDegrees) * interpolatedTime : mFromDegrees + (mToDegrees - mFromDegrees) * interpolatedTime;
    final Matrix matrix = t.getMatrix();

    final Camera camera = mCamera;

    camera.save();

    camera.rotateY(degrees);

    camera.getMatrix(matrix);
    camera.restore();

          //  matrix.preTranslate(-mPivotXValue, 0);      //在进行rotateY之前需要移动物体,让物体左边与Y轴对齐
          //  matrix.postTranslate(mPivotXValue, 0);      //还原物体位置

    if (mReverse) {
        matrix.postScale(1 + (scaleTimes - 1) * (1.0f - interpolatedTime), 1 + (scaleTimes - 1) * (1.0f - interpolatedTime), mPivotX - mPivotXValue , mPivotY - mPivotYValue);
    } else {
       // matrix.postScale(1 + (scaleTimes - 1) * interpolatedTime, 1 + (scaleTimes - 1) * interpolatedTime, mPivotX, mPivotY);
        matrix.postScale(1 + (scaleTimes - 1) * interpolatedTime, 1 + (scaleTimes - 1) * interpolatedTime, mPivotX - mPivotXValue , mPivotY - mPivotYValue );
    }
}
 
源代码13 项目: NewXmPluginSDK   文件: AutoTextView.java
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
    final float fromDegrees = mFromDegrees;
    float degrees = fromDegrees + ((mToDegrees - fromDegrees) * interpolatedTime);

    final float centerX = mCenterX;
    final float centerY = mCenterY;
    final Camera camera = mCamera;
    final int derection = mTurnUp ? 1 : -1;

    final Matrix matrix = t.getMatrix();

    camera.save();
    if (mTurnIn) {
        camera.translate(0.0f, derection * mCenterY * (interpolatedTime - 1.0f), 0.0f);
    } else {
        camera.translate(0.0f, derection * mCenterY * (interpolatedTime), 0.0f);
    }
    camera.rotateX(degrees);
    camera.getMatrix(matrix);
    camera.restore();

    matrix.preTranslate(-centerX, -centerY);
    matrix.postTranslate(centerX, centerY);
}
 
源代码14 项目: codeexamples-android   文件: Rotate3dAnimation.java
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
    final float fromDegrees = mFromDegrees;
    float degrees = fromDegrees + ((mToDegrees - fromDegrees) * interpolatedTime);

    final float centerX = mCenterX;
    final float centerY = mCenterY;
    final Camera camera = mCamera;

    final Matrix matrix = t.getMatrix();

    camera.save();
    if (mReverse) {
        camera.translate(0.0f, 0.0f, mDepthZ * interpolatedTime);
    } else {
        camera.translate(0.0f, 0.0f, mDepthZ * (1.0f - interpolatedTime));
    }
    camera.rotateY(degrees);
    camera.getMatrix(matrix);
    camera.restore();

    matrix.preTranslate(-centerX, -centerY);
    matrix.postTranslate(centerX, centerY);
}
 
源代码15 项目: AndroidTVWidget   文件: Rotate3dAnimation.java
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
    final float fromDegrees = mFromDegrees;
    float degrees = fromDegrees + ((mToDegrees - fromDegrees) * interpolatedTime);

    final float centerX = mCenterX;
    final float centerY = mCenterY;
    final Camera camera = mCamera;

    final Matrix matrix = t.getMatrix();

    camera.save();
    if (mReverse) {
        camera.translate(0.0f, 0.0f, mDepthZ * interpolatedTime);
    } else {
        camera.translate(0.0f, 0.0f, mDepthZ * (1.0f - interpolatedTime));
    }
    camera.rotateY(degrees);
    camera.getMatrix(matrix);
    camera.restore();

    matrix.preTranslate(-centerX, -centerY);
    matrix.postTranslate(centerX, centerY);
}
 
源代码16 项目: Android-tv-widget   文件: Rotate3dAnimation.java
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
    final float fromDegrees = mFromDegrees;
    float degrees = fromDegrees + ((mToDegrees - fromDegrees) * interpolatedTime);

    final float centerX = mCenterX;
    final float centerY = mCenterY;
    final Camera camera = mCamera;

    final Matrix matrix = t.getMatrix();

    camera.save();
    if (mReverse) {
        camera.translate(0.0f, 0.0f, mDepthZ * interpolatedTime);
    } else {
        camera.translate(0.0f, 0.0f, mDepthZ * (1.0f - interpolatedTime));
    }
    camera.rotateY(degrees);
    camera.getMatrix(matrix);
    camera.restore();

    matrix.preTranslate(-centerX, -centerY);
    matrix.postTranslate(centerX, centerY);
}
 
源代码17 项目: pe-protector-moe   文件: Rotate3dAnimation.java
@Override
public void initialize(int width, int height, int parentWidth, int parentHeight) {
    super.initialize(width, height, parentWidth, parentHeight);
    mCamera = new Camera();
    mPivotX = resolveSize(mPivotXType, mPivotXValue, width, parentWidth);
    mPivotY = resolveSize(mPivotYType, mPivotYValue, height, parentHeight);
}
 
源代码18 项目: KAlertDialog   文件: Rotate3dAnimation.java
@Override
public void initialize(int width, int height, int parentWidth, int parentHeight) {
    super.initialize(width, height, parentWidth, parentHeight);
    camera = new Camera();
    pivotX = resolveSize(mPivotXType, mPivotXValue, width, parentWidth);
    pivotY = resolveSize(mPivotYType, mPivotYValue, height, parentHeight);
}
 
源代码19 项目: Auie   文件: UEAnimatorProxy.java
private void transformMatrix(Matrix m, View view) {
    final float w = view.getWidth();
    final float h = view.getHeight();
    final boolean hasPivot = mHasPivot;
    final float pX = hasPivot ? mPivotX : w / 2f;
    final float pY = hasPivot ? mPivotY : h / 2f;

    final float rX = mRotationX;
    final float rY = mRotationY;
    final float rZ = mRotationZ;
    if ((rX != 0) || (rY != 0) || (rZ != 0)) {
        final Camera camera = mCamera;
        camera.save();
        camera.rotateX(rX);
        camera.rotateY(rY);
        camera.rotateZ(-rZ);
        camera.getMatrix(m);
        camera.restore();
        m.preTranslate(-pX, -pY);
        m.postTranslate(pX, pY);
    }

    final float sX = mScaleX;
    final float sY = mScaleY;
    if ((sX != 1.0f) || (sY != 1.0f)) {
        m.postScale(sX, sY);
        final float sPX = -(pX / w) * ((sX * w) - w);
        final float sPY = -(pY / h) * ((sY * h) - h);
        m.postTranslate(sPX, sPY);
    }

    m.postTranslate(mTranslationX, mTranslationY);
}
 
源代码20 项目: youqu_master   文件: RotationDrawStrategy.java
/**
 * 根据角度绘制图标的类
 * @param canvas 画布
 * @param degree 角度
 * @param icon 图标
 * @param width view宽度
 * @param height view高度
 */
private void drawIconThree(Canvas canvas, int degree, Bitmap icon, int width, int height) {
    Camera camera = new Camera();
    Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
    int centerX = width / 2;
    int centerY = height / 2 - 200;
    int x = centerX - icon.getWidth()/2;
    int y = centerY - icon.getHeight()/2;
    Matrix matrix = new Matrix();
    matrix.postScale(1.7f, 1.7f, centerX, centerY);
    //绘制上半部分
    canvas.save();
    canvas.concat(matrix);
    canvas.clipRect(x, y, x + icon.getWidth(), y + icon.getHeight() / 2);
    canvas.drawBitmap(icon, x, y, paint);
    canvas.restore();

    //绘制下半部分
    canvas.save();
    canvas.concat(matrix);
    if (degree <= 90)
        canvas.clipRect(x, y, x + icon.getWidth(), y + icon.getHeight() / 2);
    else
        canvas.clipRect(x, y + icon.getHeight() / 2, x + icon.getWidth(), y + icon.getHeight());
    canvas.translate(centerX, centerY);
    camera.save();
    camera.rotateX(180 - degree);
    camera.applyToCanvas(canvas);
    camera.restore();
    canvas.translate(-centerX, -centerY);
    canvas.drawBitmap(icon, x, y, paint);
    canvas.restore();
}
 
源代码21 项目: imsdk-android   文件: AnimatorProxy.java
private void transformMatrix(Matrix m, View view) {
    final float w = view.getWidth();
    final float h = view.getHeight();
    final boolean hasPivot = mHasPivot;
    final float pX = hasPivot ? mPivotX : w / 2f;
    final float pY = hasPivot ? mPivotY : h / 2f;

    final float rX = mRotationX;
    final float rY = mRotationY;
    final float rZ = mRotationZ;
    if ((rX != 0) || (rY != 0) || (rZ != 0)) {
        final Camera camera = mCamera;
        camera.save();
        camera.rotateX(rX);
        camera.rotateY(rY);
        camera.rotateZ(-rZ);
        camera.getMatrix(m);
        camera.restore();
        m.preTranslate(-pX, -pY);
        m.postTranslate(pX, pY);
    }

    final float sX = mScaleX;
    final float sY = mScaleY;
    if ((sX != 1.0f) || (sY != 1.0f)) {
        m.postScale(sX, sY);
        final float sPX = -(pX / w) * ((sX * w) - w);
        final float sPY = -(pY / h) * ((sY * h) - h);
        m.postTranslate(sPX, sPY);
    }

    m.postTranslate(mTranslationX, mTranslationY);
}
 
源代码22 项目: timecat   文件: AnimatorProxy.java
private void transformMatrix(Matrix m, View view) {
    final float w = view.getWidth();
    final float h = view.getHeight();
    final boolean hasPivot = mHasPivot;
    final float pX = hasPivot ? mPivotX : w / 2f;
    final float pY = hasPivot ? mPivotY : h / 2f;

    final float rX = mRotationX;
    final float rY = mRotationY;
    final float rZ = mRotationZ;
    if ((rX != 0) || (rY != 0) || (rZ != 0)) {
        final Camera camera = mCamera;
        camera.save();
        camera.rotateX(rX);
        camera.rotateY(rY);
        camera.rotateZ(-rZ);
        camera.getMatrix(m);
        camera.restore();
        m.preTranslate(-pX, -pY);
        m.postTranslate(pX, pY);
    }

    final float sX = mScaleX;
    final float sY = mScaleY;
    if ((sX != 1.0f) || (sY != 1.0f)) {
        m.postScale(sX, sY);
        final float sPX = -(pX / w) * ((sX * w) - w);
        final float sPY = -(pY / h) * ((sY * h) - h);
        m.postTranslate(sPX, sPY);
    }

    m.postTranslate(mTranslationX, mTranslationY);
}
 
源代码23 项目: Plumble   文件: FlipDrawable.java
public FlipDrawable(Drawable from, Drawable to) {
    super(new Drawable[] { from, to });
    mFrom = from;
    mTo = to;
    mCamera = new Camera();
    mRotate = 0;
}
 
源代码24 项目: Cinema-App-Concept   文件: Rotate3dAnimation.java
@Override
public void initialize(int width, int height, int parentWidth, int parentHeight) {
    super.initialize(width, height, parentWidth, parentHeight);
    this.width = width /4;
    this.height = height /4;
    camera = new Camera();
}
 
源代码25 项目: CrazyDaily   文件: CubeReversalView.java
@Override
public void initialize(int width, int height, int parentWidth, int parentHeight) {
    super.initialize(width, height, parentWidth, parentHeight);
    mCamera = new Camera();
    mMatrix = new Matrix();
    mWidth = width;
    mHeight = height;
}
 
源代码26 项目: CrazyDaily   文件: CubeReversalView.java
@Override
public void initialize(int width, int height, int parentWidth, int parentHeight) {
    super.initialize(width, height, parentWidth, parentHeight);
    mCamera = new Camera();
    mMatrix = new Matrix();
    mWidth = width;
    mHeight = height;
}
 
源代码27 项目: CrazyDaily   文件: CubeReversalView.java
@Override
public void initialize(int width, int height, int parentWidth, int parentHeight) {
    super.initialize(width, height, parentWidth, parentHeight);
    mCamera = new Camera();
    mMatrix = new Matrix();
    mWidth = width;
    mHeight = height;
}
 
源代码28 项目: FakeWeather   文件: HazeType.java
public HazeType(Context context) {
    super(context);
    setColor(0xFF7F8195);
    mPathFront = new Path();
    mPathRear = new Path();
    mPaint = new Paint();
    mMatrix = new Matrix();
    camera = new Camera();
    mBitmap = decodeResource(mBitmap, R.drawable.ic_haze_ground);
}
 
源代码29 项目: FakeWeather   文件: SandstormType.java
public SandstormType(Context context) {
    super(context);
    setColor(0xFFE99E3C);
    mPathFront = new Path();
    mPathRear = new Path();
    mPaint = new Paint();
    mMatrix = new Matrix();
    camera = new Camera();
    mBitmap = decodeResource(mBitmap, R.drawable.ic_sanstorm_ground);
}
 
源代码30 项目: Mover   文件: AnimatorProxy.java
private void transformMatrix(Matrix m, View view) {
    final float w = view.getWidth();
    final float h = view.getHeight();
    final boolean hasPivot = mHasPivot;
    final float pX = hasPivot ? mPivotX : w / 2f;
    final float pY = hasPivot ? mPivotY : h / 2f;

    final float rX = mRotationX;
    final float rY = mRotationY;
    final float rZ = mRotationZ;
    if ((rX != 0) || (rY != 0) || (rZ != 0)) {
        final Camera camera = mCamera;
        camera.save();
        camera.rotateX(rX);
        camera.rotateY(rY);
        camera.rotateZ(-rZ);
        camera.getMatrix(m);
        camera.restore();
        m.preTranslate(-pX, -pY);
        m.postTranslate(pX, pY);
    }

    final float sX = mScaleX;
    final float sY = mScaleY;
    if ((sX != 1.0f) || (sY != 1.0f)) {
        m.postScale(sX, sY);
        final float sPX = -(pX / w) * ((sX * w) - w);
        final float sPY = -(pY / h) * ((sY * h) - h);
        m.postTranslate(sPX, sPY);
    }

    m.postTranslate(mTranslationX, mTranslationY);
}
 
 类所在包
 同包方法