void BatteryDispatcher::updateBatteryStatus(const WebBatteryStatus& batteryStatus) { m_batteryStatus = BatteryStatus::create( batteryStatus.charging, batteryStatus.chargingTime, batteryStatus.dischargingTime, ensureTwoSignificantDigits(batteryStatus.level)); notifyControllers(); }
void DetailedFaceDetector::detectFeatures(const cv::Mat &frame) { //get the face rectangles RectVector lastRects = getAreas(); //create a new detailed result DetailedFaces newDetails; for(RectVectorItr faceRect = lastRects.begin(); faceRect != lastRects.end(); ++faceRect) { //create a new entry FaceDetails ¤tFace = newDetails[*faceRect]; if(detectWhat && EYES) detectEyes(frame, *faceRect, currentFace); if(detectWhat && NOSE) detectNose(frame, *faceRect, currentFace); if(detectWhat && MOUTH) detectMouth(frame, *faceRect, currentFace); } setDetailedFaceInfo(newDetails); notifyControllers(); }
void GamepadDispatcher::dispatchDidConnectOrDisconnectGamepad(unsigned index, const WebGamepad& gamepad, bool connected) { ASSERT(index < WebGamepads::itemsLengthCap); ASSERT(connected == gamepad.connected); m_latestChange.pad = gamepad; m_latestChange.index = index; notifyControllers(); }
void FaceDetector::processFrame() { Mat frame = getMostRecentFrame(); if(frame.empty()) { return; } detectFaces(frame); if(hasUpdates) { notifyControllers(); } }
void DetailedFaceDetector::processFrame() { cv::Mat frame = getMostRecentFrame(); if(frame.empty()) return; detectFaces(frame); //only detect features if the FaceDetector has updates! if(hasUpdates) { //only detect other features if the face detector had updates if(detectWhat > 0) detectFeatures(frame); //since this object disables autoNotify, do it manually now! //this is to avoid double updates to the controllers and //only update when necessary notifyControllers(); } }
void BatteryDispatcher::updateBatteryStatus(const BatteryStatus& batteryStatus) { m_batteryStatus = batteryStatus; m_hasLatestData = true; notifyControllers(); }
void DeviceOrientationDispatcher::didChangeDeviceOrientation(const WebDeviceOrientationData& motion) { m_lastDeviceOrientationData = DeviceOrientationData::create(motion); notifyControllers(); }