资源简介
c++开发ocx入门实践三--基于opencv的简易视频播发器ocx
利用opencv做了个简易的视频播放器的ocx,可以在c++/c#/web中加载
代码片段和文件信息
/*源文件 CvvImage.cpp*/
#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 < 256; 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(IplImage))
Destroy();
/* prepare IPL header */
m_img = cvCreateImage( cvSize( w h ) IPL_DEPTH_8U bpp/8 );
}
if( m_img )
m_img->origin = origin == 0 ? IPL_ORIGIN_TL : IPL_ORIGIN_BL;
return m_img != 0;
}
void CvvImage::CopyOf( CvvImage& image int desired_color )
{
Ip
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 7251 2015-05-27 10:52 My_ocx3\My_ocx3\CvvImage.cpp
文件 2054 2015-05-27 10:51 My_ocx3\My_ocx3\CvvImage.h
文件 3438 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv\cv.h
文件 2411 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv\cv.hpp
文件 2850 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv\cvaux.h
文件 2346 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv\cvaux.hpp
文件 2184 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv\cvwimage.h
文件 2465 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv\cxcore.h
文件 2423 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv\cxcore.hpp
文件 2265 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv\cxeigen.hpp
文件 110 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv\cxmisc.h
文件 2306 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv\highgui.h
文件 2189 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv\ml.h
文件 37635 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv2\calib3d\calib3d.hpp
文件 38471 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv2\contrib\contrib.hpp
文件 3042 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv2\contrib\detection_ba
文件 7099 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv2\contrib\hybridtracker.hpp
文件 12807 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv2\contrib\openfabmap.hpp
文件 23958 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv2\contrib\retina.hpp
文件 15428 2014-02-04 11:57 My_ocx3\My_ocx3\include\opencv2\core\affine.hpp
文件 186316 2014-02-04 11:57 My_ocx3\My_ocx3\include\opencv2\core\core.hpp
文件 78497 2014-03-05 13:02 My_ocx3\My_ocx3\include\opencv2\core\core_c.h
文件 7854 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv2\core\cuda_devptrs.hpp
文件 2198 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv2\core\devmem2d.hpp
文件 9464 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv2\core\eigen.hpp
文件 18705 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv2\core\gpumat.hpp
文件 34132 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv2\core\internal.hpp
文件 80561 2014-01-10 11:00 My_ocx3\My_ocx3\include\opencv2\core\mat.hpp
文件 9346 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv2\core\opengl_interop.hpp
文件 9919 2013-12-20 17:49 My_ocx3\My_ocx3\include\opencv2\core\opengl_interop_deprecated.hpp
............此处省略206个文件信息
- 上一篇:MFC使用双栈实现简单计算器
- 下一篇:c++计算机图形编程-简易绘图程序
相关资源
- pdfview.ocx (2.1版本 带序列号)
- TeeChart8.ocx微软原配
- 数据结构课程程序设计实践运动会分
- mschart控件安装使用说明
- 华中科技大学操作系统实验报告.doc
- C++大作业4种排序算法演示.docx
- 利用C++builder 6编写热舒适性评价指标
- 鸡啄米:VS2010-MFC编程入门教程1-55.d
- UE4C++写入CSV文件.docx
- C语言五子棋实验报告.docx
- vc6.0上位机教程.docx
- c语言学习例题.docx
- 大学C语言考试题库(含答案).docx
- C++后两次实验题.docx
- C++标准函数库.docx
- 超简单的ntrip客户端C语言实现.docx
- c语言课程设计报告 会员卡计费系统源
- Vimba CPP Manual中文.docx
- C语言:中缀算术表达式求值栈 附答案
- C语言课程设计—运动会管理系统(
- 好用的ocx控件查看工具
- spooling模拟系统代码.docx
- Modbus Activex Control 1.4.5 破解版
- 最新版-传智扫地僧C++完整版.docx
-
dsofr
amer.ocx 2.3.0.0 含源码和ocx - 学生管理系统模板.docx
- MSCOMM32.OCXMSCOMM32.DEP.BAT(批处理文件
- 数据结构课后习题答案(第二版).
- c++实现RGB与HSI互相转换.docx
- AUTOSAR EB+PortDriver配置.docx(共三页)
评论
共有 条评论