Ejemplo n.º 1
0
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 &currentFace = 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();
	}
Ejemplo n.º 3
0
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();
}
Ejemplo n.º 4
0
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();
}