Compile opencv_test_core with cv::String instead of std::string
All tests passed!
This commit is contained in:
@@ -110,7 +110,7 @@ void RBaseStream::readBlock()
|
||||
}
|
||||
|
||||
|
||||
bool RBaseStream::open( const std::string& filename )
|
||||
bool RBaseStream::open( const cv::String& filename )
|
||||
{
|
||||
close();
|
||||
allocate();
|
||||
@@ -388,7 +388,7 @@ void WBaseStream::writeBlock()
|
||||
}
|
||||
|
||||
|
||||
bool WBaseStream::open( const std::string& filename )
|
||||
bool WBaseStream::open( const cv::String& filename )
|
||||
{
|
||||
close();
|
||||
allocate();
|
||||
|
@@ -66,7 +66,7 @@ public:
|
||||
RBaseStream();
|
||||
virtual ~RBaseStream();
|
||||
|
||||
virtual bool open( const std::string& filename );
|
||||
virtual bool open( const cv::String& filename );
|
||||
virtual bool open( const Mat& buf );
|
||||
virtual void close();
|
||||
bool isOpened();
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
WBaseStream();
|
||||
virtual ~WBaseStream();
|
||||
|
||||
virtual bool open( const std::string& filename );
|
||||
virtual bool open( const cv::String& filename );
|
||||
virtual bool open( std::vector<uchar>& buf );
|
||||
virtual void close();
|
||||
bool isOpened();
|
||||
|
@@ -445,7 +445,7 @@ namespace cv
|
||||
VideoCapture::VideoCapture()
|
||||
{}
|
||||
|
||||
VideoCapture::VideoCapture(const std::string& filename)
|
||||
VideoCapture::VideoCapture(const cv::String& filename)
|
||||
{
|
||||
open(filename);
|
||||
}
|
||||
@@ -460,7 +460,7 @@ VideoCapture::~VideoCapture()
|
||||
cap.release();
|
||||
}
|
||||
|
||||
bool VideoCapture::open(const std::string& filename)
|
||||
bool VideoCapture::open(const cv::String& filename)
|
||||
{
|
||||
if (!isOpened())
|
||||
cap = cvCreateFileCapture(filename.c_str());
|
||||
@@ -532,7 +532,7 @@ double VideoCapture::get(int propId)
|
||||
VideoWriter::VideoWriter()
|
||||
{}
|
||||
|
||||
VideoWriter::VideoWriter(const std::string& filename, int fourcc, double fps, Size frameSize, bool isColor)
|
||||
VideoWriter::VideoWriter(const cv::String& filename, int fourcc, double fps, Size frameSize, bool isColor)
|
||||
{
|
||||
open(filename, fourcc, fps, frameSize, isColor);
|
||||
}
|
||||
@@ -547,7 +547,7 @@ VideoWriter::~VideoWriter()
|
||||
release();
|
||||
}
|
||||
|
||||
bool VideoWriter::open(const std::string& filename, int fourcc, double fps, Size frameSize, bool isColor)
|
||||
bool VideoWriter::open(const cv::String& filename, int fourcc, double fps, Size frameSize, bool isColor)
|
||||
{
|
||||
writer = cvCreateVideoWriter(filename.c_str(), fourcc, fps, frameSize, isColor);
|
||||
return isOpened();
|
||||
|
@@ -66,7 +66,7 @@
|
||||
|
||||
#include "XnCppWrapper.h"
|
||||
|
||||
const std::string XMLConfig =
|
||||
const cv::String XMLConfig =
|
||||
"<OpenNI>"
|
||||
"<Licenses>"
|
||||
"<License vendor=\"PrimeSense\" key=\"0KOIk2JeIBYClPWVnMoRKn5cdY4=\"/>"
|
||||
@@ -559,7 +559,7 @@ CvCapture_OpenNI::CvCapture_OpenNI( int index )
|
||||
if( status != XN_STATUS_OK )
|
||||
{
|
||||
std::cerr << "CvCapture_OpenNI::CvCapture_OpenNI : Failed to initialize the context: "
|
||||
<< std::string(xnGetStatusString(status)) << std::endl;
|
||||
<< cv::String(xnGetStatusString(status)) << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -569,7 +569,7 @@ CvCapture_OpenNI::CvCapture_OpenNI( int index )
|
||||
if( status != XN_STATUS_OK )
|
||||
{
|
||||
std::cerr << "CvCapture_OpenNI::CvCapture_OpenNI : Failed to enumerate production trees: "
|
||||
<< std::string(xnGetStatusString(status)) << std::endl;
|
||||
<< cv::String(xnGetStatusString(status)) << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -587,7 +587,7 @@ CvCapture_OpenNI::CvCapture_OpenNI( int index )
|
||||
if( status != XN_STATUS_OK )
|
||||
{
|
||||
std::cerr << "CvCapture_OpenNI::CvCapture_OpenNI : Failed to create production tree: "
|
||||
<< std::string(xnGetStatusString(status)) << std::endl;
|
||||
<< cv::String(xnGetStatusString(status)) << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -596,7 +596,7 @@ CvCapture_OpenNI::CvCapture_OpenNI( int index )
|
||||
if( status != XN_STATUS_OK )
|
||||
{
|
||||
std::cerr << "CvCapture_OpenNI::CvCapture_OpenNI : Failed to run xml script: "
|
||||
<< std::string(xnGetStatusString(status)) << std::endl;
|
||||
<< cv::String(xnGetStatusString(status)) << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -607,7 +607,7 @@ CvCapture_OpenNI::CvCapture_OpenNI( int index )
|
||||
if( status != XN_STATUS_OK )
|
||||
{
|
||||
std::cerr << "CvCapture_OpenNI::CvCapture_OpenNI : Failed to enumerate depth generators: "
|
||||
<< std::string(xnGetStatusString(status)) << std::endl;
|
||||
<< cv::String(xnGetStatusString(status)) << std::endl;
|
||||
return;
|
||||
}
|
||||
if( depthList.IsEmpty() )
|
||||
@@ -619,7 +619,7 @@ CvCapture_OpenNI::CvCapture_OpenNI( int index )
|
||||
if( status != XN_STATUS_OK )
|
||||
{
|
||||
std::cerr << "CvCapture_OpenNI::CvCapture_OpenNI : Failed to create depth generator: "
|
||||
<< std::string(xnGetStatusString(status)) << std::endl;
|
||||
<< cv::String(xnGetStatusString(status)) << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -629,7 +629,7 @@ CvCapture_OpenNI::CvCapture_OpenNI( int index )
|
||||
if( status != XN_STATUS_OK )
|
||||
{
|
||||
std::cerr << "CvCapture_OpenNI::CvCapture_OpenNI : Failed to enumerate image generators: "
|
||||
<< std::string(xnGetStatusString(status)) << std::endl;
|
||||
<< cv::String(xnGetStatusString(status)) << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -639,7 +639,7 @@ CvCapture_OpenNI::CvCapture_OpenNI( int index )
|
||||
if( status != XN_STATUS_OK )
|
||||
{
|
||||
std::cerr << "CvCapture_OpenNI::CvCapture_OpenNI : Failed to create image generator: "
|
||||
<< std::string(xnGetStatusString(status)) << std::endl;
|
||||
<< cv::String(xnGetStatusString(status)) << std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -667,7 +667,7 @@ CvCapture_OpenNI::CvCapture_OpenNI( int index )
|
||||
if( status != XN_STATUS_OK )
|
||||
{
|
||||
std::cerr << "CvCapture_OpenNI::CvCapture_OpenNI : Failed to start generating OpenNI data: "
|
||||
<< std::string(xnGetStatusString(status)) << std::endl;
|
||||
<< cv::String(xnGetStatusString(status)) << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -698,7 +698,7 @@ CvCapture_OpenNI::CvCapture_OpenNI(const char * filename)
|
||||
if( status != XN_STATUS_OK )
|
||||
{
|
||||
std::cerr << "CvCapture_OpenNI::CvCapture_OpenNI : Failed to initialize the context: "
|
||||
<< std::string(xnGetStatusString(status)) << std::endl;
|
||||
<< cv::String(xnGetStatusString(status)) << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -707,7 +707,7 @@ CvCapture_OpenNI::CvCapture_OpenNI(const char * filename)
|
||||
if( status != XN_STATUS_OK )
|
||||
{
|
||||
std::cerr << "CvCapture_OpenNI::CvCapture_OpenNI : Failed to open input file (" << filename << "): "
|
||||
<< std::string(xnGetStatusString(status)) << std::endl;
|
||||
<< cv::String(xnGetStatusString(status)) << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -862,7 +862,7 @@ double CvCapture_OpenNI::getCommonProperty( int propIdx )
|
||||
break;
|
||||
default :
|
||||
{
|
||||
std::stringstream ss;
|
||||
cv::Stringstream ss;
|
||||
ss << "Such parameter (propIdx=" << propIdx << ") isn't supported for getting.\n";
|
||||
CV_Error( CV_StsBadArg, ss.str().c_str() );
|
||||
}
|
||||
@@ -923,7 +923,7 @@ bool CvCapture_OpenNI::setCommonProperty( int propIdx, double propValue )
|
||||
break;
|
||||
default:
|
||||
{
|
||||
std::stringstream ss;
|
||||
cv::Stringstream ss;
|
||||
ss << "Such parameter (propIdx=" << propIdx << ") isn't supported for setting.\n";
|
||||
CV_Error( CV_StsBadArg, ss.str().c_str() );
|
||||
}
|
||||
@@ -978,7 +978,7 @@ double CvCapture_OpenNI::getDepthGeneratorProperty( int propIdx )
|
||||
break;
|
||||
default :
|
||||
{
|
||||
std::stringstream ss;
|
||||
cv::Stringstream ss;
|
||||
ss << "Depth generator does not support such parameter (propIdx=" << propIdx << ") for getting.\n";
|
||||
CV_Error( CV_StsBadArg, ss.str().c_str() );
|
||||
}
|
||||
@@ -1032,7 +1032,7 @@ bool CvCapture_OpenNI::setDepthGeneratorProperty( int propIdx, double propValue
|
||||
break;
|
||||
default:
|
||||
{
|
||||
std::stringstream ss;
|
||||
cv::Stringstream ss;
|
||||
ss << "Depth generator does not support such parameter (propIdx=" << propIdx << ") for setting.\n";
|
||||
CV_Error( CV_StsBadArg, ss.str().c_str() );
|
||||
}
|
||||
@@ -1074,7 +1074,7 @@ double CvCapture_OpenNI::getImageGeneratorProperty( int propIdx )
|
||||
break;
|
||||
default :
|
||||
{
|
||||
std::stringstream ss;
|
||||
cv::Stringstream ss;
|
||||
ss << "Image generator does not support such parameter (propIdx=" << propIdx << ") for getting.\n";
|
||||
CV_Error( CV_StsBadArg, ss.str().c_str() );
|
||||
}
|
||||
@@ -1135,7 +1135,7 @@ bool CvCapture_OpenNI::setImageGeneratorProperty( int propIdx, double propValue
|
||||
}
|
||||
default:
|
||||
{
|
||||
std::stringstream ss;
|
||||
cv::Stringstream ss;
|
||||
ss << "Image generator does not support such parameter (propIdx=" << propIdx << ") for setting.\n";
|
||||
CV_Error( CV_StsBadArg, ss.str().c_str() );
|
||||
}
|
||||
|
@@ -356,7 +356,7 @@ bool CvCaptureCAM_PvAPI::setProperty( int property_id, double value )
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string ip=cv::format("%d.%d.%d.%d", ((int)value>>24)&255, ((int)value>>16)&255, ((int)value>>8)&255, (int)value&255);
|
||||
cv::String ip=cv::format("%d.%d.%d.%d", ((int)value>>24)&255, ((int)value>>16)&255, ((int)value>>8)&255, (int)value&255);
|
||||
if ((PvAttrEnumSet(Camera.Handle,"MulticastEnable", "On")==ePvErrSuccess) &&
|
||||
(PvAttrStringSet(Camera.Handle, "MulticastIPAddress", ip.c_str())==ePvErrSuccess))
|
||||
break;
|
||||
|
@@ -54,7 +54,7 @@ BaseImageDecoder::BaseImageDecoder()
|
||||
m_buf_supported = false;
|
||||
}
|
||||
|
||||
bool BaseImageDecoder::setSource( const std::string& filename )
|
||||
bool BaseImageDecoder::setSource( const cv::String& filename )
|
||||
{
|
||||
m_filename = filename;
|
||||
m_buf.release();
|
||||
@@ -65,7 +65,7 @@ bool BaseImageDecoder::setSource( const Mat& buf )
|
||||
{
|
||||
if( !m_buf_supported )
|
||||
return false;
|
||||
m_filename = std::string();
|
||||
m_filename = cv::String();
|
||||
m_buf = buf;
|
||||
return true;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ size_t BaseImageDecoder::signatureLength() const
|
||||
return m_signature.size();
|
||||
}
|
||||
|
||||
bool BaseImageDecoder::checkSignature( const std::string& signature ) const
|
||||
bool BaseImageDecoder::checkSignature( const cv::String& signature ) const
|
||||
{
|
||||
size_t len = signatureLength();
|
||||
return signature.size() >= len && memcmp( signature.c_str(), m_signature.c_str(), len ) == 0;
|
||||
@@ -96,12 +96,12 @@ bool BaseImageEncoder::isFormatSupported( int depth ) const
|
||||
return depth == CV_8U;
|
||||
}
|
||||
|
||||
std::string BaseImageEncoder::getDescription() const
|
||||
cv::String BaseImageEncoder::getDescription() const
|
||||
{
|
||||
return m_description;
|
||||
}
|
||||
|
||||
bool BaseImageEncoder::setDestination( const std::string& filename )
|
||||
bool BaseImageEncoder::setDestination( const cv::String& filename )
|
||||
{
|
||||
m_filename = filename;
|
||||
m_buf = 0;
|
||||
@@ -114,7 +114,7 @@ bool BaseImageEncoder::setDestination( std::vector<uchar>& buf )
|
||||
return false;
|
||||
m_buf = &buf;
|
||||
m_buf->clear();
|
||||
m_filename = std::string();
|
||||
m_filename = cv::String();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ void BaseImageEncoder::throwOnEror() const
|
||||
{
|
||||
if(!m_last_error.empty())
|
||||
{
|
||||
std::string msg = "Raw image encoder error: " + m_last_error;
|
||||
cv::String msg = "Raw image encoder error: " + m_last_error;
|
||||
CV_Error( CV_BadImageSize, msg.c_str() );
|
||||
}
|
||||
}
|
||||
|
@@ -65,21 +65,21 @@ public:
|
||||
int height() const { return m_height; };
|
||||
virtual int type() const { return m_type; };
|
||||
|
||||
virtual bool setSource( const std::string& filename );
|
||||
virtual bool setSource( const cv::String& filename );
|
||||
virtual bool setSource( const Mat& buf );
|
||||
virtual bool readHeader() = 0;
|
||||
virtual bool readData( Mat& img ) = 0;
|
||||
|
||||
virtual size_t signatureLength() const;
|
||||
virtual bool checkSignature( const std::string& signature ) const;
|
||||
virtual bool checkSignature( const cv::String& signature ) const;
|
||||
virtual ImageDecoder newDecoder() const;
|
||||
|
||||
protected:
|
||||
int m_width; // width of the image ( filled by readHeader )
|
||||
int m_height; // height of the image ( filled by readHeader )
|
||||
int m_type;
|
||||
std::string m_filename;
|
||||
std::string m_signature;
|
||||
cv::String m_filename;
|
||||
cv::String m_signature;
|
||||
Mat m_buf;
|
||||
bool m_buf_supported;
|
||||
};
|
||||
@@ -93,23 +93,23 @@ public:
|
||||
virtual ~BaseImageEncoder() {};
|
||||
virtual bool isFormatSupported( int depth ) const;
|
||||
|
||||
virtual bool setDestination( const std::string& filename );
|
||||
virtual bool setDestination( const cv::String& filename );
|
||||
virtual bool setDestination( std::vector<uchar>& buf );
|
||||
virtual bool write( const Mat& img, const std::vector<int>& params ) = 0;
|
||||
|
||||
virtual std::string getDescription() const;
|
||||
virtual cv::String getDescription() const;
|
||||
virtual ImageEncoder newEncoder() const;
|
||||
|
||||
virtual void throwOnEror() const;
|
||||
|
||||
protected:
|
||||
std::string m_description;
|
||||
cv::String m_description;
|
||||
|
||||
std::string m_filename;
|
||||
cv::String m_filename;
|
||||
std::vector<uchar>* m_buf;
|
||||
bool m_buf_supported;
|
||||
|
||||
std::string m_last_error;
|
||||
cv::String m_last_error;
|
||||
};
|
||||
|
||||
}
|
||||
|
@@ -82,7 +82,7 @@ static JasperInitializer initialize_jasper;
|
||||
|
||||
Jpeg2KDecoder::Jpeg2KDecoder()
|
||||
{
|
||||
m_signature = '\0' + std::string() + '\0' + std::string() + '\0' + std::string("\x0cjP \r\n\x87\n");
|
||||
m_signature = '\0' + cv::String() + '\0' + cv::String() + '\0' + cv::String("\x0cjP \r\n\x87\n");
|
||||
m_stream = 0;
|
||||
m_image = 0;
|
||||
}
|
||||
|
@@ -107,7 +107,7 @@ size_t PxMDecoder::signatureLength() const
|
||||
return 3;
|
||||
}
|
||||
|
||||
bool PxMDecoder::checkSignature( const std::string& signature ) const
|
||||
bool PxMDecoder::checkSignature( const cv::String& signature ) const
|
||||
{
|
||||
return signature.size() >= 3 && signature[0] == 'P' &&
|
||||
'1' <= signature[1] && signature[1] <= '6' &&
|
||||
|
@@ -61,7 +61,7 @@ public:
|
||||
void close();
|
||||
|
||||
size_t signatureLength() const;
|
||||
bool checkSignature( const std::string& signature ) const;
|
||||
bool checkSignature( const cv::String& signature ) const;
|
||||
ImageDecoder newDecoder() const;
|
||||
|
||||
protected:
|
||||
|
@@ -94,7 +94,7 @@ size_t TiffDecoder::signatureLength() const
|
||||
return 4;
|
||||
}
|
||||
|
||||
bool TiffDecoder::checkSignature( const std::string& signature ) const
|
||||
bool TiffDecoder::checkSignature( const cv::String& signature ) const
|
||||
{
|
||||
return signature.size() >= 4 &&
|
||||
(memcmp(signature.c_str(), fmtSignTiffII, 4) == 0 ||
|
||||
|
@@ -102,7 +102,7 @@ public:
|
||||
void close();
|
||||
|
||||
size_t signatureLength() const;
|
||||
bool checkSignature( const std::string& signature ) const;
|
||||
bool checkSignature( const cv::String& signature ) const;
|
||||
ImageDecoder newDecoder() const;
|
||||
|
||||
protected:
|
||||
|
@@ -71,7 +71,7 @@ ImageDecoder WebPDecoder::newDecoder() const
|
||||
return new WebPDecoder;
|
||||
}
|
||||
|
||||
bool WebPDecoder::checkSignature( const std::string& signature ) const
|
||||
bool WebPDecoder::checkSignature( const cv::String& signature ) const
|
||||
{
|
||||
size_t len = signatureLength();
|
||||
bool ret = false;
|
||||
|
@@ -60,7 +60,7 @@ public:
|
||||
bool readData( Mat& img );
|
||||
bool readHeader();
|
||||
void close();
|
||||
bool checkSignature( const std::string& signature ) const;
|
||||
bool checkSignature( const cv::String& signature ) const;
|
||||
|
||||
ImageDecoder newDecoder() const;
|
||||
|
||||
|
@@ -96,7 +96,7 @@ struct ImageCodecInitializer
|
||||
|
||||
static ImageCodecInitializer codecs;
|
||||
|
||||
static ImageDecoder findDecoder( const std::string& filename )
|
||||
static ImageDecoder findDecoder( const cv::String& filename )
|
||||
{
|
||||
size_t i, maxlen = 0;
|
||||
for( i = 0; i < codecs.decoders.size(); i++ )
|
||||
@@ -108,8 +108,8 @@ static ImageDecoder findDecoder( const std::string& filename )
|
||||
FILE* f= fopen( filename.c_str(), "rb" );
|
||||
if( !f )
|
||||
return ImageDecoder();
|
||||
std::string signature(maxlen, ' ');
|
||||
maxlen = fread( &signature[0], 1, maxlen, f );
|
||||
cv::String signature(maxlen, ' ');
|
||||
maxlen = fread( (void*)signature.c_str(), 1, maxlen, f );
|
||||
fclose(f);
|
||||
signature = signature.substr(0, maxlen);
|
||||
|
||||
@@ -137,8 +137,8 @@ static ImageDecoder findDecoder( const Mat& buf )
|
||||
|
||||
size_t bufSize = buf.rows*buf.cols*buf.elemSize();
|
||||
maxlen = std::min(maxlen, bufSize);
|
||||
std::string signature(maxlen, ' ');
|
||||
memcpy( &signature[0], buf.data, maxlen );
|
||||
cv::String signature(maxlen, ' ');
|
||||
memcpy( (void*)signature.c_str(), buf.data, maxlen );
|
||||
|
||||
for( i = 0; i < codecs.decoders.size(); i++ )
|
||||
{
|
||||
@@ -149,7 +149,7 @@ static ImageDecoder findDecoder( const Mat& buf )
|
||||
return ImageDecoder();
|
||||
}
|
||||
|
||||
static ImageEncoder findEncoder( const std::string& _ext )
|
||||
static ImageEncoder findEncoder( const cv::String& _ext )
|
||||
{
|
||||
if( _ext.size() <= 1 )
|
||||
return ImageEncoder();
|
||||
@@ -163,7 +163,7 @@ static ImageEncoder findEncoder( const std::string& _ext )
|
||||
|
||||
for( size_t i = 0; i < codecs.encoders.size(); i++ )
|
||||
{
|
||||
std::string description = codecs.encoders[i]->getDescription();
|
||||
cv::String description = codecs.encoders[i]->getDescription();
|
||||
const char* descr = strchr( description.c_str(), '(' );
|
||||
|
||||
while( descr )
|
||||
@@ -191,7 +191,7 @@ static ImageEncoder findEncoder( const std::string& _ext )
|
||||
enum { LOAD_CVMAT=0, LOAD_IMAGE=1, LOAD_MAT=2 };
|
||||
|
||||
static void*
|
||||
imread_( const std::string& filename, int flags, int hdrtype, Mat* mat=0 )
|
||||
imread_( const cv::String& filename, int flags, int hdrtype, Mat* mat=0 )
|
||||
{
|
||||
IplImage* image = 0;
|
||||
CvMat *matrix = 0;
|
||||
@@ -253,14 +253,14 @@ imread_( const std::string& filename, int flags, int hdrtype, Mat* mat=0 )
|
||||
hdrtype == LOAD_IMAGE ? (void*)image : (void*)mat;
|
||||
}
|
||||
|
||||
Mat imread( const std::string& filename, int flags )
|
||||
Mat imread( const cv::String& filename, int flags )
|
||||
{
|
||||
Mat img;
|
||||
imread_( filename, flags, LOAD_MAT, &img );
|
||||
return img;
|
||||
}
|
||||
|
||||
static bool imwrite_( const std::string& filename, const Mat& image,
|
||||
static bool imwrite_( const cv::String& filename, const Mat& image,
|
||||
const std::vector<int>& params, bool flipv )
|
||||
{
|
||||
Mat temp;
|
||||
@@ -292,7 +292,7 @@ static bool imwrite_( const std::string& filename, const Mat& image,
|
||||
return code;
|
||||
}
|
||||
|
||||
bool imwrite( const std::string& filename, InputArray _img,
|
||||
bool imwrite( const cv::String& filename, InputArray _img,
|
||||
const std::vector<int>& params )
|
||||
{
|
||||
Mat img = _img.getMat();
|
||||
@@ -306,7 +306,7 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 )
|
||||
IplImage* image = 0;
|
||||
CvMat *matrix = 0;
|
||||
Mat temp, *data = &temp;
|
||||
std::string filename;
|
||||
cv::String filename;
|
||||
|
||||
ImageDecoder decoder = findDecoder(buf);
|
||||
if( decoder.empty() )
|
||||
@@ -400,7 +400,7 @@ Mat imdecode( InputArray _buf, int flags, Mat* dst )
|
||||
return *dst;
|
||||
}
|
||||
|
||||
bool imencode( const std::string& ext, InputArray _image,
|
||||
bool imencode( const cv::String& ext, InputArray _image,
|
||||
std::vector<uchar>& buf, const std::vector<int>& params )
|
||||
{
|
||||
Mat image = _image.getMat();
|
||||
@@ -429,7 +429,7 @@ bool imencode( const std::string& ext, InputArray _image,
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string filename = tempfile();
|
||||
cv::String filename = tempfile();
|
||||
code = encoder->setDestination(filename);
|
||||
CV_Assert( code );
|
||||
|
||||
|
@@ -153,12 +153,12 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
|
||||
}
|
||||
}
|
||||
|
||||
void cv::namedWindow( const std::string& winname, int flags )
|
||||
void cv::namedWindow( const cv::String& winname, int flags )
|
||||
{
|
||||
cvNamedWindow( winname.c_str(), flags );
|
||||
}
|
||||
|
||||
void cv::destroyWindow( const std::string& winname )
|
||||
void cv::destroyWindow( const cv::String& winname )
|
||||
{
|
||||
cvDestroyWindow( winname.c_str() );
|
||||
}
|
||||
@@ -168,22 +168,22 @@ void cv::destroyAllWindows()
|
||||
cvDestroyAllWindows();
|
||||
}
|
||||
|
||||
void cv::resizeWindow( const std::string& winname, int width, int height )
|
||||
void cv::resizeWindow( const cv::String& winname, int width, int height )
|
||||
{
|
||||
cvResizeWindow( winname.c_str(), width, height );
|
||||
}
|
||||
|
||||
void cv::moveWindow( const std::string& winname, int x, int y )
|
||||
void cv::moveWindow( const cv::String& winname, int x, int y )
|
||||
{
|
||||
cvMoveWindow( winname.c_str(), x, y );
|
||||
}
|
||||
|
||||
void cv::setWindowProperty(const std::string& winname, int prop_id, double prop_value)
|
||||
void cv::setWindowProperty(const cv::String& winname, int prop_id, double prop_value)
|
||||
{
|
||||
cvSetWindowProperty( winname.c_str(), prop_id, prop_value);
|
||||
}
|
||||
|
||||
double cv::getWindowProperty(const std::string& winname, int prop_id)
|
||||
double cv::getWindowProperty(const cv::String& winname, int prop_id)
|
||||
{
|
||||
return cvGetWindowProperty(winname.c_str(), prop_id);
|
||||
}
|
||||
@@ -193,7 +193,7 @@ int cv::waitKey(int delay)
|
||||
return cvWaitKey(delay);
|
||||
}
|
||||
|
||||
int cv::createTrackbar(const std::string& trackbarName, const std::string& winName,
|
||||
int cv::createTrackbar(const cv::String& trackbarName, const cv::String& winName,
|
||||
int* value, int count, TrackbarCallback callback,
|
||||
void* userdata)
|
||||
{
|
||||
@@ -201,17 +201,17 @@ int cv::createTrackbar(const std::string& trackbarName, const std::string& winNa
|
||||
value, count, callback, userdata);
|
||||
}
|
||||
|
||||
void cv::setTrackbarPos( const std::string& trackbarName, const std::string& winName, int value )
|
||||
void cv::setTrackbarPos( const cv::String& trackbarName, const cv::String& winName, int value )
|
||||
{
|
||||
cvSetTrackbarPos(trackbarName.c_str(), winName.c_str(), value );
|
||||
}
|
||||
|
||||
int cv::getTrackbarPos( const std::string& trackbarName, const std::string& winName )
|
||||
int cv::getTrackbarPos( const cv::String& trackbarName, const cv::String& winName )
|
||||
{
|
||||
return cvGetTrackbarPos(trackbarName.c_str(), winName.c_str());
|
||||
}
|
||||
|
||||
void cv::setMouseCallback( const std::string& windowName, MouseCallback onMouse, void* param)
|
||||
void cv::setMouseCallback( const cv::String& windowName, MouseCallback onMouse, void* param)
|
||||
{
|
||||
cvSetMouseCallback(windowName.c_str(), onMouse, param);
|
||||
}
|
||||
@@ -223,17 +223,17 @@ int cv::startWindowThread()
|
||||
|
||||
// OpenGL support
|
||||
|
||||
void cv::setOpenGlDrawCallback(const std::string& name, OpenGlDrawCallback callback, void* userdata)
|
||||
void cv::setOpenGlDrawCallback(const cv::String& name, OpenGlDrawCallback callback, void* userdata)
|
||||
{
|
||||
cvSetOpenGlDrawCallback(name.c_str(), callback, userdata);
|
||||
}
|
||||
|
||||
void cv::setOpenGlContext(const std::string& windowName)
|
||||
void cv::setOpenGlContext(const cv::String& windowName)
|
||||
{
|
||||
cvSetOpenGlContext(windowName.c_str());
|
||||
}
|
||||
|
||||
void cv::updateWindow(const std::string& windowName)
|
||||
void cv::updateWindow(const cv::String& windowName)
|
||||
{
|
||||
cvUpdateWindow(windowName.c_str());
|
||||
}
|
||||
@@ -241,9 +241,9 @@ void cv::updateWindow(const std::string& windowName)
|
||||
#ifdef HAVE_OPENGL
|
||||
namespace
|
||||
{
|
||||
std::map<std::string, cv::ogl::Texture2D> wndTexs;
|
||||
std::map<std::string, cv::ogl::Texture2D> ownWndTexs;
|
||||
std::map<std::string, cv::ogl::Buffer> ownWndBufs;
|
||||
std::map<cv::String, cv::ogl::Texture2D> wndTexs;
|
||||
std::map<cv::String, cv::ogl::Texture2D> ownWndTexs;
|
||||
std::map<cv::String, cv::ogl::Buffer> ownWndBufs;
|
||||
|
||||
void glDrawTextureCallback(void* userdata)
|
||||
{
|
||||
@@ -254,7 +254,7 @@ namespace
|
||||
}
|
||||
#endif // HAVE_OPENGL
|
||||
|
||||
void cv::imshow( const std::string& winname, InputArray _img )
|
||||
void cv::imshow( const cv::String& winname, InputArray _img )
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
Mat img = _img.getMat();
|
||||
@@ -342,23 +342,23 @@ CV_IMPL void cvUpdateWindow(const char*)
|
||||
|
||||
#if defined (HAVE_QT)
|
||||
|
||||
CvFont cv::fontQt(const std::string& nameFont, int pointSize, Scalar color, int weight, int style, int /*spacing*/)
|
||||
CvFont cv::fontQt(const cv::String& nameFont, int pointSize, Scalar color, int weight, int style, int /*spacing*/)
|
||||
{
|
||||
return cvFontQt(nameFont.c_str(), pointSize,color,weight, style);
|
||||
}
|
||||
|
||||
void cv::addText( const Mat& img, const std::string& text, Point org, CvFont font)
|
||||
void cv::addText( const Mat& img, const cv::String& text, Point org, CvFont font)
|
||||
{
|
||||
CvMat _img = img;
|
||||
cvAddText( &_img, text.c_str(), org,&font);
|
||||
}
|
||||
|
||||
void cv::displayStatusBar(const std::string& name, const std::string& text, int delayms)
|
||||
void cv::displayStatusBar(const cv::String& name, const cv::String& text, int delayms)
|
||||
{
|
||||
cvDisplayStatusBar(name.c_str(),text.c_str(), delayms);
|
||||
}
|
||||
|
||||
void cv::displayOverlay(const std::string& name, const std::string& text, int delayms)
|
||||
void cv::displayOverlay(const cv::String& name, const cv::String& text, int delayms)
|
||||
{
|
||||
cvDisplayOverlay(name.c_str(),text.c_str(), delayms);
|
||||
}
|
||||
@@ -373,40 +373,40 @@ void cv::stopLoop()
|
||||
cvStopLoop();
|
||||
}
|
||||
|
||||
void cv::saveWindowParameters(const std::string& windowName)
|
||||
void cv::saveWindowParameters(const cv::String& windowName)
|
||||
{
|
||||
cvSaveWindowParameters(windowName.c_str());
|
||||
}
|
||||
|
||||
void cv::loadWindowParameters(const std::string& windowName)
|
||||
void cv::loadWindowParameters(const cv::String& windowName)
|
||||
{
|
||||
cvLoadWindowParameters(windowName.c_str());
|
||||
}
|
||||
|
||||
int cv::createButton(const std::string& button_name, ButtonCallback on_change, void* userdata, int button_type , bool initial_button_state )
|
||||
int cv::createButton(const cv::String& button_name, ButtonCallback on_change, void* userdata, int button_type , bool initial_button_state )
|
||||
{
|
||||
return cvCreateButton(button_name.c_str(), on_change, userdata, button_type , initial_button_state );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
CvFont cv::fontQt(const std::string&, int, Scalar, int, int, int)
|
||||
CvFont cv::fontQt(const cv::String&, int, Scalar, int, int, int)
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
|
||||
return CvFont();
|
||||
}
|
||||
|
||||
void cv::addText( const Mat&, const std::string&, Point, CvFont)
|
||||
void cv::addText( const Mat&, const cv::String&, Point, CvFont)
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
|
||||
}
|
||||
|
||||
void cv::displayStatusBar(const std::string&, const std::string&, int)
|
||||
void cv::displayStatusBar(const cv::String&, const cv::String&, int)
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
|
||||
}
|
||||
|
||||
void cv::displayOverlay(const std::string&, const std::string&, int )
|
||||
void cv::displayOverlay(const cv::String&, const cv::String&, int )
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
|
||||
}
|
||||
@@ -422,17 +422,17 @@ void cv::stopLoop()
|
||||
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
|
||||
}
|
||||
|
||||
void cv::saveWindowParameters(const std::string&)
|
||||
void cv::saveWindowParameters(const cv::String&)
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
|
||||
}
|
||||
|
||||
void cv::loadWindowParameters(const std::string&)
|
||||
void cv::loadWindowParameters(const cv::String&)
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
|
||||
}
|
||||
|
||||
int cv::createButton(const std::string&, ButtonCallback, void*, int , bool )
|
||||
int cv::createButton(const cv::String&, ButtonCallback, void*, int , bool )
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user