Make highgui.hpp independent from C API

This commit is contained in:
Andrey Kamaev
2013-04-07 22:45:38 +04:00
parent 288a0634c2
commit 0738ea7d0f
152 changed files with 899 additions and 594 deletions

View File

@@ -540,9 +540,9 @@ double VideoCapture::get(int propId)
VideoWriter::VideoWriter()
{}
VideoWriter::VideoWriter(const 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);
open(filename, _fourcc, fps, frameSize, isColor);
}
void VideoWriter::release()
@@ -555,9 +555,9 @@ VideoWriter::~VideoWriter()
release();
}
bool VideoWriter::open(const 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);
writer = cvCreateVideoWriter(filename.c_str(), _fourcc, fps, frameSize, isColor);
return isOpened();
}
@@ -578,4 +578,9 @@ VideoWriter& VideoWriter::operator << (const Mat& image)
return *this;
}
int VideoWriter::fourcc(char c1, char c2, char c3, char c4)
{
return (c1 & 255) + ((c2 & 255) << 8) + ((c3 & 255) << 16) + ((c4 & 255) << 24);
}
}

View File

@@ -41,7 +41,7 @@
#include "precomp.hpp"
#ifdef HAVE_FFMPEG
#ifndef WIN32
#include "cap_ffmpeg_impl.hpp"
#else
#include "cap_ffmpeg_api.hpp"

View File

@@ -61,7 +61,9 @@ extern "C" {
#endif
#ifdef WIN32
#include <libavformat/avformat.h>
# define AVUTIL_COMMON_H
# define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
# include <libavformat/avformat.h>
#else
// if the header path is not specified explicitly, let's deduce it

View File

@@ -199,41 +199,4 @@ void cvSetRatioWindow_QT(const char* name,double prop_value);
double cvGetOpenGlProp_QT(const char* name);
#endif
/*namespace cv
{
class CV_EXPORTS BaseWindow
{
public:
BaseWindow(const String& name, int flags=0);
virtual ~BaseWindow();
virtual void close();
virtual void show(const Mat& mat);
virtual void resize(Size size);
virtual void move(Point topleft);
virtual Size size() const;
virtual Point topLeft() const;
virtual void setGeometry(Point topLeft, Size size);
virtual void getGeometry(Point& topLeft, Size& size) const;
virtual String getTitle() const;
virtual void setTitle(const String& str);
virtual String getName() const;
virtual void setScaleMode(int mode);
virtual int getScaleMode();
virtual void setScrollPos(double pos);
virtual double getScrollPos() const;
virtual void setScale(double scale);
virtual double getScale() const;
virtual Point getImageCoords(Point pos) const;
virtual Scalar getPixelValue(Point pos, const String& colorspace=String()) const;
virtual void addTrackbar( const String& trackbar, int low, int high, int step );
};
typedef Ptr<BaseWindow> Window;
}*/
#endif /* __HIGHGUI_H_ */

View File

@@ -342,15 +342,16 @@ 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*/)
cv::QtFont cv::fontQt(const String& nameFont, int pointSize, Scalar color, int weight, int style, int /*spacing*/)
{
return cvFontQt(nameFont.c_str(), pointSize,color,weight, style);
CvFont f = cvFontQt(nameFont.c_str(), pointSize,color,weight, style);
return *(cv::QtFont*)(&f);
}
void cv::addText( const Mat& img, const String& text, Point org, CvFont font)
void cv::addText( const Mat& img, const String& text, Point org, const QtFont& font)
{
CvMat _img = img;
cvAddText( &_img, text.c_str(), org,&font);
cvAddText( &_img, text.c_str(), org, (CvFont*)&font);
}
void cv::displayStatusBar(const String& name, const String& text, int delayms)
@@ -390,13 +391,13 @@ int cv::createButton(const String& button_name, ButtonCallback on_change, void*
#else
CvFont cv::fontQt(const String&, int, Scalar, int, int, int)
cv::QtFont cv::fontQt(const String&, int, Scalar, int, int, int)
{
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
return CvFont();
return QtFont();
}
void cv::addText( const Mat&, const String&, Point, CvFont)
void cv::addText( const Mat&, const String&, Point, const QtFont&)
{
CV_Error(CV_StsNotImplemented, "The library is compiled without QT support");
}