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 ...
随机推荐
- 构造方法也可以实现overloading
构造方法也可以实现overloading.例: public void teach(){}; public void teach(int a){}; public void teach(String ...
- c#并行扫描端口控制台程序
static void Main(string[] args) { Console.WriteLine("请输入ip"); string ip = Console.ReadLine ...
- Java中arraylist和linkedlist源代码分析与性能比較
Java中arraylist和linkedlist源代码分析与性能比較 1,简单介绍 在java开发中比較经常使用的数据结构是arraylist和linkedlist,本文主要从源代码角度分析arra ...
- CSDN日报20170411 ——《怎样给自己的私活项目标价》
[程序人生]怎样给自己的私活项目标价 作者:瞬息之间 非常早之前讲过我们"怎么接私活的心得技巧".相信非常多同学听了心里痒痒的.据我认识的(无论是现实生活还是网上接触的)朋友来看. ...
- SPS读书笔记1——均值比较(T检验,方差检验,非参数检验汇总)
均值比较.单样本T检验(One-sample Test))目的:检验单个变量的均值与给定的某个常数是否一致.)判断标准:p<0.05;t>1.98即认为是有显著差异的..独立样本T检验(I ...
- vue axios配置 发起请求加载loading请求结束关闭loading
axios带有请求拦截器,避免在每个请求里面加loading重复操作,可以封装进去,在请求开始时加载loading层,请求结束关闭,loading层用vux的loading加载 axios.js im ...
- Java中的常用方法
Java中的常用方法 第一章 字符串 1.获取字符串的长度:length() 2.判断字符串的前缀或后缀与已知字符串是否相同 前缀 startsWith(String s).后缀 endsWit ...
- 按批次处理list数据 (list按条数取)
按批次处理list数据的两种方法 主要应用于list存储数据过多,不能使list整体进行其余操作 Java | 复制 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ...
- PHP 常用资源
Apache:http://httpd.apache.org/download.cgi PHP:http://windows.php.net/download#php-5.6 MySQL:http:/ ...
- 阿里云OSS分片上传DEMO
分片传输规则 1.不能超过10000片,2.每片必须大于100KB using System; using System.Collections.Generic; using System.Compo ...