|
简单的jpeg转成avi的类(1)
这是笔者写的一个小的类,用于把一系列jpeg文件转换为avi。 首先把源码帖出来:
//AviFormat.h
#ifndef _AVI_FORMAT_H_ #define _AVI_FORMAT_H_ #include <iostream> using namespace std; /* 4 bytes */ typedef int Word; typedef unsigned int DWORD; /* for use in AVI_avih.flags */ const DWORD AVIF_HASINDEX = 0x00000010; /* index at end of file */ const DWORD AVIF_MUSTUSEINDEX = 0x00000020; const DWORD AVIF_ISINTERLEAVED = 0x00000100; const DWORD AVIF_TRUSTCKTYPE = 0x00000800; const DWORD AVIF_WASCAPTUREFILE = 0x00010000; const DWORD AVIF_COPYRIGHTED = 0x00020000; strUCt AVI_avih { DWORD usec_per_frame; //* frame display rate (or 0L) */ DWORD max_bytes_per_sec; //* max. transfer rate */ DWORD padding; //* pad to multiples of this size; */ /* normally 2K */ DWORD flags; DWORD tot_frames; //* # frames in file */ DWORD init_frames; DWORD streams; DWORD buff_sz; DWORD width; DWORD height; DWORD reserved[4]; AVI_avih () {} AVI_avih (DWORD usec, DWORD max, DWORD pad, DWORD flags, DWORD tot, DWORD init, DWORD str, DWORD buff, DWORD w, DWORD h, DWORD* re = NULL) :usec_per_frame (usec), max_bytes_per_sec (max), padding (pad), tot_frames (tot) ,init_frames (init), streams (str), buff_sz (buff), width (w), height (h) { if (re != NULL) for (int i = 0; i < 4; ++i) reserved[i] = re[i]; else
|