33 #ifndef vtkPixelBufferObject_h
34 #define vtkPixelBufferObject_h
37 #include "vtkRenderingOpenGL2Module.h"
41 class vtkOpenGLExtensionManager;
96 vtkGetMacro(Usage,
int);
97 vtkSetMacro(Usage,
int);
111 unsigned int numtuples,
int comps,
vtkIdType increment)
113 unsigned int newdims[3];
114 newdims[0] = numtuples;
118 newinc[0] = increment;
121 return this->Upload3D(
type,
data, newdims, comps, newinc,0,
nullptr);
135 unsigned int dims[2],
139 unsigned int newdims[3];
140 newdims[0] = dims[0];
141 newdims[1] = dims[1];
144 newinc[0] = increments[0];
145 newinc[1] = increments[1];
147 return this->Upload3D(
type,
data, newdims, comps, newinc,0,
nullptr);
160 unsigned int dims[3],
int comps,
171 vtkGetMacro(Type,
int);
172 vtkSetMacro(Type,
int);
179 vtkGetMacro(Components,
int);
180 vtkSetMacro(Components,
int);
188 vtkGetMacro(Size,
unsigned int);
189 vtkSetMacro(Size,
unsigned int);
190 void SetSize(
unsigned int nTups,
int nComps);
197 vtkGetMacro(Handle,
unsigned int);
210 unsigned int newdims[3];
215 newincrements[0] = increment;
216 newincrements[1] = 0;
217 newincrements[2] = 0;
218 return this->Download3D(
type,
data, newdims, numcomps, newincrements);
229 unsigned int dims[2],
232 unsigned int newdims[3];
233 newdims[0] = dims[0];
234 newdims[1] = dims[1];
237 newincrements[0] = increments[0];
238 newincrements[1] = increments[1];
239 newincrements[2] = 0;
240 return this->Download3D(
type,
data, newdims, numcomps, newincrements);
249 bool Download3D(
int type,
void*
data,
250 unsigned int dims[3],
257 { this->Bind(PACKED_BUFFER); }
260 { this->Bind(UNPACKED_BUFFER); }
272 {
return this->MapBuffer(PACKED_BUFFER); }
275 {
return this->MapBuffer(
type, numtuples, comps, PACKED_BUFFER); }
278 {
return this->MapBuffer(numbytes, PACKED_BUFFER); }
281 {
return this->MapBuffer(UNPACKED_BUFFER); }
284 {
return this->MapBuffer(
type, numtuples, comps, UNPACKED_BUFFER); }
287 {
return this->MapBuffer(numbytes, UNPACKED_BUFFER); }
294 { this->UnmapBuffer(UNPACKED_BUFFER); }
297 { this->UnmapBuffer(PACKED_BUFFER); }
309 void Bind(BufferType buffer);
318 void *MapBuffer(
int type,
unsigned int numtuples,
int comps, BufferType
mode);
319 void *MapBuffer(
unsigned int numbytes, BufferType
mode);
320 void *MapBuffer(BufferType
mode);
327 void UnmapBuffer(BufferType
mode);
334 unsigned int numtuples,
348 void ReleaseMemory();
374 void DestroyBuffer();