Skip to content

Commit

Permalink
Make highgui.hpp independent from C API
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Kamaev committed Apr 8, 2013
1 parent 288a063 commit 0738ea7
Show file tree
Hide file tree
Showing 152 changed files with 901 additions and 596 deletions.
1 change: 1 addition & 0 deletions 3rdparty/ffmpeg/ffmpeg_version.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
set(HAVE_FFMPEG 1)
set(NEW_FFMPEG 1)
set(HAVE_FFMPEG_CODEC 1)
set(HAVE_FFMPEG_FORMAT 1)
Expand Down
6 changes: 3 additions & 3 deletions cmake/OpenCVFindLibsVideo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if(WITH_GSTREAMER AND NOT WITH_GSTREAMER_1_X)
set(GSTREAMER_RIFF_VERSION ${ALIASOF_gstreamer-riff-0.10_VERSION})
set(GSTREAMER_PBUTILS_VERSION ${ALIASOF_gstreamer-pbutils-0.10_VERSION})
endif()

endif(WITH_GSTREAMER AND NOT WITH_GSTREAMER_1_X)

# if gstreamer 0.10 was not found, or we specified we wanted 1.x, try to find it
Expand All @@ -40,7 +40,7 @@ if(WITH_GSTREAMER_1_X OR NOT HAVE_GSTREAMER)
CHECK_MODULE(gstreamer-app-1.0 HAVE_GSTREAMER_APP)
CHECK_MODULE(gstreamer-riff-1.0 HAVE_GSTREAMER_RIFF)
CHECK_MODULE(gstreamer-pbutils-1.0 HAVE_GSTREAMER_PBUTILS)

if(HAVE_GSTREAMER_BASE AND HAVE_GSTREAMER_VIDEO AND HAVE_GSTREAMER_APP AND HAVE_GSTREAMER_RIFF AND HAVE_GSTREAMER_PBUTILS)
set(HAVE_GSTREAMER TRUE)
set(GSTREAMER_BASE_VERSION ${ALIASOF_gstreamer-base-1.0_VERSION})
Expand All @@ -49,7 +49,7 @@ if(WITH_GSTREAMER_1_X OR NOT HAVE_GSTREAMER)
set(GSTREAMER_RIFF_VERSION ${ALIASOF_gstreamer-riff-1.0_VERSION})
set(GSTREAMER_PBUTILS_VERSION ${ALIASOF_gstreamer-pbutils-1.0_VERSION})
endif()

endif(WITH_GSTREAMER_1_X OR NOT HAVE_GSTREAMER)

# --- unicap ---
Expand Down
15 changes: 7 additions & 8 deletions modules/calib3d/test/test_chesscorners_timing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void CV_ChessboardDetectorTimingTest::run( int start_from )
CvMat* _v = 0;
CvPoint2D32f* v;

IplImage* img = 0;
IplImage img;
IplImage* gray = 0;
IplImage* thresh = 0;

Expand Down Expand Up @@ -105,9 +105,10 @@ void CV_ChessboardDetectorTimingTest::run( int start_from )
/* read the image */
sprintf( filename, "%s%s", filepath, imgname );

img = cvLoadImage( filename );
cv::Mat img2 = cv::imread( filename );
img = img2;

if( !img )
if( img2.empty() )
{
ts->printf( cvtest::TS::LOG, "one of chessboard images can't be read: %s\n", filename );
if( max_idx == 1 )
Expand All @@ -120,9 +121,9 @@ void CV_ChessboardDetectorTimingTest::run( int start_from )

ts->printf(cvtest::TS::LOG, "%s: chessboard %d:\n", imgname, is_chessboard);

gray = cvCreateImage( cvSize( img->width, img->height ), IPL_DEPTH_8U, 1 );
thresh = cvCreateImage( cvSize( img->width, img->height ), IPL_DEPTH_8U, 1 );
cvCvtColor( img, gray, CV_BGR2GRAY );
gray = cvCreateImage( cvSize( img.width, img.height ), IPL_DEPTH_8U, 1 );
thresh = cvCreateImage( cvSize( img.width, img.height ), IPL_DEPTH_8U, 1 );
cvCvtColor( &img, gray, CV_BGR2GRAY );


count0 = pattern_size.width*pattern_size.height;
Expand Down Expand Up @@ -164,7 +165,6 @@ void CV_ChessboardDetectorTimingTest::run( int start_from )
find_chessboard_time*1e-6, find_chessboard_time/num_pixels);

