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 ...
随机推荐
- SpringCloud架构设计
最近一直在针对SpringCloud框架做项目,从中踩了不少的坑,也渐渐梳理出了一些内容,由于SpringCloud作为一个全家桶,其中东西太多,所以这时候就要有所取舍,这里就想把自己比较常用组件及架 ...
- web 前端 转盘界面
http://www.cnblogs.com/arfeizhang/p/turntable.html "如果有个做转盘的需求,你准备怎么做?设计师只会提供一个转盘的图片,其余都需要你完成,不 ...
- "reason":"No handler for type [attachment] declared on field [file]" 最完全解决方案
0.elasticsearch-mapper-attachments 2.3.4安装 mapper-attachments安装方法分两类,在线和离线: 在线安装 bin/elasticsearch-p ...
- joomla对象注入漏洞分析
0x00 漏洞简单介绍 jooomla 1.5 到 3.4.5 的全部版本号中存在反序列化对象造成对象注入的漏洞,漏洞利用无须登录,直接在前台就可以运行随意PHP代码. Joomla 安全团队紧急公布 ...
- NPOI导出Excle
前端: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" con ...
- 自定义View总结
写的很好,代你分析原码,关于 View Measure 测量机制,让我一次把话说完
- Linux网络流量控制工具—Netem
第一篇:概念篇 Netem 是 Linux 2.6 及以上内核版本提供的一个网络模拟功能模块.该功能模块可以用来在性能良好的局域网中,模拟出复杂的互联网传输性能,诸如低带宽.传输延迟.丢包等等情况.使 ...
- VS2013新特性
大家可能看到我这边颜色和字体和原本不同,这里特意分享给大家背景护眼色值(这对每天看电脑的程序员很重要对不对!)还有字体: 工具-选项-字体和颜色:在项背景点击自定义-色调85 饱和度123 亮度205 ...
- Cognos组织架构介绍
Cognos只是一个工具,说到Cognos相信大部分人都知道BI(商业智能,Business Intelligence). Cognos也是属于SOA架构,面向服务的体系结构,是一个组件模型,它将应用 ...
- 【BZOJ3120】Line 矩阵乘法
[BZOJ3120]Line Description Wayne喜欢排队……不对,是Wayne所在学校的校长喜欢看大家排队,尤其是在操场上站方阵.某日课间操时,校长童心大发想了一个极具观赏性的列队方案 ...