void BbVideoWindowControl::setSaturation(int saturation)
{
    if (m_saturation != saturation) {
        m_saturation = saturation;
        updateSaturation();
        emit saturationChanged(m_saturation);
    }
}
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 dpRecordBufferCircle::update(){
    
    if(mBufs.empty() == false && isRecord == false && isRecordOnce){
        
        mTargetPos.set(mBufs[mPlaybackCounter]);
        mPlaybackCounter++;
        mPlaybackCounter %= mBufs.size();
        
    }
    
    updateAlpha();
    updateSaturation();
    
    mPos += (mTargetPos - mPos) * mPosEase;
    
}
示例#4
0
文件: remap32.cpp 项目: 86400/scummvm
bool SingleRemap::update() {
	switch (_type) {
	case kRemapNone:
		break;
	case kRemapByRange:
		return updateRange();
	case kRemapByPercent:
		return updateBrightness();
	case kRemapToGray:
		return updateSaturation();
	case kRemapToPercentGray:
		return updateSaturationAndBrightness();
	default:
		error("Illegal remap type %d", _type);
	}

	return false;
}