public void setTransform(TransMatrix kTransform) { if (kTransform.getDim() == 3) { m_kImageTransform.MakeIdentity(); m_kImageTransform.M00 = kTransform.M00; m_kImageTransform.M01 = kTransform.M01; m_kImageTransform.M02 = 0; m_kImageTransform.M03 = kTransform.M02; m_kImageTransform.M10 = kTransform.M10; m_kImageTransform.M11 = kTransform.M11; m_kImageTransform.M12 = 0; m_kImageTransform.M13 = kTransform.M12; } else { m_kImageTransform.Copy(kTransform); } if (m_kImageEffectDual != null) { /* Matrix4f toOrigin = new Matrix4f(false); Matrix4f fromOrigin = new Matrix4f(false); toOrigin.M03 = -m_kImageA.extents[0]/2.0f; toOrigin.M13 = -m_kImageA.extents[1]/2.0f; fromOrigin.M03 = m_kImageA.extents[0]/2.0f; fromOrigin.M13 = m_kImageA.extents[1]/2.0f; TransMatrix kMat = new TransMatrix(4,4); kMat.setTransform(0,0,0,0,0,15,1,1,1,0,0,0); m_kImageTransform.Copy(kMat); System.err.println( "captureImage" + m_iScreenCaptureCounter + " " + m_kImageTransform.ToString() ); m_kImageTransform.MakeIdentity(); m_kImageTransform.M00 = 0.9666009f; m_kImageTransform.M01 = -0.25924882f; m_kImageTransform.M02 = 0f; m_kImageTransform.M03 = 74.82431f; m_kImageTransform.M10 = 0.25845572f; m_kImageTransform.M11 = 0.9654881f; m_kImageTransform.M12 = 0f; m_kImageTransform.M13 = -57.23043f; System.err.println( m_kImageTransform.ToString() ); m_kImageTransform.Inverse(); System.err.println( m_kImageTransform.ToString() ); m_kImageTransform.MakeIdentity(); m_kImageTransform.M00 = 0.9652507f; m_kImageTransform.M01 = 0.25918508f; m_kImageTransform.M02 = 0f; m_kImageTransform.M03 = -56.043213f; m_kImageTransform.M10 = -0.25839218f; m_kImageTransform.M11 = 0.96636325f; m_kImageTransform.M12 = 0f; m_kImageTransform.M13 = 72.88661f; */ // m_kImageTransform.MultLeft( m_kToOriginInv ); // m_kImageTransform.Mult( m_kFromOriginInv ); // System.err.println( "setTransform " + m_kImageTransform.ToString() ); // m_kImageTransform.Inverse(); // m_kImageTransform.MultLeft( m_kToOrigin ); // m_kImageTransform.Mult( m_kFromOrigin ); // m_kImageTransform.MultLeft(fromOrigin); // m_kImageTransform.Mult(toOrigin); m_kImageEffectDual.SetTransform(m_kImageTransform); // System.err.println( m_kImageTransform.ToString() ); } }
public void setFromOrigin(TransMatrix kFromOrigin) { m_kFromOrigin = convertTo4D(kFromOrigin); m_kFromOriginInv.Inverse(m_kFromOrigin); }
public void setToOrigin(TransMatrix kToOrigin) { m_kToOrigin = convertTo4D(kToOrigin); m_kToOriginInv.Inverse(m_kToOrigin); }
public Matrix4f convertTo4D(Matrix4f kTransform) { if (m_kImageA.nDims == 2) { Matrix4f kMat = new Matrix4f(false); kMat.M00 = kTransform.M00; kMat.M01 = kTransform.M01; kMat.M02 = 0; kMat.M03 = kTransform.M02; kMat.M10 = kTransform.M10; kMat.M11 = kTransform.M11; kMat.M12 = 0; kMat.M13 = kTransform.M12; kMat.Transpose(); return kMat; } kTransform.Transpose(); return kTransform; }