NTrace
GPU ray tracing framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ImageBmpIO.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009-2011, NVIDIA Corporation
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of NVIDIA Corporation nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #include "io/ImageBmpIO.hpp"
29 #include "gui/Image.hpp"
30 #include "io/Stream.hpp"
31 
32 using namespace FW;
33 
34 //------------------------------------------------------------------------
35 
37 {
38  // Read header.
39 
40  int fileType = stream.readU16LE(); // bfType
41  stream.readU32LE(); // bfSize
42  stream.readU16LE(); // bfReserved1
43  stream.readU16LE(); // bfReserved2
44  int dataStart = stream.readU32LE(); // bfOffBits
45  int infoSize = stream.readU32LE(); // biSize
46  int width = stream.readU32LE(); // biWidth
47  int height = stream.readU32LE(); // biHeight
48  stream.readU16LE(); // biPlanes
49  int bpp = stream.readU16LE(); // biBitCount
50  int compression = stream.readU32LE(); // biCompression
51  stream.readU32LE(); // biSizeImage
52  stream.readU32LE(); // biXPelsPerMeter
53  stream.readU32LE(); // biYPelsPerMeter
54  int paletteSize = stream.readU32LE(); // biClrUsed
55  stream.readU32LE(); // biClrImportant
56 
57  // Interpret header.
58 
59  if (fileType != 19778)
60  setError("Not a BMP file!");
61  if (infoSize < 40)
62  setError("Invalid BMP header size!");
63  if (width < 1 || height < 1)
64  setError("Invalid BMP dimensions!");
65 
66  bool formatOk;
67  switch (bpp)
68  {
69  case 1: formatOk = (compression == 0); break;
70  case 4: formatOk = (compression == 0 || compression == 2); break;
71  case 8: formatOk = (compression == 0 || compression == 1); break;
72  case 24: formatOk = (compression == 0); break;
73  default: formatOk = false; break;
74  }
75  if (!formatOk)
76  setError("Unsupported BMP format %d/%d!", bpp, compression);
77 
78  if (bpp == 24)
79  paletteSize = 0;
80  else if (paletteSize == 0)
81  paletteSize = 1 << bpp;
82  else if (paletteSize < 1 || paletteSize > (1 << bpp))
83  setError("Invalid BMP palette size!");
84 
85  int headerEnd = 54;
86  int paletteStart = infoSize + 14;
87  int paletteEnd = paletteStart + paletteSize * 4;
88  if (dataStart < paletteEnd)
89  setError("Invalid BMP data offset!");
90 
91  if (hasError())
92  return NULL;
93 
94  // Read palette.
95 
96  Array<U8> palette(NULL, paletteSize * 4);
97  for (int i = headerEnd; i < paletteStart; i++)
98  stream.readU8();
99  stream.read(palette.getPtr(), palette.getNumBytes());
100 
101  // Decode each scanline.
102 
103  Image* image = new Image(Vec2i(width, height), ImageFormat::R8_G8_B8);
104  Array<S32> indices(NULL, width);
105  for (int i = paletteEnd; i < dataStart; i++)
106  stream.readU8();
107 
108  for (int y = height - 1; y >= 0; y--)
109  {
110  U8* ptr = (U8*)image->getMutablePtr(Vec2i(0, y));
111  int align = 0;
112 
113  // Raw color data.
114 
115  if (bpp == 24)
116  {
117  for (int x = 0; x < width; x++)
118  {
119  ptr[2] = stream.readU8();
120  ptr[1] = stream.readU8();
121  ptr[0] = stream.readU8();
122  ptr += 3;
123  }
124  align = width * 3;
125  }
126 
127  // Palette indices.
128 
129  else
130  {
131  // 2-bit palette.
132 
133  if (bpp == 1)
134  {
135  for (int x = 0; x < width; x += 8)
136  {
137  U8 v = stream.readU8();
138  for (int i = 0; i < 8 && x + i < width; i++)
139  {
140  indices[x + i] = v >> 7;
141  v <<= 1;
142  }
143  }
144  align = (width + 7) >> 3;
145  }
146 
147  // 4-bit palette, uncompressed.
148 
149  else if (bpp == 4 && !compression)
150  {
151  for (int x = 0; x < width; x += 2)
152  {
153  U8 v = stream.readU8();
154  indices[x] = v >> 4;
155  if (x + 1 < width)
156  indices[x + 1] = v & 0xF;
157  }
158  align = (width + 1) >> 1;
159  }
160 
161  // 8-bit palette, uncompressed.
162 
163  else if (bpp == 8 && !compression)
164  {
165  for (int x = 0; x < width; x++)
166  indices[x] = stream.readU8();
167  align = width;
168  }
169 
170  // 4-bit palette, RLE compression.
171 
172  else if (bpp == 4 && compression)
173  {
174  int x = 0;
175  bool ok = false;
176  for (;;)
177  {
178  U8 first = stream.readU8();
179  U8 second = stream.readU8();
180 
181  if (first != 0)
182  {
183  if (x + first > width)
184  break;
185  for (int i = 0; i < first; i++)
186  indices[x++] = ((i & 1) == 0) ? (second >> 4) : (second & 0xF);
187  }
188  else if (second < 3)
189  {
190  ok = (second == 0);
191  break;
192  }
193  else
194  {
195  if (x + second > width)
196  break;
197  for (int i = 0; i < second; i += 2)
198  {
199  U8 v = stream.readU8();
200  indices[x++] = v >> 4;
201  if (i + 1 < second)
202  indices[x++] = v & 0xF;
203  }
204  if (((second - 1) & 2) == 0)
205  stream.readU8();
206  }
207  }
208 
209  if (!ok || x != width)
210  setError("Corrupt BMP 4-bit RLE data!");
211  }
212 
213  // 8-bit palette, RLE compression.
214 
215  else if (bpp == 8 && compression)
216  {
217  int x = 0;
218  bool ok = false;
219  for (;;)
220  {
221  U8 first = stream.readU8();
222  U8 second = stream.readU8();
223 
224  if (first != 0)
225  {
226  if (x + first > width)
227  break;
228  for (int i = 0; i < first; i++)
229  indices[x++] = second;
230  }
231  else if (second < 3)
232  {
233  ok = (second == 0);
234  break;
235  }
236  else
237  {
238  if (x + second > width)
239  break;
240  for (int i = 0; i < second; i++)
241  indices[x++] = stream.readU8();
242  if ((second & 1) != 0)
243  stream.readU8();
244  }
245  }
246 
247  if (!ok || x != width)
248  setError("Corrupt BMP 8-bit RLE data!");
249  }
250 
251  for (int x = 0; x < width; x++)
252  {
253  if (indices[x] < 0 || indices[x] >= paletteSize)
254  {
255  setError("Invalid BMP color index!");
256  break;
257  }
258  const U8* p = &palette[indices[x] * 4];
259  *ptr++ = p[2];
260  *ptr++ = p[1];
261  *ptr++ = p[0];
262  }
263  }
264 
265  // Padding.
266 
267  while ((align & 3) != 0)
268  {
269  stream.readU8();
270  align++;
271  }
272  }
273 
274  // Footer.
275 
276  if ((bpp == 4 || bpp == 8) && compression)
277  if (stream.readU8() != 0 || stream.readU8() != 1)
278  setError("Corrupt BMP 8-bit RLE data!");
279 
280  // Handle errors.
281 
282  if (hasError())
283  {
284  delete image;
285  return NULL;
286  }
287  return image;
288 }
289 
290 //------------------------------------------------------------------------
291 
293 {
294  // Select format and convert.
295 
296  FW_ASSERT(image);
297  Vec2i size = image->getSize();
298  bool empty = (size.min() <= 0);
299  const Image* source = image;
300  Image* converted = NULL;
301 
302  if (empty || image->getFormat().getID() != ImageFormat::R8_G8_B8)
303  {
304  size = Vec2i(max(size.x, 1), max(size.y, 1));
305  converted = new Image(size, ImageFormat::R8_G8_B8);
306  if (empty)
307  converted->clear();
308  else
309  *converted = *image;
310  source = converted;
311  }
312 
313  // Write header.
314 
315  int lineBytes = (size.x * 3 + 3) & -4;
316  int fileBytes = lineBytes * size.y + 54;
317 
318  stream.writeU16LE(19778); // bfType
319  stream.writeU32LE(fileBytes); // bfSize
320  stream.writeU16LE(0); // bfReserved1
321  stream.writeU16LE(0); // bfReserved2
322  stream.writeU32LE(54); // bfOffBits
323  stream.writeU32LE(40); // biSize
324  stream.writeU32LE(size.x); // biWidth
325  stream.writeU32LE(size.y); // biHeight
326  stream.writeU16LE(1); // biPlanes
327  stream.writeU16LE(24); // biBitCount
328  stream.writeU32LE(0); // biCompression
329  stream.writeU32LE(0); // biSizeImage
330  stream.writeU32LE(0); // biXPelsPerMeter
331  stream.writeU32LE(0); // biYPelsPerMeter
332  stream.writeU32LE(0); // biClrUsed
333  stream.writeU32LE(0); // biClrImportant
334 
335  // Write image data.
336 
337  for (int y = size.y - 1; y >= 0; y--)
338  {
339  const U8* ptr = (const U8*)image->getPtr(Vec2i(0, y));
340  for (int x = 0; x < size.x; x++)
341  {
342  stream.writeU8(ptr[2]);
343  stream.writeU8(ptr[1]);
344  stream.writeU8(ptr[0]);
345  ptr += 3;
346  }
347  for (int x = size.x * 3; x < lineBytes; x++)
348  stream.writeU8(0);
349  }
350 
351  // Clean up.
352 
353  delete converted;
354 }
355 
356 //------------------------------------------------------------------------
#define NULL
Definition: Defs.hpp:39
void writeU16LE(U32 v)
Definition: Stream.hpp:71
void clear(U32 abgr=0)
Definition: Image.hpp:160
void setError(const char *fmt,...)
Definition: Defs.cpp:253
void ** ptr
Definition: DLLImports.cpp:74
ID getID(void) const
Definition: Image.cpp:78
const U8 * getPtr(const Vec2i &pos=0) const
Definition: Image.hpp:150
void exportBmpImage(OutputStream &stream, const Image *image)
Definition: ImageBmpIO.cpp:292
S getNumBytes(void) const
Definition: Array.hpp:225
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
Definition: DLLImports.inl:363
void writeU8(U32 v)
Definition: Stream.hpp:69
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
Definition: DLLImports.inl:363
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
Definition: DLLImports.inl:329
U8 readU8(void)
Definition: Stream.hpp:49
FW_CUDA_FUNC T max(const VectorBase< T, L, S > &v)
Definition: Math.hpp:462
#define FW_ASSERT(X)
Definition: Defs.hpp:67
Image * importBmpImage(InputStream &stream)
Definition: ImageBmpIO.cpp:36
U8 * getMutablePtr(const Vec2i &pos=0)
Definition: Image.hpp:151
bool hasError(void)
Definition: Defs.cpp:289
U32 readU32LE(void)
Definition: Stream.hpp:53
const Vec2i & getSize(void) const
Definition: Image.hpp:143
const ImageFormat & getFormat(void) const
Definition: Image.hpp:144
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 width
Definition: DLLImports.inl:347
unsigned char U8
Definition: Defs.hpp:83
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
Definition: DLLImports.inl:347
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
Definition: DLLImports.inl:66
void writeU32LE(U32 v)
Definition: Stream.hpp:73
const T * getPtr(S idx=0) const
Definition: Array.hpp:202
U16 readU16LE(void)
Definition: Stream.hpp:51
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void * image
Definition: DLLImports.inl:60
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
Definition: DLLImports.inl:319
FW_CUDA_FUNC T min(void) const
Definition: Math.hpp:146
virtual int read(void *ptr, int size)=0