void updateParams(SynthesizeParameters parms) { // TODO: check parameters compatibility if (m_Params.getFlags() != parms.getFlags()) { throw new Exception("SynthesisQuery::update - new parameters are not compatible with previous!"); } m_Params = parms; }
public List <int> update(SynthesizeParameters parms) { updateParams(parms); int wsize = m_Params.mControlPacket.m_Windows.requested(0).width(); int hsize = m_Params.mControlPacket.m_Windows.requested(0).height(); List <int> regen = m_Params.mControlPacket.m_Windows.update(Window.LTWH((int)parms.mControlPacket.WindowMinX, (int)parms.mControlPacket.WindowMinY, wsize, hsize)); return(regen); }
public bool equalTo(SynthesizeParameters parms) { bool same = true; same &= getConstraintThreshold() == parms.getConstraintThreshold(); same &= getCoherenceThreshold() == parms.getCoherenceThreshold(); same &= getCutAvoidance() == parms.getCutAvoidance(); same &= getFlags() == parms.getFlags(); return(same); }
public void refreshBuffer() { if (mExemplar == null || (m_bNeedUpdate == false && m_bNeedUpdateJacobianMap == false)) { return; } Matrix projMat = BRenderDevice.getDevice().Transform.Projection; if (m_bNeedUpdateJacobianMap) { updateJacobianMap(); } int num_upd_lvls = 0; for (int i = 0; i < mSynthNodes.Count; i++) { if (m_bNeedUpdateJacobianMap) { mSynthNodes[i].mSynthControlPacket.updateJacobianPyramid(mJacobianMap, mJacobianMapInverse); } // . parameters SynthesizeParameters parameters = new SynthesizeParameters(mExemplar, mSynthNodes[i].mSynthControlPacket, mSynthNodes[i].mSynthResultPacket, m_SynthFlags); // . call synthesizer if (mSynthNodes[i].m_Query == null) { mSynthNodes[i].m_Query = mSynthesiser.synthesize(parameters); num_upd_lvls = Globals.cNumLevels;// mAnalyser.nbLevels(); } else { num_upd_lvls = mSynthesiser.synthesize(mSynthNodes[i].m_Query, parameters, m_bUpdateAllForce || m_bNeedUpdate || m_bNeedUpdateJacobianMap); } } m_iSynthLevelStart = num_upd_lvls; BRenderDevice.getDevice().Transform.Projection = projMat; // for debug // m_d3dRawDataBuffer = mSynthNodes[i].m_Query.m_WorkBuffer.front().texture(); // show work buffer m_bNeedUpdate = false; m_bNeedRefresh = true; m_bNeedUpdateJacobianMap = false; }
public SynthesisQuery(Synthesiser synth, SynthesizeParameters parms) { m_Synthesizer = (synth); m_iLevel = (-1); m_Params = (parms); //m_Params.mControlPacket.updateSynthWindow(); // allocate buffers allocateBuffers(); // set current level to start synthesis at coarsest m_iLevel = Globals.cNumLevels; }
public void reinit(SynthesizeParameters parms) { //we're the same packet, don't recreate everything. if (!parms.equalTo(m_Params)) { int wsize = m_Params.mControlPacket.m_Windows.requested(0).width(); int hsize = m_Params.mControlPacket.m_Windows.requested(0).height(); updateParams(parms); // compute windows m_Params.mControlPacket.setWindowValues((int)parms.mControlPacket.WindowMinX, (int)parms.mControlPacket.WindowMinY, wsize, hsize); } // set current level to start synthesis at coarsest m_iLevel = Globals.cNumLevels;// m_Synthesizer.getAnalyser().nbLevels(); }