资源简介
C++ 解析rtsp流后返回Iplimage,用Opengl显示.VS2012,opencv是2.4.10.代码完整
代码片段和文件信息
#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 )
{
IplImage* img = image.GetImage();
if( img )
{
CopyOf( img desired_color );
}
}
#define HG_IS_IMAGE(img) \
((img) != 0 && ((const IplImage*)(img))->nSize ==
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 631616 2015-08-30 10:28 TestRtsp\Debug\msvcp100d.dll
文件 1467200 2015-08-30 10:28 TestRtsp\Debug\msvcr100d.dll
文件 2072064 2015-08-30 10:29 TestRtsp\Debug\opencv_core2410.dll
文件 3475456 2015-08-30 10:29 TestRtsp\Debug\opencv_core2410d.dll
文件 2079232 2015-08-30 10:29 TestRtsp\Debug\opencv_highgui2410.dll
文件 3593216 2015-08-30 10:29 TestRtsp\Debug\opencv_highgui2410d.dll
文件 1909760 2015-08-30 10:29 TestRtsp\Debug\opencv_imgproc2410.dll
文件 3141632 2015-08-30 10:29 TestRtsp\Debug\opencv_imgproc2410d.dll
文件 22298624 2015-07-02 10:08 TestRtsp\Debug\Rtsp\avcodec-56.dll
文件 1380352 2015-07-02 10:08 TestRtsp\Debug\Rtsp\avdevice-56.dll
文件 2395648 2015-07-02 10:08 TestRtsp\Debug\Rtsp\avfilter-5.dll
文件 6050304 2015-07-02 10:08 TestRtsp\Debug\Rtsp\avformat-56.dll
文件 495104 2015-07-02 10:08 TestRtsp\Debug\Rtsp\avutil-54.dll
文件 326656 2015-11-02 21:53 TestRtsp\Debug\Rtsp\libEasyRTSPClient.dll
文件 131584 2015-07-02 10:08 TestRtsp\Debug\Rtsp\postproc-53.dll
文件 2013184 2016-07-02 17:46 TestRtsp\Debug\Rtsp\RtspLib.dll
文件 282112 2015-07-02 10:08 TestRtsp\Debug\Rtsp\swresample-1.dll
文件 487424 2015-07-02 10:08 TestRtsp\Debug\Rtsp\swscale-3.dll
文件 218624 2017-02-24 11:21 TestRtsp\Debug\TestRtsp.exe
文件 6608 2017-02-16 16:58 TestRtsp\TestRtsp\CVVImage.cpp
文件 1906 2017-02-16 16:58 TestRtsp\TestRtsp\CVVImage.h
文件 1905 2016-07-02 17:50 TestRtsp\TestRtsp\dynamicRtsp.h
文件 186519 2015-08-30 10:28 TestRtsp\TestRtsp\OpenCv\core.hpp
文件 78496 2015-08-30 10:28 TestRtsp\TestRtsp\OpenCv\core_c.h
文件 3413 2016-01-19 13:26 TestRtsp\TestRtsp\OpenCv\cv.h
文件 9133 2015-08-30 10:28 TestRtsp\TestRtsp\OpenCv\highgui.hpp
文件 27766 2015-08-30 10:28 TestRtsp\TestRtsp\OpenCv\highgui_c.h
文件 30315 2015-08-30 10:28 TestRtsp\TestRtsp\OpenCv\imgproc_c.h
文件 16423 2015-08-30 10:28 TestRtsp\TestRtsp\OpenCv\imgproc_types_c.h
文件 80679 2015-08-30 10:28 TestRtsp\TestRtsp\OpenCv\mat.hpp
............此处省略169个文件信息
相关资源
- 缓冲区分析
- C++开发web服务框架之HTTP Web框架的设计
- MFC通过OpenCV 显示到Picture control
- 使用c++开发的人脸识别 demo
- Visual C++实现MPEG/JPEG编解码技术代码集
- 计算路口通过车辆的 OPENCV C++
- Centos 6.7 gcc和gcc-c++的离线安装包
- Visual C++ +SQL Server数据库应用完全解析
- 吃豆子游戏 C++
- C++数据结构实现池塘夜降彩色雨附带
- Hands-On GUI Programming with C++ and Qt5
- Directshow实现的虚拟摄像头win10+vs2013
- C++ MFC 吹泡泡 源代码
- C++使用protobuf 作为网络消息协议
- Microsoft Visual C++ 2013 runtime 64/32 运行库
- libstdc++.so.6.0.23
- Introduction to Design Patterns in C++ with Qt
- 游戏编程代码\\游戏编程学习笔记之九
- 《c++程序设计》谭浩强完整版
- C++ Primer第五版 源代码
- C++沉思录 第2版 经典必读
- c++程序设计 谭浩强176905
- 《VC++网络编程开发与实战光盘》案例
- C++Primer电子书第五版中文版及答案 高
- C++电子书.rar
- 黑马程序员c++配套课件 《轻松搞定
- C++从入门到精通 (第2版).pdf
- Primerc++.pdf
- C++实现CNN识别手写数字
- modbus tcp/rtu客户端服务端通讯程序合集
评论
共有 条评论