mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 01:36:56 +02:00
Style fixes.
This commit is contained in:
parent
f70b4dcab2
commit
353f16b2d0
2 changed files with 8 additions and 6 deletions
|
@ -1091,15 +1091,15 @@ static Avatar* processAvatarMessageHeader(unsigned char*& packetData, size_t& da
|
||||||
// make sure the node exists
|
// make sure the node exists
|
||||||
Node* node = NodeList::getInstance()->nodeWithID(nodeID);
|
Node* node = NodeList::getInstance()->nodeWithID(nodeID);
|
||||||
if (!node || !node->getLinkedData()) {
|
if (!node || !node->getLinkedData()) {
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
Avatar* avatar = static_cast<Avatar*>(node->getLinkedData());
|
Avatar* avatar = static_cast<Avatar*>(node->getLinkedData());
|
||||||
return avatar->isInitialized() ? avatar : 0;
|
return avatar->isInitialized() ? avatar : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::processAvatarVoxelURLMessage(unsigned char* packetData, size_t dataBytes) {
|
void Application::processAvatarVoxelURLMessage(unsigned char* packetData, size_t dataBytes) {
|
||||||
Avatar* avatar = processAvatarMessageHeader(packetData, dataBytes);
|
Avatar* avatar = processAvatarMessageHeader(packetData, dataBytes);
|
||||||
if (avatar == 0) {
|
if (!avatar) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QUrl url = QUrl::fromEncoded(QByteArray((char*)packetData, dataBytes));
|
QUrl url = QUrl::fromEncoded(QByteArray((char*)packetData, dataBytes));
|
||||||
|
@ -1110,7 +1110,7 @@ void Application::processAvatarVoxelURLMessage(unsigned char* packetData, size_t
|
||||||
|
|
||||||
void Application::processAvatarFaceVideoMessage(unsigned char* packetData, size_t dataBytes) {
|
void Application::processAvatarFaceVideoMessage(unsigned char* packetData, size_t dataBytes) {
|
||||||
Avatar* avatar = processAvatarMessageHeader(packetData, dataBytes);
|
Avatar* avatar = processAvatarMessageHeader(packetData, dataBytes);
|
||||||
if (avatar == 0) {
|
if (!avatar) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
avatar->getHead().getFace().processVideoMessage(packetData, dataBytes);
|
avatar->getHead().getFace().processVideoMessage(packetData, dataBytes);
|
||||||
|
|
|
@ -134,7 +134,8 @@ void Webcam::renderPreview(int screenWidth, int screenHeight) {
|
||||||
glVertex2f(left + facePoints[3].x * xScale, top + facePoints[3].y * yScale);
|
glVertex2f(left + facePoints[3].x * xScale, top + facePoints[3].y * yScale);
|
||||||
glEnd();
|
glEnd();
|
||||||
|
|
||||||
char fps[30];
|
const int MAX_FPS_CHARACTERS = 30;
|
||||||
|
char fps[MAX_FPS_CHARACTERS];
|
||||||
sprintf(fps, "FPS: %d", (int)(roundf(_frameCount * 1000000.0f / (usecTimestampNow() - _startTimestamp))));
|
sprintf(fps, "FPS: %d", (int)(roundf(_frameCount * 1000000.0f / (usecTimestampNow() - _startTimestamp))));
|
||||||
drawtext(left, top + PREVIEW_HEIGHT + 20, 0.10, 0, 1, 0, fps);
|
drawtext(left, top + PREVIEW_HEIGHT + 20, 0.10, 0, 1, 0, fps);
|
||||||
}
|
}
|
||||||
|
@ -484,7 +485,8 @@ void FrameGrabber::grabFrame() {
|
||||||
// convert from 11 to 8 bits, centered about the mean face depth (if possible)
|
// convert from 11 to 8 bits, centered about the mean face depth (if possible)
|
||||||
if (_searchWindow.area() > 0) {
|
if (_searchWindow.area() > 0) {
|
||||||
const double DEPTH_OFFSET_SMOOTHING = 0.95;
|
const double DEPTH_OFFSET_SMOOTHING = 0.95;
|
||||||
double meanOffset = 128.0 - mean(depth(_searchWindow))[0];
|
const double EIGHT_BIT_MIDPOINT = 128.0;
|
||||||
|
double meanOffset = EIGHT_BIT_MIDPOINT - mean(depth(_searchWindow))[0];
|
||||||
_depthOffset = (_depthOffset == 0.0) ? meanOffset : glm::mix(meanOffset, _depthOffset, DEPTH_OFFSET_SMOOTHING);
|
_depthOffset = (_depthOffset == 0.0) ? meanOffset : glm::mix(meanOffset, _depthOffset, DEPTH_OFFSET_SMOOTHING);
|
||||||
}
|
}
|
||||||
depth.convertTo(_grayDepthFrame, CV_8UC1, 1.0, _depthOffset);
|
depth.convertTo(_grayDepthFrame, CV_8UC1, 1.0, _depthOffset);
|
||||||
|
|
Loading…
Reference in a new issue