void ofApp::update() { ofBackground(0); #ifdef INTERACTIVE if(playState <= 1) { #ifdef KINECT updateKinect(); #else updateWebcam(); #endif updateBlobs(); updateFBOs(); if(ofGetFrameNum() % 60 == 0) { updateBrightness(); } } else if(playState >= 2) { updateMovies(); } #else if (playState == 1) playState = 2; updateMovies(); #endif // Write if(ofGetMinutes() % 10 == 0) { writeDiagnostics(); } }
void initScreens(void) { static bool needToSetup = true; if(needToSetup) { memcpy((void *)ARM11_PARAMETERS_ADDRESS, fbs, sizeof(fbs)); invokeArm11Function(SETUP_FRAMEBUFFERS); if(!ARESCREENSINITIALIZED) { *(vu32 *)ARM11_PARAMETERS_ADDRESS = brightness[MULTICONFIG(BRIGHTNESS)]; invokeArm11Function(INIT_SCREENS); //Turn on backlight i2cWriteRegister(I2C_DEV_MCU, 0x22, 0x2A); } else updateBrightness(MULTICONFIG(BRIGHTNESS)); clearScreens(true); needToSetup = false; } clearScreens(false); swapFramebuffers(false); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); splw = new SerialPortListWidget(this); ui->communicationVBoxLayout->addWidget(splw); //Connect browse button QFileDialog* fileDialog = new QFileDialog(); connect(fileDialog,SIGNAL(fileSelected(QString)),ui->calibrationFileLineEdit,SLOT(setText(QString))); connect(ui->calibrationFilePushButton,SIGNAL(clicked()),fileDialog,SLOT(open())); //Connect apply settings button connect(ui->applySettingsPushButton,SIGNAL(clicked()),this,SLOT(applySettings())); //Frame rate timer frameRateTimer = new QTimer(this); fillDefaultSettings(); connect(frameRateTimer,SIGNAL(timeout()),this,SLOT(update())); //Initialize marker detector markerDetector.setMinMaxSize(0.0001,0.5); //Camera view updateAutoFocus(false); updateFocus(ui->cameraFocusSlider->value()); updateBrightness(ui->cameraBrightnessSlider->value()); updateSharpness(ui->cameraSharpnessSlider->value()); connect(ui->cameraFocusSlider,SIGNAL(valueChanged(int)),this,SLOT(updateFocus(int))); connect(ui->cameraBrightnessSlider,SIGNAL(valueChanged(int)),this,SLOT(updateBrightness(int))); connect(ui->cameraSharpnessSlider,SIGNAL(valueChanged(int)),this,SLOT(updateSharpness(int))); }
void BbVideoWindowControl::setBrightness(int brightness) { if (m_brightness != brightness) { m_brightness = brightness; updateBrightness(); emit brightnessChanged(m_brightness); } }
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(); }
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; }