From: Joe Howse Date: Sat, 27 Dec 2014 03:54:03 +0000 (-0400) Subject: const correctness in OpenNI and OpenNI2 getProperty X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~2764^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7a3204c578d8a76a377dc572305af4d1cbdb476;p=platform%2Fupstream%2Fopencv.git const correctness in OpenNI and OpenNI2 getProperty --- diff --git a/modules/videoio/src/cap_openni.cpp b/modules/videoio/src/cap_openni.cpp index b9ca6ca..6c91df9 100644 --- a/modules/videoio/src/cap_openni.cpp +++ b/modules/videoio/src/cap_openni.cpp @@ -477,11 +477,11 @@ protected: bool readCamerasParams(); - double getDepthGeneratorProperty(int propIdx); + double getDepthGeneratorProperty(int propIdx) const; bool setDepthGeneratorProperty(int propIdx, double propVal); - double getImageGeneratorProperty(int propIdx); + double getImageGeneratorProperty(int propIdx) const; bool setImageGeneratorProperty(int propIdx, double propVal); - double getCommonProperty(int propIdx); + double getCommonProperty(int propIdx) const; bool setCommonProperty(int propIdx, double propVal); // OpenNI context @@ -820,7 +820,7 @@ bool CvCapture_OpenNI::setProperty( int propIdx, double propValue ) return isSet; } -double CvCapture_OpenNI::getCommonProperty( int propIdx ) +double CvCapture_OpenNI::getCommonProperty( int propIdx ) const { double propValue = 0; @@ -917,7 +917,7 @@ bool CvCapture_OpenNI::setCommonProperty( int propIdx, double propValue ) return isSet; } -double CvCapture_OpenNI::getDepthGeneratorProperty( int propIdx ) +double CvCapture_OpenNI::getDepthGeneratorProperty( int propIdx ) const { double propValue = 0; if( !depthGenerator.IsValid() ) @@ -953,7 +953,7 @@ double CvCapture_OpenNI::getDepthGeneratorProperty( int propIdx ) propValue = (double)depthFocalLength_VGA; break; case CV_CAP_PROP_OPENNI_REGISTRATION : - propValue = depthGenerator.GetAlternativeViewPointCap().IsViewPointAs(imageGenerator) ? 1.0 : 0.0; + propValue = depthGenerator.GetAlternativeViewPointCap().IsViewPointAs(const_cast(this)->imageGenerator) ? 1.0 : 0.0; break; case CV_CAP_PROP_POS_MSEC : propValue = (double)depthGenerator.GetTimestamp(); @@ -1018,7 +1018,7 @@ bool CvCapture_OpenNI::setDepthGeneratorProperty( int propIdx, double propValue return isSet; } -double CvCapture_OpenNI::getImageGeneratorProperty( int propIdx ) +double CvCapture_OpenNI::getImageGeneratorProperty( int propIdx ) const { double propValue = 0.; if( !imageGenerator.IsValid() ) diff --git a/modules/videoio/src/cap_openni2.cpp b/modules/videoio/src/cap_openni2.cpp index 0fdc7e9..d5d48d9 100644 --- a/modules/videoio/src/cap_openni2.cpp +++ b/modules/videoio/src/cap_openni2.cpp @@ -124,11 +124,11 @@ protected: bool readCamerasParams(); - double getDepthGeneratorProperty(int propIdx); + double getDepthGeneratorProperty(int propIdx) const; bool setDepthGeneratorProperty(int propIdx, double propVal); - double getImageGeneratorProperty(int propIdx); + double getImageGeneratorProperty(int propIdx) const; bool setImageGeneratorProperty(int propIdx, double propVal); - double getCommonProperty(int propIdx); + double getCommonProperty(int propIdx) const; bool setCommonProperty(int propIdx, double propVal); // OpenNI context @@ -444,7 +444,7 @@ bool CvCapture_OpenNI2::setProperty( int propIdx, double propValue ) return isSet; } -double CvCapture_OpenNI2::getCommonProperty( int propIdx ) +double CvCapture_OpenNI2::getCommonProperty( int propIdx ) const { double propValue = 0; @@ -508,7 +508,7 @@ bool CvCapture_OpenNI2::setCommonProperty( int propIdx, double propValue ) return isSet; } -double CvCapture_OpenNI2::getDepthGeneratorProperty( int propIdx ) +double CvCapture_OpenNI2::getDepthGeneratorProperty( int propIdx ) const { double propValue = 0; if( !depth.isValid() ) @@ -608,7 +608,7 @@ bool CvCapture_OpenNI2::setDepthGeneratorProperty( int propIdx, double propValue return isSet; } -double CvCapture_OpenNI2::getImageGeneratorProperty( int propIdx ) +double CvCapture_OpenNI2::getImageGeneratorProperty( int propIdx ) const { double propValue = 0.; if( !color.isValid() )