AviMemDc: a C++ class
AviMemDc: a C++ class
This class is used in the Avi Examples.
The header file
AviMemDC.h
/*
AviMemDC.h
A C++ class for creating avi files
Copyright (c) 2004, 2005 René Nyffenegger
This source code is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this source code must not be misrepresented; you must not
claim that you wrote the original source code. If you use this source code
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original source code.
3. This notice may not be removed or altered from any source distribution.
René Nyffenegger rene.nyffenegger@adp-gmbh.ch
*/
#include "MemoryDC.h"
#include "DibSection.h"
#include "Color.h"
#include "Font.h"
#include "avi.h"
class AviMemDC : public MemoryDC {
public:
AviMemDC(int width, int height, std::string const& avi_file, int frames_per_second);
void AddFrame();
DibSection& GetDibSection();
private:
DibSection dib_section_;
Avi avi_;
bool compression_chosen_;
};
The implementation file
AviMemDC.cpp
/*
AviMemDC.cpp
A C++ class for creating avi files
Copyright (c) 2004, 2005 René Nyffenegger
This source code is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this source code must not be misrepresented; you must not
claim that you wrote the original source code. If you use this source code
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original source code.
3. This notice may not be removed or altered from any source distribution.
René Nyffenegger rene.nyffenegger@adp-gmbh.ch
*/
#include "AviMemDC.h"
AviMemDC::AviMemDC(int width, int height, std::string const& avi_file, int frames_per_second) :
MemoryDC(),
dib_section_(width, height),
avi_(avi_file, 1000/frames_per_second, 0),
compression_chosen_(false)
{
Select(dib_section_);
}
void AviMemDC::AddFrame() {
if (!compression_chosen_) {
avi_.compression(dib_section_, 0, true, 0);
compression_chosen_ = true;
}
avi_.add_frame(dib_section_);
}
DibSection& AviMemDC::GetDibSection() {
return dib_section_;
}
AviMemDc: a C++ class的更多相关文章
- Creating an generated Earth AVI with C++
Creating an generated Earth AVI with C++ EarthGenerator.cpp /* EarthGenerator.cpp An examp ...
随机推荐
- 硬件设计之串口收发器---ISO1050 (现行) 隔离式 5V CAN 收发器
http://www.ti.com.cn/product/cn/iso1050 http://www.deyisupport.com/question_answer/dsp_arm/sitara_ar ...
- 【BZOJ】1005: [HNOI2008]明明的烦恼(prufer编码+特殊的技巧)
http://www.lydsy.com/JudgeOnline/problem.php?id=1005 这里讲得挺清楚的:http://www.cnblogs.com/zhj5chengfeng/p ...
- ie设置ActiveX控件不提示
ie设置自动允许activex: 对安全设置-受信任的站点区域-对未标记为可安全执行脚本的ActiveX控件初始化并执形脚本(启用)
- mysql更改utf8编码方式
方法1: 一.查看数据库编码格式 1 mysql> show variables like 'character_set_database'; 二.查看数据表的编码格式 1 mysql> ...
- Windows下安装Apache 2.2.21图文教程
https://www.jb51.net/article/52086.htm 本文详细介绍了在Windows平台上安装Apache的过程,希望对初次安装Apache的朋友有所帮助. 1. 软件准备 我 ...
- open() 函数以 a+ 模式打开文件
这种模式打开文件,可读可写,从文件顶部读取内容,从文件底部追加内容,文件不存在则自动创建 [root@localhost ~]$ cat 1.txt aaa bbb ccc In [1]: data ...
- Securi-Pi:使用树莓派作为安全跳板
导读 像很多 LinuxJournal 的读者一样,我也过上了当今非常普遍的“科技游牧”生活,在网络之间,从一个接入点到另一个接入点,我们身处现实世界的不同地方却始终保持连接到互联网和日常使用的其它网 ...
- 使用async/await——Nodejs+ExpressJs+Babel
在使用诸如restify/expressjs等Nodejs Web Framework时,我们最头疼的问题就是回调黑洞. 虽然后又Koa/Koa2号称“The Next Framework”使用co解 ...
- Fragment,仿QQ空间
转载请注明出处:http://blog.csdn.net/yangyu20121224/article/details/9023451 在今天的这篇文章当中,我依然会以实战加理论结合 ...
- netty 网关 http请求 请求转发
https://netty.io/4.1/xref/io/netty/example/proxy/package-summary.html https://netty.io/4.1/xref/io/n ...