void BbVideoWindowControl::setHue(int hue) { if (m_hue != hue) { m_hue = hue; updateHue(); emit hueChanged(m_hue); } }
void BbVideoWindowControl::attachDisplay(mmr_context_t *context) { if (m_videoId != -1) { qDebug() << "BbVideoWindowControl: Video output already attached!"; return; } if (!context) { qDebug() << "BbVideoWindowControl: No media player context!"; return; } if (!m_widget) { qDebug() << "BbVideoWindowControl: No video widget!"; return; } QPlatformNativeInterface * const nativeInterface = QApplication::platformNativeInterface(); if (!nativeInterface) { qDebug() << "BbVideoWindowControl: Unable to get platform native interface. Qt too old?"; return; } const char * const groupNameData = static_cast<const char *>( nativeInterface->nativeResourceForWidget("windowGroup", m_widget)); if (!groupNameData) { qDebug() << "BbVideoWindowControl: Unable to find window group for widget" << m_widget; return; } const QString groupName = QString::fromAscii(groupNameData); m_windowName = QString("BbVideoWindowControl_%1_%2").arg(winIdCounter++) .arg(QCoreApplication::applicationPid()); // Start with an invisible window. If it would be visible right away, it would be at the wrong // position, and we can only change the position once we get the window handle. const QString videoDeviceUrl = QString("screen:?winid=%1&wingrp=%2&initflags=invisible&nodstviewport=1").arg(m_windowName).arg(groupName); m_videoId = mmr_output_attach(context, videoDeviceUrl.toAscii(), "video"); if (m_videoId == -1) { qDebug() << mmErrorMessage("mmr_output_attach() for video failed", context); return; } m_context = context; updateVideoPosition(); updateHue(); updateContrast(); updateBrightness(); updateSaturation(); }
void CColorMatrixFrame::Notify(TNotifyUI& msg) { if(msg.sType == _T("valuechanged")) { CSliderUI* slider = dynamic_cast<CSliderUI*>(msg.pSender); float value = slider->GetValue(); float max = slider->GetMaxValue(); if(slider->GetName() == _T("Hue")) updateHue(value/max*2.0 - 1.0); else if(slider->GetName() == _T("Sat")) updateSat(value/max*2.0 - 1.0); else if(slider->GetName() == _T("Val")) updateBri(value/max*2.0 - 1.0); printf("value/max:%d/%d\n",slider->GetValue(),slider->GetMaxValue() ); } };
void StrokeProcessState::updateState(ParamBox input) { this->prevParam = curParam; this->curParam = input; //Compare the difference between curParam and prevParam, then update according to the changes if (this->StrokeList.empty()) { NUS_Weibull(this->imgData->SaliencyImage, & (this->StrokeList), this->curParam.mDensity,this->curParam.mNon_Uniformity); } if (laterUpdate_graph) //re-update the saliency sampling-> initial connection graph { //NUS_Weibull(this->imgData->SaliencyImage, & (this->StrokeList), this->curParam.mDensity,this->curParam.mNon_Uniformity); initStrokeOrientation(StrokeList, this->imgData->GradientOrientation); connectStrokeGraph(StrokeList, this->imgData->SegmentImage); //Debug use ...Show Image //vis_StrokePositions(this->imgData->OriginalImage, this->StrokeList); } if (curParam.mLocal_Iostropy != prevParam.mLocal_Iostropy || laterUpdate_graph) // update connection graph { updateOrientation(this->StrokeList, this->curParam.mLocal_Iostropy); connectStrokeGraph(StrokeList, this->imgData->SegmentImage); laterUpdate_graph = true; } if (curParam.mCoarseness != prevParam.mCoarseness || laterUpdate_graph) // reinitialize the size { initStrokeSize(this->imgData->SaliencyImage, this->imgData->GradientRatio, (this->StrokeList), this->curParam.mCoarseness); laterUpdate_size = true; } if (curParam.mSize_Contrast!=prevParam.mSize_Contrast || laterUpdate_graph || laterUpdate_size) //update size { updateSize(StrokeList, this->curParam.mSize_Contrast); } /*if (laterUpdate_graph || laterUpdate_size) { initStrokeColor(StrokeList, this->imgData->OriginalImage); }*/ if (curParam.mHue_Constrast != prevParam.mHue_Constrast || curParam.mLightness_Contrast != prevParam.mLightness_Contrast|| curParam.mChroma_Constrast != prevParam.mChroma_Constrast|| laterUpdate_graph||laterUpdate_size ) //update the three color channels separately { initStrokeColor(StrokeList, this->imgData->OriginalImage); updateHue(StrokeList,curParam.mHue_Constrast); updateLightness(StrokeList, curParam.mLightness_Contrast); updateChroma(StrokeList, curParam.mChroma_Constrast); } //if (curParam.mLightness_Contrast != prevParam.mLightness_Contrast ||laterUpdate_graph||laterUpdate_size) //update the three color channels separately //{ // updateLightness(StrokeList, curParam.mLightness_Contrast); //} //if (curParam.mChroma_Constrast != prevParam.mChroma_Constrast ||laterUpdate_graph||laterUpdate_size) //update the three color channels separately //{ // updateChroma(StrokeList, curParam.mChroma_Constrast); //} }