mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Remove all using directives for STL namespace and members
Made all STL usages explicit to be able automatically find all usages of particular class or function.
This commit is contained in:
@@ -67,21 +67,21 @@ enum {
|
||||
WND_PROP_OPENGL = CV_WND_PROP_OPENGL // opengl support
|
||||
};
|
||||
|
||||
CV_EXPORTS_W void namedWindow(const string& winname, int flags = WINDOW_AUTOSIZE);
|
||||
CV_EXPORTS_W void destroyWindow(const string& winname);
|
||||
CV_EXPORTS_W void namedWindow(const std::string& winname, int flags = WINDOW_AUTOSIZE);
|
||||
CV_EXPORTS_W void destroyWindow(const std::string& winname);
|
||||
CV_EXPORTS_W void destroyAllWindows();
|
||||
|
||||
CV_EXPORTS_W int startWindowThread();
|
||||
|
||||
CV_EXPORTS_W int waitKey(int delay = 0);
|
||||
|
||||
CV_EXPORTS_W void imshow(const string& winname, InputArray mat);
|
||||
CV_EXPORTS_W void imshow(const std::string& winname, InputArray mat);
|
||||
|
||||
CV_EXPORTS_W void resizeWindow(const string& winname, int width, int height);
|
||||
CV_EXPORTS_W void moveWindow(const string& winname, int x, int y);
|
||||
CV_EXPORTS_W void resizeWindow(const std::string& winname, int width, int height);
|
||||
CV_EXPORTS_W void moveWindow(const std::string& winname, int x, int y);
|
||||
|
||||
CV_EXPORTS_W void setWindowProperty(const string& winname, int prop_id, double prop_value);//YV
|
||||
CV_EXPORTS_W double getWindowProperty(const string& winname, int prop_id);//YV
|
||||
CV_EXPORTS_W void setWindowProperty(const std::string& winname, int prop_id, double prop_value);//YV
|
||||
CV_EXPORTS_W double getWindowProperty(const std::string& winname, int prop_id);//YV
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -110,45 +110,45 @@ enum
|
||||
typedef void (*MouseCallback)(int event, int x, int y, int flags, void* userdata);
|
||||
|
||||
//! assigns callback for mouse events
|
||||
CV_EXPORTS void setMouseCallback(const string& winname, MouseCallback onMouse, void* userdata = 0);
|
||||
CV_EXPORTS void setMouseCallback(const std::string& winname, MouseCallback onMouse, void* userdata = 0);
|
||||
|
||||
|
||||
typedef void (CV_CDECL *TrackbarCallback)(int pos, void* userdata);
|
||||
|
||||
CV_EXPORTS int createTrackbar(const string& trackbarname, const string& winname,
|
||||
CV_EXPORTS int createTrackbar(const std::string& trackbarname, const std::string& winname,
|
||||
int* value, int count,
|
||||
TrackbarCallback onChange = 0,
|
||||
void* userdata = 0);
|
||||
|
||||
CV_EXPORTS_W int getTrackbarPos(const string& trackbarname, const string& winname);
|
||||
CV_EXPORTS_W void setTrackbarPos(const string& trackbarname, const string& winname, int pos);
|
||||
CV_EXPORTS_W int getTrackbarPos(const std::string& trackbarname, const std::string& winname);
|
||||
CV_EXPORTS_W void setTrackbarPos(const std::string& trackbarname, const std::string& winname, int pos);
|
||||
|
||||
// OpenGL support
|
||||
|
||||
typedef void (*OpenGlDrawCallback)(void* userdata);
|
||||
CV_EXPORTS void setOpenGlDrawCallback(const string& winname, OpenGlDrawCallback onOpenGlDraw, void* userdata = 0);
|
||||
CV_EXPORTS void setOpenGlDrawCallback(const std::string& winname, OpenGlDrawCallback onOpenGlDraw, void* userdata = 0);
|
||||
|
||||
CV_EXPORTS void setOpenGlContext(const string& winname);
|
||||
CV_EXPORTS void setOpenGlContext(const std::string& winname);
|
||||
|
||||
CV_EXPORTS void updateWindow(const string& winname);
|
||||
CV_EXPORTS void updateWindow(const std::string& winname);
|
||||
|
||||
//Only for Qt
|
||||
|
||||
CV_EXPORTS CvFont fontQt(const string& nameFont, int pointSize=-1,
|
||||
CV_EXPORTS CvFont fontQt(const std::string& nameFont, int pointSize=-1,
|
||||
Scalar color=Scalar::all(0), int weight=CV_FONT_NORMAL,
|
||||
int style=CV_STYLE_NORMAL, int spacing=0);
|
||||
CV_EXPORTS void addText( const Mat& img, const string& text, Point org, CvFont font);
|
||||
CV_EXPORTS void addText( const Mat& img, const std::string& text, Point org, CvFont font);
|
||||
|
||||
CV_EXPORTS void displayOverlay(const string& winname, const string& text, int delayms CV_DEFAULT(0));
|
||||
CV_EXPORTS void displayStatusBar(const string& winname, const string& text, int delayms CV_DEFAULT(0));
|
||||
CV_EXPORTS void displayOverlay(const std::string& winname, const std::string& text, int delayms CV_DEFAULT(0));
|
||||
CV_EXPORTS void displayStatusBar(const std::string& winname, const std::string& text, int delayms CV_DEFAULT(0));
|
||||
|
||||
CV_EXPORTS void saveWindowParameters(const string& windowName);
|
||||
CV_EXPORTS void loadWindowParameters(const string& windowName);
|
||||
CV_EXPORTS void saveWindowParameters(const std::string& windowName);
|
||||
CV_EXPORTS void loadWindowParameters(const std::string& windowName);
|
||||
CV_EXPORTS int startLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[]);
|
||||
CV_EXPORTS void stopLoop();
|
||||
|
||||
typedef void (CV_CDECL *ButtonCallback)(int state, void* userdata);
|
||||
CV_EXPORTS int createButton( const string& bar_name, ButtonCallback on_change,
|
||||
CV_EXPORTS int createButton( const std::string& bar_name, ButtonCallback on_change,
|
||||
void* userdata=NULL, int type=CV_PUSH_BUTTON,
|
||||
bool initial_button_state=0);
|
||||
|
||||
@@ -182,14 +182,14 @@ enum
|
||||
IMWRITE_PXM_BINARY =32
|
||||
};
|
||||
|
||||
CV_EXPORTS_W Mat imread( const string& filename, int flags=1 );
|
||||
CV_EXPORTS_W bool imwrite( const string& filename, InputArray img,
|
||||
const vector<int>& params=vector<int>());
|
||||
CV_EXPORTS_W Mat imread( const std::string& filename, int flags=1 );
|
||||
CV_EXPORTS_W bool imwrite( const std::string& filename, InputArray img,
|
||||
const std::vector<int>& params=std::vector<int>());
|
||||
CV_EXPORTS_W Mat imdecode( InputArray buf, int flags );
|
||||
CV_EXPORTS Mat imdecode( InputArray buf, int flags, Mat* dst );
|
||||
CV_EXPORTS_W bool imencode( const string& ext, InputArray img,
|
||||
CV_OUT vector<uchar>& buf,
|
||||
const vector<int>& params=vector<int>());
|
||||
CV_EXPORTS_W bool imencode( const std::string& ext, InputArray img,
|
||||
CV_OUT std::vector<uchar>& buf,
|
||||
const std::vector<int>& params=std::vector<int>());
|
||||
|
||||
#ifndef CV_NO_VIDEO_CAPTURE_CPP_API
|
||||
|
||||
@@ -200,11 +200,11 @@ class CV_EXPORTS_W VideoCapture
|
||||
{
|
||||
public:
|
||||
CV_WRAP VideoCapture();
|
||||
CV_WRAP VideoCapture(const string& filename);
|
||||
CV_WRAP VideoCapture(const std::string& filename);
|
||||
CV_WRAP VideoCapture(int device);
|
||||
|
||||
virtual ~VideoCapture();
|
||||
CV_WRAP virtual bool open(const string& filename);
|
||||
CV_WRAP virtual bool open(const std::string& filename);
|
||||
CV_WRAP virtual bool open(int device);
|
||||
CV_WRAP virtual bool isOpened() const;
|
||||
CV_WRAP virtual void release();
|
||||
@@ -226,11 +226,11 @@ class CV_EXPORTS_W VideoWriter
|
||||
{
|
||||
public:
|
||||
CV_WRAP VideoWriter();
|
||||
CV_WRAP VideoWriter(const string& filename, int fourcc, double fps,
|
||||
CV_WRAP VideoWriter(const std::string& filename, int fourcc, double fps,
|
||||
Size frameSize, bool isColor=true);
|
||||
|
||||
virtual ~VideoWriter();
|
||||
CV_WRAP virtual bool open(const string& filename, int fourcc, double fps,
|
||||
CV_WRAP virtual bool open(const std::string& filename, int fourcc, double fps,
|
||||
Size frameSize, bool isColor=true);
|
||||
CV_WRAP virtual bool isOpened() const;
|
||||
CV_WRAP virtual void release();
|
||||
|
||||
@@ -9,7 +9,7 @@ using std::tr1::make_tuple;
|
||||
using std::tr1::get;
|
||||
|
||||
|
||||
typedef perf::TestBaseWithParam<String> VideoCapture_Reading;
|
||||
typedef perf::TestBaseWithParam<std::string> VideoCapture_Reading;
|
||||
|
||||
PERF_TEST_P(VideoCapture_Reading, ReadFile, testing::Values( "highgui/video/big_buck_bunny.avi",
|
||||
"highgui/video/big_buck_bunny.mov",
|
||||
|
||||
@@ -8,7 +8,7 @@ using namespace perf;
|
||||
using std::tr1::make_tuple;
|
||||
using std::tr1::get;
|
||||
|
||||
typedef std::tr1::tuple<String, bool> VideoWriter_Writing_t;
|
||||
typedef std::tr1::tuple<std::string, bool> VideoWriter_Writing_t;
|
||||
typedef perf::TestBaseWithParam<VideoWriter_Writing_t> VideoWriter_Writing;
|
||||
|
||||
PERF_TEST_P(VideoWriter_Writing, WriteFrame,
|
||||
|
||||
@@ -110,7 +110,7 @@ void RBaseStream::readBlock()
|
||||
}
|
||||
|
||||
|
||||
bool RBaseStream::open( const string& filename )
|
||||
bool RBaseStream::open( const std::string& filename )
|
||||
{
|
||||
close();
|
||||
allocate();
|
||||
@@ -388,7 +388,7 @@ void WBaseStream::writeBlock()
|
||||
}
|
||||
|
||||
|
||||
bool WBaseStream::open( const string& filename )
|
||||
bool WBaseStream::open( const std::string& filename )
|
||||
{
|
||||
close();
|
||||
allocate();
|
||||
@@ -403,7 +403,7 @@ bool WBaseStream::open( const string& filename )
|
||||
return m_file != 0;
|
||||
}
|
||||
|
||||
bool WBaseStream::open( vector<uchar>& buf )
|
||||
bool WBaseStream::open( std::vector<uchar>& buf )
|
||||
{
|
||||
close();
|
||||
allocate();
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
RBaseStream();
|
||||
virtual ~RBaseStream();
|
||||
|
||||
virtual bool open( const string& filename );
|
||||
virtual bool open( const std::string& filename );
|
||||
virtual bool open( const Mat& buf );
|
||||
virtual void close();
|
||||
bool isOpened();
|
||||
@@ -123,8 +123,8 @@ public:
|
||||
WBaseStream();
|
||||
virtual ~WBaseStream();
|
||||
|
||||
virtual bool open( const string& filename );
|
||||
virtual bool open( vector<uchar>& buf );
|
||||
virtual bool open( const std::string& filename );
|
||||
virtual bool open( std::vector<uchar>& buf );
|
||||
virtual void close();
|
||||
bool isOpened();
|
||||
int getPos();
|
||||
@@ -138,7 +138,7 @@ protected:
|
||||
int m_block_pos;
|
||||
FILE* m_file;
|
||||
bool m_is_opened;
|
||||
vector<uchar>* m_buf;
|
||||
std::vector<uchar>* m_buf;
|
||||
|
||||
virtual void writeBlock();
|
||||
virtual void release();
|
||||
|
||||
@@ -445,7 +445,7 @@ namespace cv
|
||||
VideoCapture::VideoCapture()
|
||||
{}
|
||||
|
||||
VideoCapture::VideoCapture(const string& filename)
|
||||
VideoCapture::VideoCapture(const std::string& filename)
|
||||
{
|
||||
open(filename);
|
||||
}
|
||||
@@ -460,7 +460,7 @@ VideoCapture::~VideoCapture()
|
||||
cap.release();
|
||||
}
|
||||
|
||||
bool VideoCapture::open(const string& filename)
|
||||
bool VideoCapture::open(const std::string& filename)
|
||||
{
|
||||
if (!isOpened())
|
||||
cap = cvCreateFileCapture(filename.c_str());
|
||||
@@ -532,7 +532,7 @@ double VideoCapture::get(int propId)
|
||||
VideoWriter::VideoWriter()
|
||||
{}
|
||||
|
||||
VideoWriter::VideoWriter(const string& filename, int fourcc, double fps, Size frameSize, bool isColor)
|
||||
VideoWriter::VideoWriter(const std::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 string& filename, int fourcc, double fps, Size frameSize, bool isColor)
|
||||
bool VideoWriter::open(const std::string& filename, int fourcc, double fps, Size frameSize, bool isColor)
|
||||
{
|
||||
writer = cvCreateVideoWriter(filename.c_str(), fourcc, fps, frameSize, isColor);
|
||||
return isOpened();
|
||||
|
||||
@@ -36,10 +36,6 @@
|
||||
#import <Foundation/NSException.h>
|
||||
|
||||
|
||||
//#import <QTKit/QTKit.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
/********************** Declaration of class headers ************************/
|
||||
|
||||
/*****************************************************************************
|
||||
|
||||
@@ -33,8 +33,6 @@
|
||||
#include <iostream>
|
||||
#import <QTKit/QTKit.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
/********************** Declaration of class headers ************************/
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -248,7 +246,7 @@ CvCaptureCAM::CvCaptureCAM(int cameraNum) {
|
||||
camNum = cameraNum;
|
||||
|
||||
if (!startCaptureDevice(camNum)) {
|
||||
cout << "Warning, camera failed to properly initialize!" << endl;
|
||||
std::cout << "Warning, camera failed to properly initialize!" << std::endl;
|
||||
started = 0;
|
||||
} else {
|
||||
started = 1;
|
||||
@@ -259,7 +257,7 @@ CvCaptureCAM::CvCaptureCAM(int cameraNum) {
|
||||
CvCaptureCAM::~CvCaptureCAM() {
|
||||
stopCaptureDevice();
|
||||
|
||||
cout << "Cleaned up camera." << endl;
|
||||
std::cout << "Cleaned up camera." << std::endl;
|
||||
}
|
||||
|
||||
int CvCaptureCAM::didStart() {
|
||||
@@ -320,7 +318,7 @@ int CvCaptureCAM::startCaptureDevice(int cameraNum) {
|
||||
arrayByAddingObjectsFromArray:[QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeMuxed]] retain];
|
||||
|
||||
if ([devices count] == 0) {
|
||||
cout << "QTKit didn't find any attached Video Input Devices!" << endl;
|
||||
std::cout << "QTKit didn't find any attached Video Input Devices!" << std::endl;
|
||||
[localpool drain];
|
||||
return 0;
|
||||
}
|
||||
@@ -340,7 +338,7 @@ int CvCaptureCAM::startCaptureDevice(int cameraNum) {
|
||||
|
||||
success = [device open:&error];
|
||||
if (!success) {
|
||||
cout << "QTKit failed to open a Video Capture Device" << endl;
|
||||
std::cout << "QTKit failed to open a Video Capture Device" << std::endl;
|
||||
[localpool drain];
|
||||
return 0;
|
||||
}
|
||||
@@ -351,7 +349,7 @@ int CvCaptureCAM::startCaptureDevice(int cameraNum) {
|
||||
success = [mCaptureSession addInput:mCaptureDeviceInput error:&error];
|
||||
|
||||
if (!success) {
|
||||
cout << "QTKit failed to start capture session with opened Capture Device" << endl;
|
||||
std::cout << "QTKit failed to start capture session with opened Capture Device" << std::endl;
|
||||
[localpool drain];
|
||||
return 0;
|
||||
}
|
||||
@@ -383,7 +381,7 @@ int CvCaptureCAM::startCaptureDevice(int cameraNum) {
|
||||
|
||||
success = [mCaptureSession addOutput:mCaptureDecompressedVideoOutput error:&error];
|
||||
if (!success) {
|
||||
cout << "QTKit failed to add Output to Capture Session" << endl;
|
||||
std::cout << "QTKit failed to add Output to Capture Session" << std::endl;
|
||||
[localpool drain];
|
||||
return 0;
|
||||
}
|
||||
@@ -525,7 +523,7 @@ didDropVideoFrameWithSampleBuffer:(QTSampleBuffer *)sampleBuffer
|
||||
(void)captureOutput;
|
||||
(void)sampleBuffer;
|
||||
(void)connection;
|
||||
cout << "Camera dropped frame!" << endl;
|
||||
std::cout << "Camera dropped frame!" << std::endl;
|
||||
}
|
||||
|
||||
-(IplImage*) getOutput {
|
||||
@@ -634,7 +632,7 @@ CvCaptureFile::CvCaptureFile(const char* filename) {
|
||||
forKey:QTMovieLoopsAttribute];
|
||||
|
||||
if (mCaptureSession == nil) {
|
||||
cout << "WARNING: Couldn't read movie file " << filename << endl;
|
||||
std::cout << "WARNING: Couldn't read movie file " << filename << std::endl;
|
||||
[localpool drain];
|
||||
started = 0;
|
||||
return;
|
||||
@@ -803,7 +801,7 @@ double CvCaptureFile::getProperty(int property_id){
|
||||
double retval;
|
||||
QTTime t;
|
||||
|
||||
//cerr << "get_prop"<<endl;
|
||||
//cerr << "get_prop"<<std::endl;
|
||||
switch (property_id) {
|
||||
case CV_CAP_PROP_POS_MSEC:
|
||||
[[mCaptureSession attributeForKey:QTMovieCurrentTimeAttribute] getValue:&t];
|
||||
@@ -926,8 +924,8 @@ CvVideoWriter_QT::CvVideoWriter_QT(const char* filename, int fourcc,
|
||||
cc[4] = 0;
|
||||
int cc2 = CV_FOURCC(cc[0], cc[1], cc[2], cc[3]);
|
||||
if (cc2!=fourcc) {
|
||||
cout << "WARNING: Didn't properly encode FourCC. Expected " << fourcc
|
||||
<< " but got " << cc2 << "." << endl;
|
||||
std::cout << "WARNING: Didn't properly encode FourCC. Expected " << fourcc
|
||||
<< " but got " << cc2 << "." << std::endl;
|
||||
}
|
||||
|
||||
codec = [[NSString stringWithCString:cc encoding:NSASCIIStringEncoding] retain];
|
||||
@@ -938,13 +936,13 @@ CvVideoWriter_QT::CvVideoWriter_QT(const char* filename, int fourcc,
|
||||
NSFileManager* files = [NSFileManager defaultManager];
|
||||
if ([files fileExistsAtPath:path]) {
|
||||
if (![files removeItemAtPath:path error:nil]) {
|
||||
cout << "WARNING: Failed to remove existing file " << [path cStringUsingEncoding:NSASCIIStringEncoding] << endl;
|
||||
std::cout << "WARNING: Failed to remove existing file " << [path cStringUsingEncoding:NSASCIIStringEncoding] << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
mMovie = [[QTMovie alloc] initToWritableFile:path error:&error];
|
||||
if (!mMovie) {
|
||||
cout << "WARNING: Could not create empty movie file container." << endl;
|
||||
std::cout << "WARNING: Could not create empty movie file container." << std::endl;
|
||||
[localpool drain];
|
||||
return;
|
||||
}
|
||||
@@ -1019,7 +1017,7 @@ bool CvVideoWriter_QT::writeFrame(const IplImage* image) {
|
||||
[NSNumber numberWithInt:100*movieFPS], QTTrackTimeScaleAttribute,nil]];
|
||||
|
||||
if (![mMovie updateMovieFile]) {
|
||||
cout << "Didn't successfully update movie file." << endl;
|
||||
std::cout << "Didn't successfully update movie file." << std::endl;
|
||||
}
|
||||
|
||||
[imageRep release];
|
||||
|
||||
@@ -54,7 +54,7 @@ BaseImageDecoder::BaseImageDecoder()
|
||||
m_buf_supported = false;
|
||||
}
|
||||
|
||||
bool BaseImageDecoder::setSource( const string& filename )
|
||||
bool BaseImageDecoder::setSource( const std::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 = string();
|
||||
m_filename = std::string();
|
||||
m_buf = buf;
|
||||
return true;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ size_t BaseImageDecoder::signatureLength() const
|
||||
return m_signature.size();
|
||||
}
|
||||
|
||||
bool BaseImageDecoder::checkSignature( const string& signature ) const
|
||||
bool BaseImageDecoder::checkSignature( const std::string& signature ) const
|
||||
{
|
||||
size_t len = signatureLength();
|
||||
return signature.size() >= len && memcmp( signature.c_str(), m_signature.c_str(), len ) == 0;
|
||||
@@ -96,25 +96,25 @@ bool BaseImageEncoder::isFormatSupported( int depth ) const
|
||||
return depth == CV_8U;
|
||||
}
|
||||
|
||||
string BaseImageEncoder::getDescription() const
|
||||
std::string BaseImageEncoder::getDescription() const
|
||||
{
|
||||
return m_description;
|
||||
}
|
||||
|
||||
bool BaseImageEncoder::setDestination( const string& filename )
|
||||
bool BaseImageEncoder::setDestination( const std::string& filename )
|
||||
{
|
||||
m_filename = filename;
|
||||
m_buf = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BaseImageEncoder::setDestination( vector<uchar>& buf )
|
||||
bool BaseImageEncoder::setDestination( std::vector<uchar>& buf )
|
||||
{
|
||||
if( !m_buf_supported )
|
||||
return false;
|
||||
m_buf = &buf;
|
||||
m_buf->clear();
|
||||
m_filename = string();
|
||||
m_filename = std::string();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,21 +65,21 @@ public:
|
||||
int height() const { return m_height; };
|
||||
virtual int type() const { return m_type; };
|
||||
|
||||
virtual bool setSource( const string& filename );
|
||||
virtual bool setSource( const std::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 string& signature ) const;
|
||||
virtual bool checkSignature( const std::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;
|
||||
string m_filename;
|
||||
string m_signature;
|
||||
std::string m_filename;
|
||||
std::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 string& filename );
|
||||
virtual bool setDestination( vector<uchar>& buf );
|
||||
virtual bool write( const Mat& img, const vector<int>& params ) = 0;
|
||||
virtual bool setDestination( const std::string& filename );
|
||||
virtual bool setDestination( std::vector<uchar>& buf );
|
||||
virtual bool write( const Mat& img, const std::vector<int>& params ) = 0;
|
||||
|
||||
virtual string getDescription() const;
|
||||
virtual std::string getDescription() const;
|
||||
virtual ImageEncoder newEncoder() const;
|
||||
|
||||
virtual void throwOnEror() const;
|
||||
|
||||
protected:
|
||||
string m_description;
|
||||
std::string m_description;
|
||||
|
||||
string m_filename;
|
||||
vector<uchar>* m_buf;
|
||||
std::string m_filename;
|
||||
std::vector<uchar>* m_buf;
|
||||
bool m_buf_supported;
|
||||
|
||||
string m_last_error;
|
||||
std::string m_last_error;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@ ImageEncoder BmpEncoder::newEncoder() const
|
||||
return new BmpEncoder;
|
||||
}
|
||||
|
||||
bool BmpEncoder::write( const Mat& img, const vector<int>& )
|
||||
bool BmpEncoder::write( const Mat& img, const std::vector<int>& )
|
||||
{
|
||||
int width = img.cols, height = img.rows, channels = img.channels();
|
||||
int fileStep = (width*channels + 3) & -4;
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
BmpEncoder();
|
||||
~BmpEncoder();
|
||||
|
||||
bool write( const Mat& img, const vector<int>& params );
|
||||
bool write( const Mat& img, const std::vector<int>& params );
|
||||
|
||||
ImageEncoder newEncoder() const;
|
||||
};
|
||||
|
||||
@@ -580,7 +580,7 @@ bool ExrEncoder::isFormatSupported( int depth ) const
|
||||
|
||||
|
||||
// TODO scale appropriately
|
||||
bool ExrEncoder::write( const Mat& img, const vector<int>& )
|
||||
bool ExrEncoder::write( const Mat& img, const std::vector<int>& )
|
||||
{
|
||||
int width = img.cols, height = img.rows;
|
||||
int depth = img.depth(), channels = img.channels();
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
~ExrEncoder();
|
||||
|
||||
bool isFormatSupported( int depth ) const;
|
||||
bool write( const Mat& img, const vector<int>& params );
|
||||
bool write( const Mat& img, const std::vector<int>& params );
|
||||
ImageEncoder newEncoder() const;
|
||||
};
|
||||
|
||||
|
||||
@@ -478,7 +478,7 @@ bool JpegDecoder::readData( Mat& img )
|
||||
struct JpegDestination
|
||||
{
|
||||
struct jpeg_destination_mgr pub;
|
||||
vector<uchar> *buf, *dst;
|
||||
std::vector<uchar> *buf, *dst;
|
||||
};
|
||||
|
||||
METHODDEF(void)
|
||||
@@ -537,7 +537,7 @@ ImageEncoder JpegEncoder::newEncoder() const
|
||||
return new JpegEncoder;
|
||||
}
|
||||
|
||||
bool JpegEncoder::write( const Mat& img, const vector<int>& params )
|
||||
bool JpegEncoder::write( const Mat& img, const std::vector<int>& params )
|
||||
{
|
||||
m_last_error.clear();
|
||||
|
||||
@@ -552,7 +552,7 @@ bool JpegEncoder::write( const Mat& img, const vector<int>& params )
|
||||
fileWrapper fw;
|
||||
int width = img.cols, height = img.rows;
|
||||
|
||||
vector<uchar> out_buf(1 << 12);
|
||||
std::vector<uchar> out_buf(1 << 12);
|
||||
AutoBuffer<uchar> _buffer;
|
||||
uchar* buffer;
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
JpegEncoder();
|
||||
virtual ~JpegEncoder();
|
||||
|
||||
bool write( const Mat& img, const vector<int>& params );
|
||||
bool write( const Mat& img, const std::vector<int>& params );
|
||||
ImageEncoder newEncoder() const;
|
||||
};
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ static JasperInitializer initialize_jasper;
|
||||
|
||||
Jpeg2KDecoder::Jpeg2KDecoder()
|
||||
{
|
||||
m_signature = '\0' + string() + '\0' + string() + '\0' + string("\x0cjP \r\n\x87\n");
|
||||
m_signature = '\0' + std::string() + '\0' + std::string() + '\0' + std::string("\x0cjP \r\n\x87\n");
|
||||
m_stream = 0;
|
||||
m_image = 0;
|
||||
}
|
||||
@@ -418,7 +418,7 @@ bool Jpeg2KEncoder::isFormatSupported( int depth ) const
|
||||
}
|
||||
|
||||
|
||||
bool Jpeg2KEncoder::write( const Mat& _img, const vector<int>& )
|
||||
bool Jpeg2KEncoder::write( const Mat& _img, const std::vector<int>& )
|
||||
{
|
||||
int width = _img.cols, height = _img.rows;
|
||||
int depth = _img.depth(), channels = _img.channels();
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
virtual ~Jpeg2KEncoder();
|
||||
|
||||
bool isFormatSupported( int depth ) const;
|
||||
bool write( const Mat& img, const vector<int>& params );
|
||||
bool write( const Mat& img, const std::vector<int>& params );
|
||||
ImageEncoder newEncoder() const;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -324,7 +324,7 @@ void PngEncoder::flushBuf(void*)
|
||||
{
|
||||
}
|
||||
|
||||
bool PngEncoder::write( const Mat& img, const vector<int>& params )
|
||||
bool PngEncoder::write( const Mat& img, const std::vector<int>& params )
|
||||
{
|
||||
png_structp png_ptr = png_create_write_struct( PNG_LIBPNG_VER_STRING, 0, 0, 0 );
|
||||
png_infop info_ptr = 0;
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
virtual ~PngEncoder();
|
||||
|
||||
bool isFormatSupported( int depth ) const;
|
||||
bool write( const Mat& img, const vector<int>& params );
|
||||
bool write( const Mat& img, const std::vector<int>& params );
|
||||
|
||||
ImageEncoder newEncoder() const;
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ size_t PxMDecoder::signatureLength() const
|
||||
return 3;
|
||||
}
|
||||
|
||||
bool PxMDecoder::checkSignature( const string& signature ) const
|
||||
bool PxMDecoder::checkSignature( const std::string& signature ) const
|
||||
{
|
||||
return signature.size() >= 3 && signature[0] == 'P' &&
|
||||
'1' <= signature[1] && signature[1] <= '6' &&
|
||||
@@ -367,7 +367,7 @@ bool PxMEncoder::isFormatSupported( int depth ) const
|
||||
}
|
||||
|
||||
|
||||
bool PxMEncoder::write( const Mat& img, const vector<int>& params )
|
||||
bool PxMEncoder::write( const Mat& img, const std::vector<int>& params )
|
||||
{
|
||||
bool isBinary = true;
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
void close();
|
||||
|
||||
size_t signatureLength() const;
|
||||
bool checkSignature( const string& signature ) const;
|
||||
bool checkSignature( const std::string& signature ) const;
|
||||
ImageDecoder newDecoder() const;
|
||||
|
||||
protected:
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
virtual ~PxMEncoder();
|
||||
|
||||
bool isFormatSupported( int depth ) const;
|
||||
bool write( const Mat& img, const vector<int>& params );
|
||||
bool write( const Mat& img, const std::vector<int>& params );
|
||||
|
||||
ImageEncoder newEncoder() const;
|
||||
};
|
||||
|
||||
@@ -395,7 +395,7 @@ SunRasterEncoder::~SunRasterEncoder()
|
||||
{
|
||||
}
|
||||
|
||||
bool SunRasterEncoder::write( const Mat& img, const vector<int>& )
|
||||
bool SunRasterEncoder::write( const Mat& img, const std::vector<int>& )
|
||||
{
|
||||
bool result = false;
|
||||
int y, width = img.cols, height = img.rows, channels = img.channels();
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
SunRasterEncoder();
|
||||
virtual ~SunRasterEncoder();
|
||||
|
||||
bool write( const Mat& img, const vector<int>& params );
|
||||
bool write( const Mat& img, const std::vector<int>& params );
|
||||
|
||||
ImageEncoder newEncoder() const;
|
||||
};
|
||||
|
||||
@@ -94,7 +94,7 @@ size_t TiffDecoder::signatureLength() const
|
||||
return 4;
|
||||
}
|
||||
|
||||
bool TiffDecoder::checkSignature( const string& signature ) const
|
||||
bool TiffDecoder::checkSignature( const std::string& signature ) const
|
||||
{
|
||||
return signature.size() >= 4 &&
|
||||
(memcmp(signature.c_str(), fmtSignTiffII, 4) == 0 ||
|
||||
@@ -402,7 +402,7 @@ void TiffEncoder::writeTag( WLByteStream& strm, TiffTag tag,
|
||||
|
||||
#ifdef HAVE_TIFF
|
||||
|
||||
static void readParam(const vector<int>& params, int key, int& value)
|
||||
static void readParam(const std::vector<int>& params, int key, int& value)
|
||||
{
|
||||
for(size_t i = 0; i + 1 < params.size(); i += 2)
|
||||
if(params[i] == key)
|
||||
@@ -412,7 +412,7 @@ static void readParam(const vector<int>& params, int key, int& value)
|
||||
}
|
||||
}
|
||||
|
||||
bool TiffEncoder::writeLibTiff( const Mat& img, const vector<int>& params)
|
||||
bool TiffEncoder::writeLibTiff( const Mat& img, const std::vector<int>& params)
|
||||
{
|
||||
int channels = img.channels();
|
||||
int width = img.cols, height = img.rows;
|
||||
@@ -542,9 +542,9 @@ bool TiffEncoder::writeLibTiff( const Mat& img, const vector<int>& params)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TIFF
|
||||
bool TiffEncoder::write( const Mat& img, const vector<int>& params)
|
||||
bool TiffEncoder::write( const Mat& img, const std::vector<int>& params)
|
||||
#else
|
||||
bool TiffEncoder::write( const Mat& img, const vector<int>& /*params*/)
|
||||
bool TiffEncoder::write( const Mat& img, const std::vector<int>& /*params*/)
|
||||
#endif
|
||||
{
|
||||
int channels = img.channels();
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
void close();
|
||||
|
||||
size_t signatureLength() const;
|
||||
bool checkSignature( const string& signature ) const;
|
||||
bool checkSignature( const std::string& signature ) const;
|
||||
ImageDecoder newDecoder() const;
|
||||
|
||||
protected:
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
|
||||
bool isFormatSupported( int depth ) const;
|
||||
|
||||
bool write( const Mat& img, const vector<int>& params );
|
||||
bool write( const Mat& img, const std::vector<int>& params );
|
||||
ImageEncoder newEncoder() const;
|
||||
|
||||
protected:
|
||||
@@ -128,7 +128,7 @@ protected:
|
||||
TiffFieldType fieldType,
|
||||
int count, int value );
|
||||
|
||||
bool writeLibTiff( const Mat& img, const vector<int>& params );
|
||||
bool writeLibTiff( const Mat& img, const std::vector<int>& params );
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -86,13 +86,13 @@ struct ImageCodecInitializer
|
||||
#endif
|
||||
}
|
||||
|
||||
vector<ImageDecoder> decoders;
|
||||
vector<ImageEncoder> encoders;
|
||||
std::vector<ImageDecoder> decoders;
|
||||
std::vector<ImageEncoder> encoders;
|
||||
};
|
||||
|
||||
static ImageCodecInitializer codecs;
|
||||
|
||||
static ImageDecoder findDecoder( const string& filename )
|
||||
static ImageDecoder findDecoder( const std::string& filename )
|
||||
{
|
||||
size_t i, maxlen = 0;
|
||||
for( i = 0; i < codecs.decoders.size(); i++ )
|
||||
@@ -104,7 +104,7 @@ static ImageDecoder findDecoder( const string& filename )
|
||||
FILE* f= fopen( filename.c_str(), "rb" );
|
||||
if( !f )
|
||||
return ImageDecoder();
|
||||
string signature(maxlen, ' ');
|
||||
std::string signature(maxlen, ' ');
|
||||
maxlen = fread( &signature[0], 1, maxlen, f );
|
||||
fclose(f);
|
||||
signature = signature.substr(0, maxlen);
|
||||
@@ -133,7 +133,7 @@ static ImageDecoder findDecoder( const Mat& buf )
|
||||
|
||||
size_t bufSize = buf.rows*buf.cols*buf.elemSize();
|
||||
maxlen = std::min(maxlen, bufSize);
|
||||
string signature(maxlen, ' ');
|
||||
std::string signature(maxlen, ' ');
|
||||
memcpy( &signature[0], buf.data, maxlen );
|
||||
|
||||
for( i = 0; i < codecs.decoders.size(); i++ )
|
||||
@@ -145,7 +145,7 @@ static ImageDecoder findDecoder( const Mat& buf )
|
||||
return ImageDecoder();
|
||||
}
|
||||
|
||||
static ImageEncoder findEncoder( const string& _ext )
|
||||
static ImageEncoder findEncoder( const std::string& _ext )
|
||||
{
|
||||
if( _ext.size() <= 1 )
|
||||
return ImageEncoder();
|
||||
@@ -159,7 +159,7 @@ static ImageEncoder findEncoder( const string& _ext )
|
||||
|
||||
for( size_t i = 0; i < codecs.encoders.size(); i++ )
|
||||
{
|
||||
string description = codecs.encoders[i]->getDescription();
|
||||
std::string description = codecs.encoders[i]->getDescription();
|
||||
const char* descr = strchr( description.c_str(), '(' );
|
||||
|
||||
while( descr )
|
||||
@@ -187,7 +187,7 @@ static ImageEncoder findEncoder( const string& _ext )
|
||||
enum { LOAD_CVMAT=0, LOAD_IMAGE=1, LOAD_MAT=2 };
|
||||
|
||||
static void*
|
||||
imread_( const string& filename, int flags, int hdrtype, Mat* mat=0 )
|
||||
imread_( const std::string& filename, int flags, int hdrtype, Mat* mat=0 )
|
||||
{
|
||||
IplImage* image = 0;
|
||||
CvMat *matrix = 0;
|
||||
@@ -249,15 +249,15 @@ imread_( const string& filename, int flags, int hdrtype, Mat* mat=0 )
|
||||
hdrtype == LOAD_IMAGE ? (void*)image : (void*)mat;
|
||||
}
|
||||
|
||||
Mat imread( const string& filename, int flags )
|
||||
Mat imread( const std::string& filename, int flags )
|
||||
{
|
||||
Mat img;
|
||||
imread_( filename, flags, LOAD_MAT, &img );
|
||||
return img;
|
||||
}
|
||||
|
||||
static bool imwrite_( const string& filename, const Mat& image,
|
||||
const vector<int>& params, bool flipv )
|
||||
static bool imwrite_( const std::string& filename, const Mat& image,
|
||||
const std::vector<int>& params, bool flipv )
|
||||
{
|
||||
Mat temp;
|
||||
const Mat* pimage = ℑ
|
||||
@@ -288,8 +288,8 @@ static bool imwrite_( const string& filename, const Mat& image,
|
||||
return code;
|
||||
}
|
||||
|
||||
bool imwrite( const string& filename, InputArray _img,
|
||||
const vector<int>& params )
|
||||
bool imwrite( const std::string& filename, InputArray _img,
|
||||
const std::vector<int>& params )
|
||||
{
|
||||
Mat img = _img.getMat();
|
||||
return imwrite_(filename, img, params, false);
|
||||
@@ -302,7 +302,7 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 )
|
||||
IplImage* image = 0;
|
||||
CvMat *matrix = 0;
|
||||
Mat temp, *data = &temp;
|
||||
string filename;
|
||||
std::string filename;
|
||||
|
||||
ImageDecoder decoder = findDecoder(buf);
|
||||
if( decoder.empty() )
|
||||
@@ -396,8 +396,8 @@ Mat imdecode( InputArray _buf, int flags, Mat* dst )
|
||||
return *dst;
|
||||
}
|
||||
|
||||
bool imencode( const string& ext, InputArray _image,
|
||||
vector<uchar>& buf, const vector<int>& params )
|
||||
bool imencode( const std::string& ext, InputArray _image,
|
||||
std::vector<uchar>& buf, const std::vector<int>& params )
|
||||
{
|
||||
Mat image = _image.getMat();
|
||||
|
||||
@@ -425,7 +425,7 @@ bool imencode( const string& ext, InputArray _image,
|
||||
}
|
||||
else
|
||||
{
|
||||
string filename = tempfile();
|
||||
std::string filename = tempfile();
|
||||
code = encoder->setDestination(filename);
|
||||
CV_Assert( code );
|
||||
|
||||
@@ -487,7 +487,7 @@ cvSaveImage( const char* filename, const CvArr* arr, const int* _params )
|
||||
;
|
||||
}
|
||||
return cv::imwrite_(filename, cv::cvarrToMat(arr),
|
||||
i > 0 ? cv::vector<int>(_params, _params+i) : cv::vector<int>(),
|
||||
i > 0 ? std::vector<int>(_params, _params+i) : std::vector<int>(),
|
||||
CV_IS_IMAGE(arr) && ((const IplImage*)arr)->origin == IPL_ORIGIN_BL );
|
||||
}
|
||||
|
||||
@@ -524,7 +524,7 @@ cvEncodeImage( const char* ext, const CvArr* arr, const int* _params )
|
||||
cv::flip(img, temp, 0);
|
||||
img = temp;
|
||||
}
|
||||
cv::vector<uchar> buf;
|
||||
std::vector<uchar> buf;
|
||||
|
||||
bool code = cv::imencode(ext, img, buf,
|
||||
i > 0 ? std::vector<int>(_params, _params+i) : std::vector<int>() );
|
||||
|
||||
@@ -153,12 +153,12 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
|
||||
}
|
||||
}
|
||||
|
||||
void cv::namedWindow( const string& winname, int flags )
|
||||
void cv::namedWindow( const std::string& winname, int flags )
|
||||
{
|
||||
cvNamedWindow( winname.c_str(), flags );
|
||||
}
|
||||
|
||||
void cv::destroyWindow( const string& winname )
|
||||
void cv::destroyWindow( const std::string& winname )
|
||||
{
|
||||
cvDestroyWindow( winname.c_str() );
|
||||
}
|
||||
@@ -168,22 +168,22 @@ void cv::destroyAllWindows()
|
||||
cvDestroyAllWindows();
|
||||
}
|
||||
|
||||
void cv::resizeWindow( const string& winname, int width, int height )
|
||||
void cv::resizeWindow( const std::string& winname, int width, int height )
|
||||
{
|
||||
cvResizeWindow( winname.c_str(), width, height );
|
||||
}
|
||||
|
||||
void cv::moveWindow( const string& winname, int x, int y )
|
||||
void cv::moveWindow( const std::string& winname, int x, int y )
|
||||
{
|
||||
cvMoveWindow( winname.c_str(), x, y );
|
||||
}
|
||||
|
||||
void cv::setWindowProperty(const string& winname, int prop_id, double prop_value)
|
||||
void cv::setWindowProperty(const std::string& winname, int prop_id, double prop_value)
|
||||
{
|
||||
cvSetWindowProperty( winname.c_str(), prop_id, prop_value);
|
||||
}
|
||||
|
||||
double cv::getWindowProperty(const string& winname, int prop_id)
|
||||
double cv::getWindowProperty(const std::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 string& trackbarName, const string& winName,
|
||||
int cv::createTrackbar(const std::string& trackbarName, const std::string& winName,
|
||||
int* value, int count, TrackbarCallback callback,
|
||||
void* userdata)
|
||||
{
|
||||
@@ -201,17 +201,17 @@ int cv::createTrackbar(const string& trackbarName, const string& winName,
|
||||
value, count, callback, userdata);
|
||||
}
|
||||
|
||||
void cv::setTrackbarPos( const string& trackbarName, const string& winName, int value )
|
||||
void cv::setTrackbarPos( const std::string& trackbarName, const std::string& winName, int value )
|
||||
{
|
||||
cvSetTrackbarPos(trackbarName.c_str(), winName.c_str(), value );
|
||||
}
|
||||
|
||||
int cv::getTrackbarPos( const string& trackbarName, const string& winName )
|
||||
int cv::getTrackbarPos( const std::string& trackbarName, const std::string& winName )
|
||||
{
|
||||
return cvGetTrackbarPos(trackbarName.c_str(), winName.c_str());
|
||||
}
|
||||
|
||||
void cv::setMouseCallback( const string& windowName, MouseCallback onMouse, void* param)
|
||||
void cv::setMouseCallback( const std::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 string& name, OpenGlDrawCallback callback, void* userdata)
|
||||
void cv::setOpenGlDrawCallback(const std::string& name, OpenGlDrawCallback callback, void* userdata)
|
||||
{
|
||||
cvSetOpenGlDrawCallback(name.c_str(), callback, userdata);
|
||||
}
|
||||
|
||||
void cv::setOpenGlContext(const string& windowName)
|
||||
void cv::setOpenGlContext(const std::string& windowName)
|
||||
{
|
||||
cvSetOpenGlContext(windowName.c_str());
|
||||
}
|
||||
|
||||
void cv::updateWindow(const string& windowName)
|
||||
void cv::updateWindow(const std::string& windowName)
|
||||
{
|
||||
cvUpdateWindow(windowName.c_str());
|
||||
}
|
||||
@@ -254,7 +254,7 @@ namespace
|
||||
}
|
||||
#endif // HAVE_OPENGL
|
||||
|
||||
void cv::imshow( const string& winname, InputArray _img )
|
||||
void cv::imshow( const std::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 string& nameFont, int pointSize, Scalar color, int weight, int style, int /*spacing*/)
|
||||
CvFont cv::fontQt(const std::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 string& text, Point org, CvFont font)
|
||||
void cv::addText( const Mat& img, const std::string& text, Point org, CvFont font)
|
||||
{
|
||||
CvMat _img = img;
|
||||
cvAddText( &_img, text.c_str(), org,&font);
|
||||
}
|
||||
|
||||
void cv::displayStatusBar(const string& name, const string& text, int delayms)
|
||||
void cv::displayStatusBar(const std::string& name, const std::string& text, int delayms)
|
||||
{
|
||||
cvDisplayStatusBar(name.c_str(),text.c_str(), delayms);
|
||||
}
|
||||
|
||||
void cv::displayOverlay(const string& name, const string& text, int delayms)
|
||||
void cv::displayOverlay(const std::string& name, const std::string& text, int delayms)
|
||||
{
|
||||
cvDisplayOverlay(name.c_str(),text.c_str(), delayms);
|
||||
}
|
||||
@@ -373,40 +373,40 @@ void cv::stopLoop()
|
||||
cvStopLoop();
|
||||
}
|
||||
|
||||
void cv::saveWindowParameters(const string& windowName)
|
||||
void cv::saveWindowParameters(const std::string& windowName)
|
||||
{
|
||||
cvSaveWindowParameters(windowName.c_str());
|
||||
}
|
||||
|
||||
void cv::loadWindowParameters(const string& windowName)
|
||||
void cv::loadWindowParameters(const std::string& windowName)
|
||||
{
|
||||
cvLoadWindowParameters(windowName.c_str());
|
||||
}
|
||||
|
||||
int cv::createButton(const string& button_name, ButtonCallback on_change, void* userdata, int button_type , bool initial_button_state )
|
||||
int cv::createButton(const std::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 string&, int, Scalar, int, int, int)
|
||||
CvFont cv::fontQt(const std::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 string&, Point, CvFont)
|
||||
void cv::addText( const Mat&, const std::string&, Point, CvFont)
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
|
||||
}
|
||||
|
||||
void cv::displayStatusBar(const string&, const string&, int)
|
||||
void cv::displayStatusBar(const std::string&, const std::string&, int)
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
|
||||
}
|
||||
|
||||
void cv::displayOverlay(const string&, const string&, int )
|
||||
void cv::displayOverlay(const std::string&, const std::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 string&)
|
||||
void cv::saveWindowParameters(const std::string&)
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
|
||||
}
|
||||
|
||||
void cv::loadWindowParameters(const string&)
|
||||
void cv::loadWindowParameters(const std::string&)
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
|
||||
}
|
||||
|
||||
int cv::createButton(const string&, ButtonCallback, void*, int , bool )
|
||||
int cv::createButton(const std::string&, ButtonCallback, void*, int , bool )
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
|
||||
return 0;
|
||||
|
||||
@@ -71,7 +71,6 @@ CV_IMPL int cvWaitKey (int maxWait) {return 0;}
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
const int TOP_BORDER = 7;
|
||||
const int MIN_SLIDER_WIDTH=200;
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "test_precomp.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
//#define DRAW_TEST_IMAGE
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
{
|
||||
ts->printf(ts->LOG, "image type depth:%d channels:%d ext: %s\n", CV_8U, num_channels, ext_from_int(ext).c_str());
|
||||
Mat img(img_r * k, img_c * k, CV_MAKETYPE(CV_8U, num_channels), Scalar::all(0));
|
||||
circle(img, Point2i((img_c * k) / 2, (img_r * k) / 2), cv::min((img_r * k), (img_c * k)) / 4 , Scalar::all(255));
|
||||
circle(img, Point2i((img_c * k) / 2, (img_r * k) / 2), std::min((img_r * k), (img_c * k)) / 4 , Scalar::all(255));
|
||||
|
||||
string img_path = cv::tempfile(ext_from_int(ext).c_str());
|
||||
ts->printf(ts->LOG, "writing image : %s\n", img_path.c_str());
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
// jpeg
|
||||
ts->printf(ts->LOG, "image type depth:%d channels:%d ext: %s\n", CV_8U, num_channels, ".jpg");
|
||||
Mat img(img_r * k, img_c * k, CV_MAKETYPE(CV_8U, num_channels), Scalar::all(0));
|
||||
circle(img, Point2i((img_c * k) / 2, (img_r * k) / 2), cv::min((img_r * k), (img_c * k)) / 4 , Scalar::all(255));
|
||||
circle(img, Point2i((img_c * k) / 2, (img_r * k) / 2), std::min((img_r * k), (img_c * k)) / 4 , Scalar::all(255));
|
||||
|
||||
string filename = cv::tempfile(".jpg");
|
||||
imwrite(filename, img);
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
// tiff
|
||||
ts->printf(ts->LOG, "image type depth:%d channels:%d ext: %s\n", CV_16U, num_channels, ".tiff");
|
||||
Mat img(img_r * k, img_c * k, CV_MAKETYPE(CV_16U, num_channels), Scalar::all(0));
|
||||
circle(img, Point2i((img_c * k) / 2, (img_r * k) / 2), cv::min((img_r * k), (img_c * k)) / 4 , Scalar::all(255));
|
||||
circle(img, Point2i((img_c * k) / 2, (img_r * k) / 2), std::min((img_r * k), (img_c * k)) / 4 , Scalar::all(255));
|
||||
|
||||
string filename = cv::tempfile(".tiff");
|
||||
imwrite(filename, img);
|
||||
|
||||
Reference in New Issue
Block a user