Drop cv:: prefix from cv::String used inside the cv namespace

This commit is contained in:
Andrey Kamaev
2013-03-22 20:37:49 +04:00
parent 75513a46dc
commit be7bbe3aa9
122 changed files with 1077 additions and 1077 deletions

View File

@@ -110,7 +110,7 @@ void RBaseStream::readBlock()
}
bool RBaseStream::open( const cv::String& filename )
bool RBaseStream::open( const String& filename )
{
close();
allocate();
@@ -388,7 +388,7 @@ void WBaseStream::writeBlock()
}
bool WBaseStream::open( const cv::String& filename )
bool WBaseStream::open( const String& filename )
{
close();
allocate();

View File

@@ -66,7 +66,7 @@ public:
RBaseStream();
virtual ~RBaseStream();
virtual bool open( const cv::String& filename );
virtual bool open( const 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 cv::String& filename );
virtual bool open( const String& filename );
virtual bool open( std::vector<uchar>& buf );
virtual void close();
bool isOpened();

View File

@@ -445,7 +445,7 @@ namespace cv
VideoCapture::VideoCapture()
{}
VideoCapture::VideoCapture(const cv::String& filename)
VideoCapture::VideoCapture(const String& filename)
{
open(filename);
}
@@ -460,7 +460,7 @@ VideoCapture::~VideoCapture()
cap.release();
}
bool VideoCapture::open(const cv::String& filename)
bool VideoCapture::open(const String& filename)
{
if (!isOpened())
cap = cvCreateFileCapture(filename.c_str());
@@ -532,7 +532,7 @@ double VideoCapture::get(int propId)
VideoWriter::VideoWriter()
{}
VideoWriter::VideoWriter(const cv::String& filename, int fourcc, double fps, Size frameSize, bool isColor)
VideoWriter::VideoWriter(const 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 cv::String& filename, int fourcc, double fps, Size frameSize, bool isColor)
bool VideoWriter::open(const String& filename, int fourcc, double fps, Size frameSize, bool isColor)
{
writer = cvCreateVideoWriter(filename.c_str(), fourcc, fps, frameSize, isColor);
return isOpened();

View File

@@ -54,7 +54,7 @@ BaseImageDecoder::BaseImageDecoder()
m_buf_supported = false;
}
bool BaseImageDecoder::setSource( const cv::String& filename )
bool BaseImageDecoder::setSource( const 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 = cv::String();
m_filename = String();
m_buf = buf;
return true;
}
@@ -75,7 +75,7 @@ size_t BaseImageDecoder::signatureLength() const
return m_signature.size();
}
bool BaseImageDecoder::checkSignature( const cv::String& signature ) const
bool BaseImageDecoder::checkSignature( const 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;
}
cv::String BaseImageEncoder::getDescription() const
String BaseImageEncoder::getDescription() const
{
return m_description;
}
bool BaseImageEncoder::setDestination( const cv::String& filename )
bool BaseImageEncoder::setDestination( const 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 = cv::String();
m_filename = String();
return true;
}
@@ -127,7 +127,7 @@ void BaseImageEncoder::throwOnEror() const
{
if(!m_last_error.empty())
{
cv::String msg = "Raw image encoder error: " + m_last_error;
String msg = "Raw image encoder error: " + m_last_error;
CV_Error( CV_BadImageSize, msg.c_str() );
}
}

View File

@@ -65,21 +65,21 @@ public:
int height() const { return m_height; };
virtual int type() const { return m_type; };
virtual bool setSource( const cv::String& filename );
virtual bool setSource( const 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 cv::String& signature ) const;
virtual bool checkSignature( const 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;
cv::String m_filename;
cv::String m_signature;
String m_filename;
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 cv::String& filename );
virtual bool setDestination( const String& filename );
virtual bool setDestination( std::vector<uchar>& buf );
virtual bool write( const Mat& img, const std::vector<int>& params ) = 0;
virtual cv::String getDescription() const;
virtual String getDescription() const;
virtual ImageEncoder newEncoder() const;
virtual void throwOnEror() const;
protected:
cv::String m_description;
String m_description;
cv::String m_filename;
String m_filename;
std::vector<uchar>* m_buf;
bool m_buf_supported;
cv::String m_last_error;
String m_last_error;
};
}

View File

@@ -82,7 +82,7 @@ static JasperInitializer initialize_jasper;
Jpeg2KDecoder::Jpeg2KDecoder()
{
m_signature = '\0' + cv::String() + '\0' + cv::String() + '\0' + cv::String("\x0cjP \r\n\x87\n");
m_signature = '\0' + String() + '\0' + String() + '\0' + String("\x0cjP \r\n\x87\n");
m_stream = 0;
m_image = 0;
}

View File

