framgrab.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. ** Command & Conquer Generals(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : WW3D *
  23. * *
  24. * $Archive:: /Commando/Code/ww3d2/framgrab.h $*
  25. * *
  26. * Author:: Greg Hjelstrom *
  27. * *
  28. * $Modtime:: 1/08/01 10:04a $*
  29. * *
  30. * $Revision:: 1 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef FRAMEGRAB_H
  39. #define FRAMEGRAB_H
  40. #ifndef ALWAYS_H
  41. #include "always.h"
  42. #endif
  43. #if defined (_MSC_VER)
  44. #pragma warning (push, 3) // (gth) system headers complain at warning level 4...
  45. #endif
  46. #ifndef _WINDOWS_
  47. #include "windows.h"
  48. #endif
  49. #ifndef _INC_WINDOWSX
  50. #include "windowsx.h"
  51. #endif
  52. #ifndef _INC_VFW
  53. #include "vfw.h"
  54. #endif
  55. #if defined (_MSC_VER)
  56. #pragma warning (pop)
  57. #endif
  58. // FramGrab.h: interface for the FrameGrabClass class.
  59. //
  60. //////////////////////////////////////////////////////////////////////
  61. class FrameGrabClass
  62. {
  63. public:
  64. enum MODE {
  65. RAW,
  66. AVI
  67. };
  68. // depending on which mode you select, it will produce either frames or an AVI.
  69. FrameGrabClass(const char *filename, MODE mode, int width, int height, int bitdepth, float framerate );
  70. virtual ~FrameGrabClass();
  71. void ConvertGrab(void *BitmapPointer);
  72. void Grab(void *BitmapPointer);
  73. long * GetBuffer() { return Bitmap; }
  74. float GetFrameRate() { return FrameRate; }
  75. protected:
  76. const char *Filename;
  77. float FrameRate;
  78. MODE Mode;
  79. long Counter; // used for incrementing filename cunter, etc.
  80. void GrabAVI(void *BitmapPointer);
  81. void GrabRawFrame(void *BitmapPointer);
  82. // avi settings
  83. PAVIFILE AVIFile;
  84. long *Bitmap;
  85. PAVISTREAM Stream;
  86. AVISTREAMINFO AVIStreamInfo;
  87. BITMAPINFOHEADER BitmapInfoHeader;
  88. // general purpose cleanup routine
  89. void CleanupAVI();
  90. // convert the SR image into AVI byte ordering
  91. void ConvertFrame(void *BitmapPointer);
  92. };
  93. #endif