Skip to content

Commit 74e39d0

Browse files
authored
ofxKinect: std:: conformance (#7642)
#changelog #addons
1 parent ef2e076 commit 74e39d0

2 files changed

Lines changed: 19 additions & 19 deletions

File tree

addons/ofxKinect/src/ofxKinect.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ void ofxKinect::update() {
382382
tryCount = 0;
383383
if(this->lock()) {
384384
if( videoPixels.getHeight() == videoPixelsIntra.getHeight() ){
385-
swap(videoPixels,videoPixelsIntra);
385+
std::swap(videoPixels,videoPixelsIntra);
386386
}else{
387387
int minimumSize = MIN(videoPixels.size(), videoPixelsIntra.size());
388388
memcpy(videoPixels.getData(), videoPixelsIntra.getData(), minimumSize);
@@ -402,7 +402,7 @@ void ofxKinect::update() {
402402
bIsFrameNewDepth = true;
403403
tryCount = 0;
404404
if(this->lock()) {
405-
swap(depthPixelsRaw, depthPixelsRawIntra);
405+
std::swap(depthPixelsRaw, depthPixelsRawIntra);
406406
bNeedsUpdateDepth = false;
407407
this->unlock();
408408

@@ -807,7 +807,7 @@ void ofxKinect::grabDepthFrame(freenect_device *dev, void *depth, uint32_t times
807807

808808
if(kinect->kinectDevice == dev) {
809809
kinect->lock();
810-
swap(kinect->depthPixelsRawBack,kinect->depthPixelsRawIntra);
810+
std::swap(kinect->depthPixelsRawBack,kinect->depthPixelsRawIntra);
811811
kinect->bNeedsUpdateDepth = true;
812812
kinect->unlock();
813813
freenect_set_depth_buffer(kinect->kinectDevice,kinect->depthPixelsRawBack.getData());
@@ -821,7 +821,7 @@ void ofxKinect::grabVideoFrame(freenect_device *dev, void *video, uint32_t times
821821

822822
if(kinect->kinectDevice == dev) {
823823
kinect->lock();
824-
swap(kinect->videoPixelsBack,kinect->videoPixelsIntra);
824+
std::swap(kinect->videoPixelsBack,kinect->videoPixelsIntra);
825825
kinect->bNeedsUpdateVideo = true;
826826
kinect->unlock();
827827
freenect_set_video_buffer(kinect->kinectDevice,kinect->videoPixelsBack.getData());
@@ -972,7 +972,7 @@ bool ofxKinectContext::open(ofxKinect& kinect, int id) {
972972
ofLogError("ofxKinect") << "could not open device " << id;
973973
return false;
974974
}
975-
kinects.insert(pair<int,ofxKinect*>(id, &kinect));
975+
kinects.insert(std::pair<int,ofxKinect*>(id, &kinect));
976976

977977
// set kinect id & serial from bus id
978978
kinect.deviceId = id;
@@ -1003,7 +1003,7 @@ bool ofxKinectContext::open(ofxKinect& kinect, string serial) {
10031003
return false;
10041004
}
10051005
int index = getDeviceIndex(serial);
1006-
kinects.insert(pair<int,ofxKinect*>(deviceList[index].id, &kinect));
1006+
kinects.insert(std::pair<int,ofxKinect*>(deviceList[index].id, &kinect));
10071007
kinect.deviceId = deviceList[index].id;
10081008
kinect.serial = serial;
10091009

@@ -1068,7 +1068,7 @@ void ofxKinectContext::listDevices(bool verbose) {
10681068
if(!isInited())
10691069
init();
10701070

1071-
stringstream stream;
1071+
std::stringstream stream;
10721072

10731073
if(numTotal() == 0) {
10741074
stream << "no devices found";

examples/computer_vision/kinectExample/src/ofApp.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,27 +124,27 @@ void ofApp::draw() {
124124

125125
// draw instructions
126126
ofSetColor(255, 255, 255);
127-
stringstream reportStream;
127+
std::stringstream reportStream;
128128

129129
if(kinect.hasAccelControl()) {
130130
reportStream << "accel is: " << ofToString(kinect.getMksAccel().x, 2) << " / "
131131
<< ofToString(kinect.getMksAccel().y, 2) << " / "
132-
<< ofToString(kinect.getMksAccel().z, 2) << endl;
132+
<< ofToString(kinect.getMksAccel().z, 2) << std::endl;
133133
} else {
134-
reportStream << "Note: this is a newer Xbox Kinect or Kinect For Windows device," << endl
135-
<< "motor / led / accel controls are not currently supported" << endl << endl;
134+
reportStream << "Note: this is a newer Xbox Kinect or Kinect For Windows device," << std::endl
135+
<< "motor / led / accel controls are not currently supported" << std::endl << std::endl;
136136
}
137137

138-
reportStream << "press p to switch between images and point cloud, rotate the point cloud with the mouse" << endl
139-
<< "using opencv threshold = " << bThreshWithOpenCV <<" (press spacebar)" << endl
140-
<< "set near threshold " << nearThreshold << " (press: + -)" << endl
138+
reportStream << "press p to switch between images and point cloud, rotate the point cloud with the mouse" << std::endl
139+
<< "using opencv threshold = " << bThreshWithOpenCV <<" (press spacebar)" << std::endl
140+
<< "set near threshold " << nearThreshold << " (press: + -)" << std::endl
141141
<< "set far threshold " << farThreshold << " (press: < >) num blobs found " << contourFinder.nBlobs
142-
<< ", fps: " << ofGetFrameRate() << endl
143-
<< "press c to close the connection and o to open it again, connection is: " << kinect.isConnected() << endl;
142+
<< ", fps: " << ofGetFrameRate() << std::endl
143+
<< "press c to close the connection and o to open it again, connection is: " << kinect.isConnected() << std::endl;
144144

145145
if(kinect.hasCamTiltControl()) {
146-
reportStream << "press UP and DOWN to change the tilt angle: " << angle << " degrees" << endl
147-
<< "press 1-5 & 0 to change the led mode" << endl;
146+
reportStream << "press UP and DOWN to change the tilt angle: " << angle << " degrees" << std::endl
147+
<< "press 1-5 & 0 to change the led mode" << std::endl;
148148
}
149149

150150
ofDrawBitmapString(reportStream.str(), 20, 652);
@@ -304,4 +304,4 @@ void ofApp::mouseExited(int x, int y){
304304
void ofApp::windowResized(int w, int h)
305305
{
306306

307-
}
307+
}

0 commit comments

Comments
 (0)