@@ -107,7 +107,7 @@ size_t PxMDecoder::signatureLength() const
return 3;
}
bool PxMDecoder::checkSignature( const cv::String& signature ) const
bool PxMDecoder::checkSignature( const String& signature ) const
{
return signature.size() >= 3 && signature[0] == 'P' &&
'1' <= signature[1] && signature[1] <= '6' &&

View File

@@ -61,7 +61,7 @@ public:
void close();
size_t signatureLength() const;
bool checkSignature( const cv::String& signature ) const;
bool checkSignature( const String& signature ) const;
ImageDecoder newDecoder() const;
protected:

View File

@@ -94,7 +94,7 @@ size_t TiffDecoder::signatureLength() const
return 4;
}
bool TiffDecoder::checkSignature( const cv::String& signature ) const
bool TiffDecoder::checkSignature( const String& signature ) const
{
return signature.size() >= 4 &&
(memcmp(signature.c_str(), fmtSignTiffII, 4) == 0 ||

View File

@@ -102,7 +102,7 @@ public:
void close();
size_t signatureLength() const;
bool checkSignature( const cv::String& signature ) const;
bool checkSignature( const String& signature ) const;
ImageDecoder newDecoder() const;
protected:

View File

@@ -71,7 +71,7 @@ ImageDecoder WebPDecoder::newDecoder() const
return new WebPDecoder;
}
bool WebPDecoder::checkSignature( const cv::String& signature ) const
bool WebPDecoder::checkSignature( const String& signature ) const
{
size_t len = signatureLength();
bool ret = false;

View File

@@ -60,7 +60,7 @@ public:
bool readData( Mat& img );
bool readHeader();
void close();
bool checkSignature( const cv::String& signature ) const;
bool checkSignature( const String& signature ) const;
ImageDecoder newDecoder() const;

View File

@@ -96,7 +96,7 @@ struct ImageCodecInitializer
static ImageCodecInitializer codecs;
static ImageDecoder findDecoder( const cv::String& filename )
static ImageDecoder findDecoder( const String& filename )
{
size_t i, maxlen = 0;
for( i = 0; i < codecs.decoders.size(); i++ )
@@ -108,7 +108,7 @@ static ImageDecoder findDecoder( const cv::String& filename )
FILE* f= fopen( filename.c_str(), "rb" );
if( !f )
return ImageDecoder();
cv::String signature(maxlen, ' ');
String signature(maxlen, ' ');
maxlen = fread( (void*)signature.c_str(), 1, maxlen, f );
fclose(f);
signature = signature.substr(0, maxlen);
@@ -137,7 +137,7 @@ static ImageDecoder findDecoder( const Mat& buf )
size_t bufSize = buf.rows*buf.cols*buf.elemSize();
maxlen = std::min(maxlen, bufSize);
cv::String signature(maxlen, ' ');
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 cv::String& _ext )
static ImageEncoder findEncoder( const String& _ext )
{
if( _ext.size() <= 1 )
return ImageEncoder();
@@ -163,7 +163,7 @@ static ImageEncoder findEncoder( const cv::String& _ext )
for( size_t i = 0; i < codecs.encoders.size(); i++ )
{
cv::String description = codecs.encoders[i]->getDescription();
String description = codecs.encoders[i]->getDescription();
const char* descr = strchr( description.c_str(), '(' );
while( descr )
@@ -191,7 +191,7 @@ static ImageEncoder findEncoder( const cv::String& _ext )
enum { LOAD_CVMAT=0, LOAD_IMAGE=1, LOAD_MAT=2 };
static void*
imread_( const cv::String& filename, int flags, int hdrtype, Mat* mat=0 )
imread_( const String& filename, int flags, int hdrtype, Mat* mat=0 )
{
IplImage* image = 0;
CvMat *matrix = 0;
@@ -253,14 +253,14 @@ imread_( const cv::String& filename, int flags, int hdrtype, Mat* mat=0 )
hdrtype == LOAD_IMAGE ? (void*)image : (void*)mat;
}
Mat imread( const cv::String& filename, int flags )
Mat imread( const String& filename, int flags )
{
Mat img;
imread_( filename, flags, LOAD_MAT, &img );
return img;
}
static bool imwrite_( const cv::String& filename, const Mat& image,
static bool imwrite_( const String& filename, const Mat& image,
const std::vector<int>& params, bool flipv )
{
Mat temp;
@@ -292,7 +292,7 @@ static bool imwrite_( const cv::String& filename, const Mat& image,
return code;
}
bool imwrite( const cv::String& filename, InputArray _img,
bool imwrite( const 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;
cv::String filename;
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 cv::String& ext, InputArray _image,
bool imencode( const String& ext, InputArray _image,
std::vector<uchar>& buf, const std::vector<int>& params )
{
Mat image = _image.getMat();
@@ -429,7 +429,7 @@ bool imencode( const cv::String& ext, InputArray _image,
}
else
{
cv::String filename = tempfile();
String filename = tempfile();
code = encoder->setDestination(filename);
CV_Assert( code );

View File

@@ -153,12 +153,12 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
}
}
void cv::namedWindow( const cv::String& winname, int flags )
void cv::namedWindow( const String& winname, int flags )
{
cvNamedWindow( winname.c_str(), flags );
}
void cv::destroyWindow( const cv::String& winname )
void cv::destroyWindow( const String& winname )
{
cvDestroyWindow( winname.c_str() );
}
@@ -168,22 +168,22 @@ void cv::destroyAllWindows()
cvDestroyAllWindows();
}
void cv::resizeWindow( const cv::String& winname, int width, int height )
void cv::resizeWindow( const String& winname, int width, int height )
{
cvResizeWindow( winname.c_str(), width, height );
}
void cv::moveWindow( const cv::String& winname, int x, int y )
void cv::moveWindow( const String& winname, int x, int y )
{
cvMoveWindow( winname.c_str(), x, y );
}
void cv::setWindowProperty(const cv::String& winname, int prop_id, double prop_value)
void cv::setWindowProperty(const String& winname, int prop_id, double prop_value)
{
cvSetWindowProperty( winname.c_str(), prop_id, prop_value);
}
double cv::getWindowProperty(const cv::String& winname, int prop_id)
double cv::getWindowProperty(const 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 cv::String& trackbarName, const cv::String& winName,
int cv::createTrackbar(const String& trackbarName, const String& winName,
int* value, int count, TrackbarCallback callback,
void* userdata)
{
@@ -201,17 +201,17 @@ int cv::createTrackbar(const cv::String& trackbarName, const cv::String& winName
value, count, callback, userdata);
}
void cv::setTrackbarPos( const cv::String& trackbarName, const cv::String& winName, int value )
void cv::setTrackbarPos( const String& trackbarName, const String& winName, int value )
{
cvSetTrackbarPos(trackbarName.c_str(), winName.c_str(), value );
}
int cv::getTrackbarPos( const cv::String& trackbarName, const cv::String& winName )
int cv::getTrackbarPos( const String& trackbarName, const String& winName )
{
return cvGetTrackbarPos(trackbarName.c_str(), winName.c_str());
}
void cv::setMouseCallback( const cv::String& windowName, MouseCallback onMouse, void* param)
void cv::setMouseCallback( const 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 cv::String& name, OpenGlDrawCallback callback, void* userdata)
void cv::setOpenGlDrawCallback(const String& name, OpenGlDrawCallback callback, void* userdata)
{
cvSetOpenGlDrawCallback(name.c_str(), callback, userdata);
}
void cv::setOpenGlContext(const cv::String& windowName)
void cv::setOpenGlContext(const String& windowName)
{
cvSetOpenGlContext(windowName.c_str());
}
void cv::updateWindow(const cv::String& windowName)
void cv::updateWindow(const String& windowName)
{
cvUpdateWindow(windowName.c_str());
}
@@ -254,7 +254,7 @@ namespace
}
#endif // HAVE_OPENGL
void cv::imshow( const cv::String& winname, InputArray _img )
void cv::imshow( const 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 cv::String& nameFont, int pointSize, Scalar color, int weight, int style, int /*spacing*/)
CvFont cv::fontQt(const 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 cv::String& text, Point org, CvFont font)
void cv::addText( const Mat& img, const String& text, Point org, CvFont font)
{
CvMat _img = img;
cvAddText( &_img, text.c_str(), org,&font);
}
void cv::displayStatusBar(const cv::String& name, const cv::String& text, int delayms)
void cv::displayStatusBar(const String& name, const String& text, int delayms)
{
cvDisplayStatusBar(name.c_str(),text.c_str(), delayms);
}
void cv::displayOverlay(const cv::String& name, const cv::String& text, int delayms)
void cv::displayOverlay(const String& name, const String& text, int delayms)
{
cvDisplayOverlay(name.c_str(),text.c_str(), delayms);
}
@@ -373,40 +373,40 @@ void cv::stopLoop()
cvStopLoop();
}
void cv::saveWindowParameters(const cv::String& windowName)
void cv::saveWindowParameters(const String& windowName)
{
cvSaveWindowParameters(windowName.c_str());
}
void cv::loadWindowParameters(const cv::String& windowName)
void cv::loadWindowParameters(const String& windowName)
{
cvLoadWindowParameters(windowName.c_str());
}
int cv::createButton(const cv::String& button_name, ButtonCallback on_change, void* userdata, int button_type , bool initial_button_state )
int cv::createButton(const 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 cv::String&, int, Scalar, int, int, int)
CvFont cv::fontQt(const 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 cv::String&, Point, CvFont)
void cv::addText( const Mat&, const String&, Point, CvFont)
{
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
}
void cv::displayStatusBar(const cv::String&, const cv::String&, int)
void cv::displayStatusBar(const String&, const String&, int)
{
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
}
void cv::displayOverlay(const cv::String&, const cv::String&, int )
void cv::displayOverlay(const String&, const 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 cv::String&)
void cv::saveWindowParameters(const String&)
{
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
}
void cv::loadWindowParameters(const cv::String&)
void cv::loadWindowParameters(const String&)
{
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
}
int cv::createButton(const cv::String&, ButtonCallback, void*, int , bool )
int cv::createButton(const String&, ButtonCallback, void*, int , bool )
{
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
return 0;