CvvImage class definition */
| 4 | #include "opencv2\opencv.hpp" |
| 5 | /* CvvImage class definition */ |
| 6 | class CvvImage |
| 7 | { |
| 8 | public: |
| 9 | CvvImage(); |
| 10 | virtual ~CvvImage(); |
| 11 | /* Create image (BGR or grayscale) */ |
| 12 | virtual bool Create( int width, int height, int bits_per_pixel, int image_origin = 0 ); |
| 13 | /* Load image from specified file */ |
| 14 | virtual bool Load( const char* filename, int desired_color = 1 ); |
| 15 | /* Load rectangle from the file */ |
| 16 | virtual bool LoadRect( const char* filename, |
| 17 | int desired_color, CvRect r ); |
| 18 | #if defined WIN32 || defined _WIN32 |
| 19 | virtual bool LoadRect( const char* filename, |
| 20 | int desired_color, RECT r ) |
| 21 | { |
| 22 | return LoadRect( filename, desired_color, |
| 23 | cvRect( r.left, r.top, r.right - r.left, r.bottom - r.top )); |
| 24 | } |
| 25 | #endif |
| 26 | /* Save entire image to specified file. */ |
| 27 | virtual bool Save( const char* filename ); |
| 28 | /* Get copy of input image ROI */ |
| 29 | virtual void CopyOf( CvvImage& image, int desired_color = -1 ); |
| 30 | virtual void CopyOf( IplImage* img, int desired_color = -1 ); |
| 31 | IplImage* GetImage() { return m_img; }; |
| 32 | virtual void Destroy(void); |
| 33 | /* width and height of ROI */ |
| 34 | int Width() { return !m_img ? 0 : !m_img->roi ? m_img->width : m_img->roi->width; }; |
| 35 | int Height() { return !m_img ? 0 : !m_img->roi ? m_img->height : m_img->roi->height;}; |
| 36 | int Bpp() { return m_img ? (m_img->depth & 255)*m_img->nChannels : 0; }; |
| 37 | virtual void Fill( int color ); |
| 38 | /* draw to highgui window */ |
| 39 | virtual void Show( const char* window ); |
| 40 | |
| 41 | #if defined WIN32 || defined _WIN32 |
| 42 | /* draw part of image to the specified DC */ |
| 43 | virtual void Show( HDC dc, int x, int y, int width, int height, |
| 44 | int from_x = 0, int from_y = 0 ); |
| 45 | /* draw the current image ROI to the specified rectangle of the destination DC */ |
| 46 | virtual void DrawToHDC( HDC hDCDst, RECT* pDstRect ); |
| 47 | #endif |
| 48 | protected: |
| 49 | IplImage* m_img; |
| 50 | }; |
| 51 | typedef CvvImage CImage; |
| 52 | #endif |
nothing calls this directly
no outgoing calls
no test coverage detected