Go to the documentation of this file.
33 #ifndef vtkPixelBufferObject_h
34 #define vtkPixelBufferObject_h
37 #include "vtkRenderingOpenGL2Module.h"
96 vtkGetMacro(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,0);
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,0);
160 unsigned int dims[3],
int comps,
171 vtkGetMacro(Type,
int);
179 vtkGetMacro(Components,
int);
188 vtkGetMacro(Size,
unsigned int);
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);
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); }
334 unsigned int numtuples,
377 unsigned int BufferTarget;
bool Download1D(int type, void *data, unsigned int dim, int numcomps, vtkIdType increment)
Download data from pixel buffer to the 1D array.
void BindToPackedBuffer()
Convenience methods for binding.
bool Upload3D(int type, void *data, unsigned int dims[3], int comps, vtkIdType increments[3], int components, int *componentList)
Update data to PBO mapped sourcing it from a 3D array.
bool Upload2D(int type, void *data, unsigned int dims[2], int comps, vtkIdType increments[2])
Update data to PBO mapped sourcing it from a 2D array.
void * MapBuffer(int type, unsigned int numtuples, int comps, BufferType mode)
Map the buffer to our addresspace.
static bool IsSupported(vtkRenderWindow *renWin)
Returns if the context supports the required extensions.
void Allocate(unsigned int nbytes, BufferType mode)
Allocate PACKED/UNPACKED memory to hold nBytes of data.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void Allocate(int vtkType, unsigned int numtuples, int comps, BufferType mode)
Allocate PACKED/UNPACKED memory to hold numTuples*numComponents of vtkType.
abstract base class for most VTK objects
void * MapPackedBuffer()
Convenience api for mapping buffers to app address space.
void * MapUnpackedBuffer(int type, unsigned int numtuples, int comps)
static vtkPixelBufferObject * New()
void SetSize(unsigned int nTups, int nComps)
bool Download2D(int type, void *data, unsigned int dims[2], int numcomps, vtkIdType increments[2])
Download data from pixel buffer to the 2D array.
bool LoadRequiredExtensions(vtkRenderWindow *renWin)
Loads all required OpenGL extensions.
bool Download3D(int type, void *data, unsigned int dims[3], int numcomps, vtkIdType increments[3])
Download data from pixel buffer to the 3D array.
void UnmapBuffer(BufferType mode)
Un-map the buffer from our address space, OpenGL can then use/reclaim the buffer contents.
void CreateBuffer()
Create the pixel buffer object.
Interface class for querying and using OpenGL extensions.
void DestroyBuffer()
Destroys the pixel buffer object.
void Bind(BufferType buffer)
Make the buffer active.
a simple class to control print indentation
void ReleaseMemory()
Release the memory allocated without destroying the PBO handle.
void * MapPackedBuffer(int type, unsigned int numtuples, int comps)
void * MapBuffer(unsigned int numbytes, BufferType mode)
vtkRenderWindow * GetContext()
void * MapUnpackedBuffer(unsigned int numbytes)
void * MapPackedBuffer(unsigned int numbytes)
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
void UnBind()
Inactivate the buffer.
void * MapUnpackedBuffer()
void BindToUnPackedBuffer()
void UnmapUnpackedBuffer()
Convenience api for unmapping buffers from app address space.
create a window for renderers to draw into
void * MapBuffer(BufferType mode)
bool Upload1D(int type, void *data, unsigned int numtuples, int comps, vtkIdType increment)
Upload data to PBO mapped.
void SetContext(vtkRenderWindow *context)
Get/Set the context.
abstracts an OpenGL pixel buffer object.