Make highgui.hpp independent from C API
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@
|
||||
|
||||
#include "precomp.hpp"
|
||||
|
||||
#ifdef HAVE_FFMPEG
|
||||
#ifndef WIN32
|
||||
#include "cap_ffmpeg_impl.hpp"
|
||||
#else
|
||||
#include "cap_ffmpeg_api.hpp"
|
||||
|
@@ -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
|
||||
|
@@ -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_ */
|
||||
|
@@ -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");
|
||||
}
|
||||
|
Reference in New Issue
Block a user