cvReleaseMat( &_v );
cvReleaseImage( &img );
cvReleaseImage( &gray );
cvReleaseImage( &thresh );
progress = update_progress( progress, idx-1, max_idx, 0 );
Expand All @@ -175,7 +175,6 @@ void CV_ChessboardDetectorTimingTest::run( int start_from )
/* release occupied memory */
cvReleaseMat( &_v );
cvReleaseFileStorage( &fs );
cvReleaseImage( &img );
cvReleaseImage( &gray );
cvReleaseImage( &thresh );

Expand Down
3 changes: 1 addition & 2 deletions modules/contrib/src/chamfermatching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,7 @@ void ChamferMatcher::Template::show() const
#ifdef HAVE_OPENCV_HIGHGUI
namedWindow("templ",1);
imshow("templ",templ_color);

cvWaitKey(0);
waitKey();
#else
CV_Error(CV_StsNotImplemented, "OpenCV has been compiled without GUI support");
#endif
Expand Down
43 changes: 27 additions & 16 deletions modules/core/include/opencv2/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,67 +496,73 @@ CV_EXPORTS void randShuffle(InputOutputArray dst, double iterFactor = 1., RNG* r

CV_EXPORTS_AS(randShuffle) void randShuffle_(InputOutputArray dst, double iterFactor = 1.);

enum { FILLED = -1,
LINE_4 = 4,
LINE_8 = 8,
LINE_AA = 16
};

//! draws the line segment (pt1, pt2) in the image
CV_EXPORTS_W void line(CV_IN_OUT Mat& img, Point pt1, Point pt2, const Scalar& color,
int thickness = 1, int lineType = 8, int shift = 0);
int thickness = 1, int lineType = LINE_8, int shift = 0);

//! draws the rectangle outline or a solid rectangle with the opposite corners pt1 and pt2 in the image
CV_EXPORTS_W void rectangle(CV_IN_OUT Mat& img, Point pt1, Point pt2,
const Scalar& color, int thickness = 1,
int lineType = 8, int shift = 0);
int lineType = LINE_8, int shift = 0);

//! draws the rectangle outline or a solid rectangle covering rec in the image
CV_EXPORTS void rectangle(CV_IN_OUT Mat& img, Rect rec,
const Scalar& color, int thickness = 1,
int lineType = 8, int shift = 0);
int lineType = LINE_8, int shift = 0);

//! draws the circle outline or a solid circle in the image
CV_EXPORTS_W void circle(CV_IN_OUT Mat& img, Point center, int radius,
const Scalar& color, int thickness = 1,
int lineType = 8, int shift = 0);
int lineType = LINE_8, int shift = 0);

//! draws an elliptic arc, ellipse sector or a rotated ellipse in the image
CV_EXPORTS_W void ellipse(CV_IN_OUT Mat& img, Point center, Size axes,
double angle, double startAngle, double endAngle,
const Scalar& color, int thickness = 1,
int lineType = 8, int shift = 0);
int lineType = LINE_8, int shift = 0);

//! draws a rotated ellipse in the image
CV_EXPORTS_W void ellipse(CV_IN_OUT Mat& img, const RotatedRect& box, const Scalar& color,
int thickness = 1, int lineType = 8);
int thickness = 1, int lineType = LINE_8);

//! draws a filled convex polygon in the image
CV_EXPORTS void fillConvexPoly(Mat& img, const Point* pts, int npts,
const Scalar& color, int lineType = 8,
const Scalar& color, int lineType = LINE_8,
int shift = 0);

CV_EXPORTS_W void fillConvexPoly(InputOutputArray img, InputArray points,
const Scalar& color, int lineType = 8,
const Scalar& color, int lineType = LINE_8,
int shift = 0);

//! fills an area bounded by one or more polygons
CV_EXPORTS void fillPoly(Mat& img, const Point** pts,
const int* npts, int ncontours,
const Scalar& color, int lineType = 8, int shift = 0,
const Scalar& color, int lineType = LINE_8, int shift = 0,
Point offset = Point() );

CV_EXPORTS_W void fillPoly(InputOutputArray img, InputArrayOfArrays pts,
const Scalar& color, int lineType = 8, int shift = 0,
const Scalar& color, int lineType = LINE_8, int shift = 0,
Point offset = Point() );

//! draws one or more polygonal curves
CV_EXPORTS void polylines(Mat& img, const Point* const* pts, const int* npts,
int ncontours, bool isClosed, const Scalar& color,
int thickness = 1, int lineType = 8, int shift = 0 );
int thickness = 1, int lineType = LINE_8, int shift = 0 );

CV_EXPORTS_W void polylines(InputOutputArray img, InputArrayOfArrays pts,
bool isClosed, const Scalar& color,
int thickness = 1, int lineType = 8, int shift = 0 );
int thickness = 1, int lineType = LINE_8, int shift = 0 );

//! draws contours in the image
CV_EXPORTS_W void drawContours( InputOutputArray image, InputArrayOfArrays contours,
int contourIdx, const Scalar& color,
int thickness = 1, int lineType = 8,
int thickness = 1, int lineType = LINE_8,
InputArray hierarchy = noArray(),
int maxLevel = INT_MAX, Point offset = Point() );

Expand Down Expand Up @@ -587,7 +593,7 @@ enum
//! renders text string in the image
CV_EXPORTS_W void putText( Mat& img, const String& text, Point org,
int fontFace, double fontScale, Scalar color,
int thickness = 1, int lineType = 8,
int thickness = 1, int lineType = LINE_8,
bool bottomLeftOrigin = false );

//! returns bounding box of the text string
Expand Down Expand Up @@ -631,9 +637,9 @@ CV_EXPORTS ConvertScaleData getConvertScaleElem(int fromType, int toType);
PCA pca(pcaset, // pass the data
Mat(), // we do not have a pre-computed mean vector,
// so let the PCA engine to compute it
CV_PCA_DATA_AS_ROW, // indicate that the vectors
PCA::DATA_AS_ROW, // indicate that the vectors
// are stored as matrix rows
// (use CV_PCA_DATA_AS_COL if the vectors are
// (use PCA::DATA_AS_COL if the vectors are
// the matrix columns)
maxComponents // specify, how many principal components to retain
);
Expand Down Expand Up @@ -663,6 +669,11 @@ CV_EXPORTS ConvertScaleData getConvertScaleElem(int fromType, int toType);
class CV_EXPORTS PCA
{
public:
enum { DATA_AS_ROW = 0,
DATA_AS_COL = 1,
USE_AVG = 2
};

//! default constructor
PCA();

Expand Down
1 change: 1 addition & 0 deletions modules/highgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ endif()
if(WIN32)
link_directories("${OpenCV_SOURCE_DIR}/3rdparty/lib") # for ffmpeg wrapper only
include_directories(AFTER SYSTEM "${OpenCV_SOURCE_DIR}/3rdparty/include") # for directshow in VS2005 and multi-monitor support on MinGW
include_directories(AFTER SYSTEM "${OpenCV_SOURCE_DIR}/3rdparty/include/ffmpeg_") # for tests
endif()

if(UNIX)
Expand Down
Loading

0 comments on commit 0738ea7

Please sign in to comment.