|
简单的jpeg转成avi的类(7) // chunk strf ,strf_sz (sizeof (AVI_strf)) ,strf (sizeof (struct AVI_strf), width, height, 1 + 24*256*256 ,"MJPG", width * height * 3, 0, 0, 0, 0) // list odml ,list_odml ("LIST", 16, "odml", "dmlh", 4, frames) { avih_id[0] = 'a'; avih_id[1] = 'v'; avih_id[2] = 'i'; avih_id[3] = 'h'; strh_id[0] = 's'; strh_id[1] = 't'; strh_id[2] = 'r'; strh_id[3] = 'h'; strf_id[0] = 's'; strf_id[1] = 't'; strf_id[2] = 'r'; strf_id[3] = 'f'; } ~AVI_list_hdrl (){} friend ostream& operator << (ostream& out, AVI_list_hdrl const& hdrl) { out << hdrl.list_hdr << hdrl.avih_id[0] << hdrl.avih_id[1] << hdrl.avih_id[2] << hdrl.avih_id[3]; out << hdrl.avih_sz << hdrl.strl_hdr; out << hdrl.strh_id[0] << hdrl.strh_id[1] << hdrl.strh_id[2] << hdrl.strh_id[3]; out << hdrl.strh_sz << hdrl.strh; out << hdrl.strf_id[0] << hdrl.strf_id[1] << hdrl.strf_id[2] << hdrl.strf_id[3]; out << hdrl.strf_sz << hdrl.strf << hdrl.list_odml; return out; } }; #endif //_AVI_FORMAT_H_
//AviGenerator.h
#ifndef _AVI_GENERATOR_H_ #define _AVI_GENERATOR_H_ #define DEBUG_VERSION #include <stdio.h> #include <string> #include <vector> #include "AviFormat.h" using namespace std; /* 4 bytes */ typedef int WORD; typedef unsigned int DWORD; /* 1 byte */ typedef unsigned char BYTE; class AviGenerator { public: AviGenerator(void); ~AviGenerator(void); void set_avi_file (string const& file); void set_fps (int fps); int add_frame (string const& file);
|