iceWing
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
opencv.h
Go to the documentation of this file.
1 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
2 
3 #ifndef iw_opencv_H
4 #define iw_opencv_H
5 
6 #include "gui/Grender.h"
7 
8 typedef struct _IplImage IplImage;
9 namespace cv {
10  class Mat;
11 }
12 
13 /*********************************************************************
14  Render the IplImage/cv::Mat img in b with the color transformation ctab.
15 *********************************************************************/
16 void iw_opencv_render (prevBuffer *b, const IplImage *img, iwColtab ctab);
17 void iw_opencv_render (prevBuffer *b, const cv::Mat *img, iwColtab ctab);
18 
19 /*********************************************************************
20  Convert img to an IplImage and return it. Returned image is
21  allocated with cvCreateImage() and must be freed with
22  cvReleaseImage().
23  swapRB == TRUE: Swap planes 0 and 2 during conversion.
24 *********************************************************************/
25 IplImage* iw_opencv_from_img (const iwImage *img, BOOL swapRB);
26 
27 /*********************************************************************
28  Convert img to a cv::Mat and return it. Returned image is
29  allocated and must be freed with the cv::Mat destructor.
30  swapRB == TRUE: Swap planes 0 and 2 during conversion.
31 *********************************************************************/
32 cv::Mat* iw_opencvMat_from_img (const iwImage *img, BOOL swapRB);
33 
34 /*********************************************************************
35  Convert img to an iwImage and return it. Returned image is
36  allocated with iw_img_new_alloc() and must be freed with
37  iw_img_free (image, IW_IMG_FREE_ALL).
38  swapRB == TRUE: Swap planes 0 and 2 during conversion.
39 *********************************************************************/
40 iwImage* iw_opencv_to_img (const IplImage *img, BOOL swapRB);
41 iwImage* iw_opencv_to_img (const cv::Mat *img, BOOL swapRB);
42 
43 /*********************************************************************
44  Convert img to an interleaved iwImage and return it.
45  Returned image is allocated and must be freed with
46  iw_img_free (image, IW_IMG_FREE_ALL).
47  swapRB == TRUE: Swap planes 0 and 2 during conversion.
48 *********************************************************************/
50 iwImage* iw_opencv_to_img_interleaved (const cv::Mat *img, BOOL swapRB);
51 
52 #endif /* iw_opencv_H */