[4] | 1 | /******************************************************************************
|
---|
| 2 | * SAGE - Scalable Adaptive Graphics Environment
|
---|
| 3 | *
|
---|
| 4 | * Copyright (C) 2004 Electronic Visualization Laboratory,
|
---|
| 5 | * University of Illinois at Chicago
|
---|
| 6 | *
|
---|
| 7 | * All rights reserved.
|
---|
| 8 | *
|
---|
| 9 | * Redistribution and use in source and binary forms, with or without
|
---|
| 10 | * modification, are permitted provided that the following conditions are met:
|
---|
| 11 | *
|
---|
| 12 | * * Redistributions of source code must retain the above copyright
|
---|
| 13 | * notice, this list of conditions and the following disclaimer.
|
---|
| 14 | * * Redistributions in binary form must reproduce the above
|
---|
| 15 | * copyright notice, this list of conditions and the following disclaimer
|
---|
| 16 | * in the documentation and/or other materials provided with the distribution.
|
---|
| 17 | * * Neither the name of the University of Illinois at Chicago nor
|
---|
| 18 | * the names of its contributors may be used to endorse or promote
|
---|
| 19 | * products derived from this software without specific prior written permission.
|
---|
| 20 | *
|
---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
---|
| 22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
---|
| 23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
---|
| 24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
---|
| 25 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
---|
| 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
---|
| 27 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
---|
| 28 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
---|
| 29 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
---|
| 30 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
---|
| 31 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 32 | *
|
---|
| 33 | * Direct questions, comments etc about SAGE to http://www.evl.uic.edu/cavern/forum/
|
---|
| 34 | *
|
---|
| 35 | *****************************************************************************/
|
---|
| 36 |
|
---|
| 37 | #pragma once
|
---|
| 38 |
|
---|
| 39 | #ifndef __AVIFILE_H
|
---|
| 40 | #define __AVIFILE_H
|
---|
| 41 |
|
---|
| 42 | #include <vfw.h>
|
---|
| 43 |
|
---|
| 44 | class CAviFile
|
---|
| 45 | {
|
---|
| 46 | HDC m_hAviDC;
|
---|
| 47 | HANDLE m_hHeap;
|
---|
| 48 | LPVOID m_lpBits;
|
---|
| 49 | LONG m_lSample;
|
---|
| 50 | TCHAR m_szFileName[MAX_PATH];
|
---|
| 51 | PAVIFILE m_pAviFile;
|
---|
| 52 | PAVISTREAM m_pAviStream;
|
---|
| 53 | PAVISTREAM m_pAviCompressedStream;
|
---|
| 54 | AVISTREAMINFO m_AviStreamInfo;
|
---|
| 55 | AVICOMPRESSOPTIONS m_AviCompressOptions;
|
---|
| 56 |
|
---|
| 57 | int nAppendFuncSelector; //0=Dummy 1=FirstTime 2=Usual
|
---|
| 58 | HRESULT AppendFrameFirstTime(HBITMAP );
|
---|
| 59 | HRESULT AppendFrameUsual(HBITMAP);
|
---|
| 60 | HRESULT AppendDummy(HBITMAP);
|
---|
| 61 | HRESULT (CAviFile::*pAppendFrame[3])(HBITMAP hBitmap);
|
---|
| 62 |
|
---|
| 63 | HRESULT AppendFrameFirstTime(int, int, LPVOID,int );
|
---|
| 64 | HRESULT AppendFrameUsual(int, int, LPVOID,int );
|
---|
| 65 | HRESULT AppendDummy(int, int, LPVOID,int );
|
---|
| 66 | HRESULT (CAviFile::*pAppendFrameBits[3])(int, int, LPVOID,int );
|
---|
| 67 | void ReleaseMemory();
|
---|
| 68 | public:
|
---|
| 69 | CAviFile(LPCSTR lpszFileName=_T("Output.avi"));
|
---|
| 70 | ~CAviFile(void);
|
---|
| 71 | HRESULT AppendNewFrame(HBITMAP hBitmap);
|
---|
| 72 | HRESULT AppendNewFrame(int nWidth, int nHeight, LPVOID pBits,int nBitsPerPixel=32);
|
---|
| 73 | };
|
---|
| 74 |
|
---|
| 75 | #endif
|
---|