91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

該程序已經在VS2010上跑通,具有一定的參考價值,希望能夠幫助到有需要的朋友?。×恚喝绻绦蛴捎谏蟼骰蛘咂渌虺霈F了不能使用的問題,請聯系我,如果在使用中遇到了什么問題,也請聯系我,由衷的希望可以和各位朋友們一起討論,共同進步?。?

資源截圖

代碼片段和文件信息


#include?“stdafx.h“??
#include?“CvvImage.h“??
??
//////////////////////////////////////////////////////////////////////??
//?Construction/Destruction??
//////////////////////////////////////////////////////////////////////??
??
CV_INLINE?RECT?NormalizeRect(?RECT?r?);??
CV_INLINE?RECT?NormalizeRect(?RECT?r?)??
{??
????int?t;??
??
????if(?r.left?>?r.right?)??
????{??
????????t?=?r.left;??
????????r.left?=?r.right;??
????????r.right?=?t;??
????}??
??
????if(?r.top?>?r.bottom?)??
????{??
????????t?=?r.top;??
????????r.top?=?r.bottom;??
????????r.bottom?=?t;??
????}??
??
????return?r;??
}??
??
CV_INLINE?CvRect?RectToCvRect(?RECT?sr?);??
CV_INLINE?CvRect?RectToCvRect(?RECT?sr?)??
{??
????sr?=?NormalizeRect(?sr?);??
????return?cvRect(?sr.left?sr.top?sr.right?-?sr.left?sr.bottom?-?sr.top?);??
}??
??
CV_INLINE?RECT?CvRectToRect(?CvRect?sr?);??
CV_INLINE?RECT?CvRectToRect(?CvRect?sr?)??
{??
????RECT?dr;??
????dr.left?=?sr.x;??
????dr.top?=?sr.y;??
????dr.right?=?sr.x?+?sr.width;??
????dr.bottom?=?sr.y?+?sr.height;??
??
????return?dr;??
}??
??
CV_INLINE?IplROI?RectToROI(?RECT?r?);??
CV_INLINE?IplROI?RectToROI(?RECT?r?)??
{??
????IplROI?roi;??
????r?=?NormalizeRect(?r?);??
????roi.xOffset?=?r.left;??
????roi.yOffset?=?r.top;??
????roi.width?=?r.right?-?r.left;??
????roi.height?=?r.bottom?-?r.top;??
????roi.coi?=?0;??
??
????return?roi;??
}??
??
void?FillBitmapInfo(?BITMAPINFO*?bmi?int?width?int?height?int?bpp?int?origin?)??
{??
????assert(?bmi?&&?width?>=?0?&&?height?>=?0?&&?(bpp?==?8?||?bpp?==?24?||?bpp?==?32));??
??
????BITMAPINFOHEADER*?bmih?=?&(bmi->bmiHeader);??
??
????memset(?bmih?0?sizeof(*bmih));??
????bmih->biSize?=?sizeof(BITMAPINFOHEADER);??
????bmih->biWidth?=?width;??
????bmih->biHeight?=?origin???abs(height)?:?-abs(height);??
????bmih->biPlanes?=?1;??
????bmih->biBitCount?=?(unsigned?short)bpp;??
????bmih->biCompression?=?BI_RGB;??
??
????if(?bpp?==?8?)??
????{??
????????RGBQUAD*?palette?=?bmi->bmiColors;??
????????int?i;??
????????for(?i?=?0;?i?????????{??
????????????palette[i].rgbBlue?=?palette[i].rgbGreen?=?palette[i].rgbRed?=?(BYTE)i;??
????????????palette[i].rgbReserved?=?0;??
????????}??
????}??
}??
??
CvvImage::CvvImage()??
{??
????m_img?=?0;??
}??
??
void?CvvImage::Destroy()??
{??
????cvReleaseImage(?&m_img?);??
}??
??
CvvImage::~CvvImage()??
{??
????Destroy();??
}??
??
bool?CvvImage::Create(?int?w?int?h?int?bpp?int?origin?)??
{??
????const?unsigned?max_img_size?=?10000;??
??
????if(?(bpp?!=?8?&&?bpp?!=?24?&&?bpp?!=?32)?||??
????????(unsigned)w?>=?max_img_size?||?(unsigned)h?>=?max_img_size?||??
????????(origin?!=?IPL_ORIGIN_TL?&&?origin?!=?IPL_ORIGIN_BL))??
????{??
????????assert(0);?//?most?probably?it?is?a?programming?error??
????????return?false;??
????}??
??
????if(?!m_img?||?Bpp()?!=?bpp?||?m_img->width?!=?w?||?m_img->height?!=?h?)??
????{??
????????if(?m_img?&&?m_img->nSize?==?sizeof(

評論

共有 條評論