From 94340872bccfd3f6640b6814c44df4dfb8bb7b27 Mon Sep 17 00:00:00 2001 From: Jeff Rafter Date: Sat, 27 Feb 2010 08:06:28 -0800 Subject: [PATCH] Apply jurgensmirnoff's patch for cvIplDepth and include cvaux.h in opencv.h for OpenCV 2.0 --- .gitignore | 6 ++++++ ext/iplimage.cpp | 6 +++--- ext/opencv.h | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ee11562 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.DS_Store +examples/data +*.o +Makefile +mkmf.log +opencv.bundle \ No newline at end of file diff --git a/ext/iplimage.cpp b/ext/iplimage.cpp index a109576..fe7d323 100644 --- a/ext/iplimage.cpp +++ b/ext/iplimage.cpp @@ -88,7 +88,7 @@ rb_initialize(int argc, VALUE *argv, VALUE self) rb_scan_args(argc, argv, "22", &width, &height, &depth, &channel); int _depth = argc < 3 ? CV_8U : FIX2INT(depth); int _channel = argc < 4 ? 3 : FIX2INT(channel); - DATA_PTR(self) = cvCreateImage(cvSize(FIX2INT(width), FIX2INT(height)), cvCvToIplDepth(_depth), _channel); + DATA_PTR(self) = cvCreateImage(cvSize(FIX2INT(width), FIX2INT(height)), cvIplDepth(_depth), _channel); return self; } @@ -225,13 +225,13 @@ rb_reset_coi(VALUE self) VALUE new_object(int width, int height, int type) { - return OPENCV_OBJECT(rb_klass, cvCreateImage(cvSize(width, height), cvCvToIplDepth(type), CV_MAT_CN(type))); + return OPENCV_OBJECT(rb_klass, cvCreateImage(cvSize(width, height), cvIplDepth(type), CV_MAT_CN(type))); } VALUE new_object(CvSize size, int type) { - return OPENCV_OBJECT(rb_klass, cvCreateImage(size, cvCvToIplDepth(type), CV_MAT_CN(type))); + return OPENCV_OBJECT(rb_klass, cvCreateImage(size, cvIplDepth(type), CV_MAT_CN(type))); } __NAMESPACE_END_IPLIMAGE diff --git a/ext/opencv.h b/ext/opencv.h index 05bcfef..4e2d077 100644 --- a/ext/opencv.h +++ b/ext/opencv.h @@ -50,6 +50,7 @@ extern "C"{ // OpenCV headers #include +#include #include #include #include