MCPcopy Create free account
hub / github.com/DennisLiu1993/Fastest_Image_Pattern_Matching / Create

Method Create

MatchTool/CvvImage.cpp:91–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 Destroy();
90}
91bool CvvImage::Create( int w, int h, int bpp, int origin )
92{
93 const unsigned max_img_size = 10000;
94
95 if( (bpp != 8 && bpp != 24 && bpp != 32) ||
96 (unsigned)w >= max_img_size || (unsigned)h >= max_img_size ||
97 (origin != IPL_ORIGIN_TL && origin != IPL_ORIGIN_BL))
98 {
99 assert(0); // most probably, it is a programming error
100 return false;
101 }
102 if( !m_img || Bpp() != bpp || m_img->width != w || m_img->height != h )
103 {
104 if( m_img && m_img->nSize == sizeof(IplImage))
105 Destroy();
106 /* prepare IPL header */
107 m_img = cvCreateImage( cvSize( w, h ), IPL_DEPTH_8U, bpp/8 );
108 }
109 if( m_img )
110 m_img->origin = origin == 0 ? IPL_ORIGIN_TL : IPL_ORIGIN_BL;
111 return m_img != 0;
112}
113void CvvImage::CopyOf( CvvImage& image, int desired_color )
114{
115 IplImage* img = image.GetImage();

Callers 1

OnInitDialogMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected