package epson.colorcorrection;

import org.opencv.core.Core;
import org.opencv.core.Mat;

public class SDIC_MAT_PTR {
    private Mat mMat;

    SDIC_MAT_PTR() {
        mMat = null;
        mMat = new Mat();
    }

    SDIC_MAT_PTR(Mat mat) {
        mMat = null;
        setMat(mat);
    }

    public Mat getMat() {
        return mMat;
    }

    public void setMat(Mat mat) {
        mMat = mat;
    }

    public void rotateMat(float f) {
        Mat mat = mMat;
        if (mat == null) {
            return;
        }
        if (f == 90.0f) {
            Core.transpose(mat, mat);
            Mat mat2 = mMat;
            Core.flip(mat2, mat2, 1);
            return;
        }
        double d = (double) f;
        if (d == 180.0d) {
            Core.flip(mat, mat, -1);
        } else if (d == 270.0d) {
            Core.transpose(mat, mat);
            Mat mat3 = mMat;
            Core.flip(mat3, mat3, 0);
        }
    }

    public void releaseMat() {
        Mat mat = mMat;
        if (mat != null) {
            mat.release();
            mMat = null;
        }
    }
}
