19 #ifndef EQUTIL_TEXTURE_H
20 #define EQUTIL_TEXTURE_H
22 #include <eq/client/frame.h>
24 #include <lunchbox/thread.h>
25 #include <lunchbox/nonCopyable.h>
31 namespace detail {
class Texture; }
38 class Texture :
public lunchbox::NonCopyable
49 EQ_API
Texture(
const unsigned target,
50 const GLEWContext*
const glewContext = 0 );
64 uint32_t getCompressorTarget()
const;
81 const uint32_t type );
93 EQ_API
unsigned getType()
const;
96 EQ_API
unsigned getName()
const;
118 EQ_API
void init(
const unsigned internalFormat,
const int32_t width,
119 const int32_t height );
128 void applyZoomFilter(
const ZoomFilter filter )
const;
130 void applyWrap()
const;
141 EQ_API
void upload(
const int32_t width,
const int32_t height,
148 EQ_API
void download(
void* buffer )
const;
151 EQ_API
void bind()
const;
154 EQ_API
void bindToFBO(
const unsigned target,
const int32_t width,
155 const int32_t height );
158 EQ_API
void resize(
const int32_t width,
const int32_t height );
161 EQ_API
void writeRGB(
const std::string& filename )
const;
164 EQ_API
const GLEWContext* glewGetContext()
const;
165 EQ_API
void setGLEWContext(
const GLEWContext* context );
188 EQ_API
void setGLData(
const unsigned id,
const unsigned internalFormat,
189 const int32_t width,
const int32_t height );
193 detail::Texture*
const _impl;
203 void _setInternalFormat(
const unsigned internalFormat );
209 void _grow(
const int32_t width,
const int32_t height );
211 LB_TS_VAR( _thread );
216 #endif // EQUTIL_TEXTURE_H
void upload(const int32_t width, const int32_t height, const void *ptr)
Copy the specified buffer to the texture at 0,0.
void writeRGB(const std::string &filename) const
Write the texture data as an rgb image file.
unsigned getInternalFormat() const
void bindToFBO(const unsigned target, const int32_t width, const int32_t height)
Create and bind a texture to the current FBO.
void download(void *buffer) const
Copy the texture data from the GPU to the given memory address.
int32_t getHeight() const
ZoomFilter
Filtering algorithm to applied during zoom operations.
void copyFromFrameBuffer(const unsigned internalFormat, const fabric::PixelViewport &pvp)
Copy the specified area from the current read buffer to the texture at 0,0.
void setExternalFormat(const uint32_t format, const uint32_t type)
Set the external data format and type.
void flushNoDelete()
Flush the texture without deleting the GL texture name.
void bind() const
Bind the texture.
virtual ~Texture()
Destruct the texture.
Holds a 2D pixel viewport with methods for manipulation.
unsigned getFormat() const
void resize(const int32_t width, const int32_t height)
Resize the texture.
void setGLData(const unsigned id, const unsigned internalFormat, const int32_t width, const int32_t height)
Use an OpenGL texture created externally.
A wrapper around OpenGL textures.
Texture(const unsigned target, const GLEWContext *const glewContext=0)
Construct a new Texture.
void flush()
Clear the texture, including deleting the GL texture name.
void init(const unsigned internalFormat, const int32_t width, const int32_t height)
Initialize an OpenGL texture.
unsigned getTarget() const