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

Function FillBitmapInfo

MatchTool/CvvImage.cpp:55–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 return roi;
54}
55void FillBitmapInfo( BITMAPINFO* bmi, int width, int height, int bpp, int origin )
56{
57 assert( bmi && width >= 0 && height >= 0 && (bpp == 8 || bpp == 24 || bpp == 32));
58
59 BITMAPINFOHEADER* bmih = &(bmi->bmiHeader);
60
61 memset( bmih, 0, sizeof(*bmih));
62 bmih->biSize = sizeof(BITMAPINFOHEADER);
63 bmih->biWidth = width;
64 bmih->biHeight = origin ? abs(height) : -abs(height);
65 bmih->biPlanes = 1;
66 bmih->biBitCount = (unsigned short)bpp;
67 bmih->biCompression = BI_RGB;
68 if( bpp == 8 )
69 {
70 RGBQUAD* palette = bmi->bmiColors;
71 int i;
72 for( i = 0; i < 256; i++ )
73 {
74 palette[i].rgbBlue = palette[i].rgbGreen = palette[i].rgbRed = (BYTE)i;
75 palette[i].rgbReserved = 0;
76 }
77 }
78}
79CvvImage::CvvImage()
80{
81 m_img = 0;

Callers 2

ShowMethod · 0.85
DrawToHDCMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected