34 #define AVI_HEADER_SIZE 0xe0
39 : m_file (fileName,
File::Create),
45 m_lineBytes = (m_size.x * 3 + 3) & -4;
46 m_frameBytes = m_lineBytes * m_size.y;
64 m_buffer.
resize(8 + m_frameBytes + 8 + m_numFrames * 16);
69 setTag(ofs + 0x00,
"00db");
70 setS32(ofs + 0x04, m_frameBytes);
75 for (
int y = 0;
y < m_size.y;
y++)
79 for (
int x = m_size.x;
x > 0;
x--)
91 setTag(ofs + 0x00,
"idx1");
92 setS32(ofs + 0x04, m_numFrames * 16);
97 for (
int i = 0; i < m_numFrames; i++)
99 S32 dwOffset = 4 + i * (m_frameBytes + 8);
100 setTag(ofs + 0x00,
"00db");
101 setS32(ofs + 0x04, 0x10);
102 setS32(ofs + 0x08, dwOffset);
103 setS32(ofs + 0x0c, m_frameBytes);
131 void AviExporter::setTag(
int ofs,
const char* tag)
145 void AviExporter::setS32(
int ofs,
S32 value)
151 ptr[1] = (
U8)(value >> 8);
152 ptr[2] = (
U8)(value >> 16);
153 ptr[3] = (
U8)(value >> 24);
158 void AviExporter::writeHeader(
void)
160 S32 dwMicroSecPerFrame = 1000000 / m_fps;
161 S32 dwMaxBytesPerSec = m_frameBytes * m_fps;
162 S32 dwSuggestedBufferSize = m_frameBytes + 8;
163 S32 rcFrame = m_size.x | (m_size.y << 16);
165 S32 moviSize = 4 + m_numFrames * (m_frameBytes + 8);
174 setTag(0x00,
"RIFF");
175 setS32(0x04, riffSize);
176 setTag(0x08,
"AVI ");
177 setTag(0x0c,
"LIST");
178 setS32(0x10, 0xd4 - 0x14);
179 setTag(0x14,
"hdrl");
180 setTag(0x18,
"avih");
181 setS32(0x1c, 0x58 - 0x20);
182 setS32(0x20, dwMicroSecPerFrame);
183 setS32(0x24, dwMaxBytesPerSec);
185 setS32(0x30, m_numFrames);
187 setS32(0x3c, dwSuggestedBufferSize);
188 setS32(0x40, m_size.x);
189 setS32(0x44, m_size.y);
191 setTag(0x58,
"LIST");
192 setS32(0x5c, 0xd4 - 0x60);
193 setTag(0x60,
"strl");
194 setTag(0x64,
"strh");
195 setS32(0x68, 0xa4 - 0x6c);
196 setTag(0x6c,
"vids");
197 setTag(0x70,
"DIB ");
200 setS32(0x8c, m_numFrames);
201 setS32(0x90, dwSuggestedBufferSize);
203 setS32(0x98, m_frameBytes);
204 setS32(0xa0, rcFrame);
206 setTag(0xa4,
"strf");
207 setS32(0xa8, 0xd4 - 0xac);
208 setS32(0xac, 0xd4 - 0xac);
209 setS32(0xb0, m_size.x);
210 setS32(0xb4, -m_size.y);
211 setS32(0xb8, 0x00180001);
212 setS32(0xc0, m_frameBytes);
214 setTag(0xd4,
"LIST");
215 setS32(0xd8, moviSize);
216 setTag(0xdc,
"movi");
const U8 * getPtr(const Vec2i &pos=0) const
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v GLuint v GLenum GLenum GLenum GLuint GLint level GLsizei GLuint framebuffers GLuint const GLchar name GLenum GLintptr GLsizeiptr GLvoid data GLuint GLenum GLint param GLuint GLenum GLint param GLhandleARB programObj GLenum GLenum GLsizei GLsizei height GLenum GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid pixels GLint GLsizei const GLfloat value GLint GLfloat GLfloat v1 GLint GLfloat GLfloat GLfloat v2 GLint GLsizei const GLfloat value GLint GLsizei GLboolean const GLfloat value GLuint program GLuint GLfloat x
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v GLuint v GLenum GLenum GLenum GLuint GLint level GLsizei GLuint framebuffers GLuint const GLchar name GLenum GLintptr GLsizeiptr GLvoid data GLuint GLenum GLint param GLuint GLenum GLint param GLhandleARB programObj GLenum GLenum GLsizei GLsizei height GLenum GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid pixels GLint GLsizei const GLfloat value GLint GLfloat GLfloat v1 GLint GLfloat GLfloat GLfloat v2 GLint GLsizei const GLfloat value GLint GLsizei GLboolean const GLfloat value GLuint program GLuint GLfloat GLfloat y
AviExporter(const String &fileName, Vec2i size, int fps)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value
virtual void write(const void *ptr, int size)
const T * getPtr(S idx=0) const
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr size
FW_CUDA_FUNC T min(void) const