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

  • 大小: 0.14M
    文件類型: .zip
    金幣: 1
    下載: 0 次
    發布日期: 2024-04-18
  • 語言: C/C++
  • 標簽: 攝像頭??攝像??

資源簡介

虛擬攝像頭

資源截圖

代碼片段和文件信息

////by?fanxiushu?2018-03-08

#include?
#include?“stdio.h“
#include?“vcamera.h“

HINSTANCE?g_hInstance;
////
BOOL?APIENTRY?DllMain(HINSTANCE?hInstance?DWORD?dwReason?LPVOID?lpReserved)
{
g_hInstance?=?hInstance;
if?(dwReason?==?DLL_PROCESS_ATTACH)?{
////
DisableThreadLibraryCalls(hInstance);
}

////
return?TRUE;
}

//////
//下面從我的?虛擬USB攝像頭的例子工程copy

////?RGB?->?YUV?從網絡查詢的算法
void?rgb24_yuy2(void*?rgb?void*?yuy2?int?width?int?height)
{
int?R1?G1?B1?R2?G2?B2?Y1?U1?Y2?V1;
unsigned?char*?pRGBData?=?(unsigned?char?*)rgb;
unsigned?char*?pYUVData?=?(unsigned?char?*)yuy2;

for?(int?i?=?0;?i {
for?(int?j?=?0;?j {
B1?=?*(pRGBData?+?(height?-?i?-?1)*width?*?3?+?j?*?6);
G1?=?*(pRGBData?+?(height?-?i?-?1)*width?*?3?+?j?*?6?+?1);
R1?=?*(pRGBData?+?(height?-?i?-?1)*width?*?3?+?j?*?6?+?2);
B2?=?*(pRGBData?+?(height?-?i?-?1)*width?*?3?+?j?*?6?+?3);
G2?=?*(pRGBData?+?(height?-?i?-?1)*width?*?3?+?j?*?6?+?4);
R2?=?*(pRGBData?+?(height?-?i?-?1)*width?*?3?+?j?*?6?+?5);

Y1?=?((66?*?R1?+?129?*?G1?+?25?*?B1?+?128)?>>?8)?+?16;
U1?=?(((-38?*?R1?-?74?*?G1?+?112?*?B1?+?128)?>>?8)?+?((-38?*?R2?-?74?*?G2?+?112?*?B2?+?128)?>>?8))?/?2?+?128;
Y2?=?((66?*?R2?+?129?*?G2?+?25?*?B2?+?128)?>>?8)?+?16;
V1?=?(((112?*?R1?-?94?*?G1?-?18?*?B1?+?128)?>>?8)?+?((112?*?R2?-?94?*?G2?-?18?*?B2?+?128)?>>?8))?/?2?+?128;

*(pYUVData?+?i*width?*?2?+?j?*?4)?=?max(min(Y1?255)?0);
*(pYUVData?+?i*width?*?2?+?j?*?4?+?1)?=?max(min(U1?255)?0);
*(pYUVData?+?i*width?*?2?+?j?*?4?+?2)?=?max(min(Y2?255)?0);
*(pYUVData?+?i*width?*?2?+?j?*?4?+?3)?=?max(min(V1?255)?0);
}
}
}

////////////////////
struct?vcam_param
{
HBITMAP?hbmp;
HDC?hdc;
void*?rgb_data;

int?width;
int?height;
const?char*?text;
int?i_color;
int???????????clr_flip;
int???????????i_size;
int???????????sz_flip;
};
int?create_dib(vcam_param*?p?int?w?int?h)
{
if?(p->width?==?w?&&?p->height?==?h?&&?p->hbmp)?return?0;
////
if?(p->hbmp)Deleteobject(p->hbmp);
if?(p->hdc)DeleteDC(p->hdc);
p->hbmp?=?0;?p->hdc?=?0;
p->hdc?=?CreateCompatibleDC(NULL);

BITMAPINFOHEADER?bi;?memset(&bi?0?sizeof(bi));
bi.biSize?=?sizeof(bi);
bi.biWidth?=?w;
bi.biHeight?=?h;
bi.biPlanes?=?1;
bi.biBitCount?=?24;?//RGB
bi.biCompression?=?BI_RGB;
bi.biSizeImage?=?0;


p->hbmp?=?CreateDIBSection(p->hdc?(BITMAPINFO*)&bi?DIB_RGB_COLORS?&p->rgb_data?NULL?0);
if?(!p->hbmp)?{
p->rgb_data?=?0;
printf(“CreateDIBSection?err=%d\n“?GetLastError());
return?-1;
}
Selectobject(p->hdc?p->hbmp);?///
???////
p->width?=?w;
p->height?=?h;

p->clr_flip?=?1;
p->i_color?=?0;

p->i_size?=?20;
p->sz_flip?=?2;?///

return?0;
}
void?draw_text(vcam_param*?p)
{
if?(!p->hbmp)return;
////
int?len?=?p->width*p->height?*?3;?//
memset(p->rgb_data?p->i_color?len);?///?背景色漸變
p->i_color?+=?p->clr_flip;
if?(p->i_color?<

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-07-17?13:14??vcam_dshow-master\
?????文件?????????636??2018-07-17?13:14??vcam_dshow-master\README.txt
?????目錄???????????0??2018-07-17?13:14??vcam_dshow-master\bin\
?????文件???????????0??2018-07-17?13:14??vcam_dshow-master\bin\.mkdir
?????文件?????????233??2018-07-17?13:14??vcam_dshow-master\bin\register.bat
?????文件?????????216??2018-07-17?13:14??vcam_dshow-master\bin\unregister.bat
?????文件??????124928??2018-07-17?13:14??vcam_dshow-master\bin\vcam_dshow.dll
?????目錄???????????0??2018-07-17?13:14??vcam_dshow-master\source\
?????文件???????????0??2018-07-17?13:14??vcam_dshow-master\source\.mkdir
?????目錄???????????0??2018-07-17?13:14??vcam_dshow-master\source\src\
?????文件???????????0??2018-07-17?13:14??vcam_dshow-master\source\src\.mkdir
?????文件????????4271??2018-07-17?13:14??vcam_dshow-master\source\src\main.cpp
?????文件???????11631??2018-07-17?13:14??vcam_dshow-master\source\src\vcam_dshow.h
?????文件???????22475??2018-07-17?13:14??vcam_dshow-master\source\src\vcam_stream.cpp
?????文件???????13899??2018-07-17?13:14??vcam_dshow-master\source\src\vcamera.cpp
?????文件?????????165??2018-07-17?13:14??vcam_dshow-master\source\src\vcamera.def
?????文件?????????367??2018-07-17?13:14??vcam_dshow-master\source\src\vcamera.h
?????文件????????1301??2018-07-17?13:14??vcam_dshow-master\source\vcam_dshow.sln
?????文件????????8323??2018-07-17?13:14??vcam_dshow-master\source\vcam_dshow.vcxproj
?????文件????????1505??2018-07-17?13:14??vcam_dshow-master\source\vcam_dshow.vcxproj.filters
?????文件?????????643??2018-07-17?13:14??vcam_dshow-master\source\vcam_dshow.vcxproj.user
?????文件???????55744??2018-07-17?13:14??vcam_dshow-master\vcam_dshow.png

評論

共有 條評論