This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.
ofTexture.h
Go to the documentation of this file.
102OF_DEPRECATED_MSG("Use member method ofTexture::setTextureWrap() instead.",void ofSetTextureWrap(GLfloat wrapS = GL_CLAMP_TO_EDGE, GLfloat wrapT = GL_CLAMP_TO_EDGE));
110OF_DEPRECATED_MSG("Use member method ofTexture::setTextureWrap() instead.",bool ofGetUsingCustomTextureWrap());
119OF_DEPRECATED_MSG("Use member method ofTexture::setTextureWrap() instead.",void ofRestoreTextureWrap());
131OF_DEPRECATED_MSG("Use member method ofTexture::setTextureMinMagFilter() instead.",void ofSetMinMagFilters(GLfloat minFilter = GL_LINEAR, GLfloat magFilter = GL_LINEAR));
136OF_DEPRECATED_MSG("Use member method ofTexture::setTextureMinMagFilter() instead.",bool ofGetUsingCustomMinMagFilters());
142OF_DEPRECATED_MSG("Use member method ofTexture::setTextureMinMagFilter() instead.",void ofRestoreMinMagFilters());
335 virtual void allocate(int w, int h, int glInternalFormat, bool bUseARBExtension, int glFormat, int pixelType);
609 void draw(const glm::vec3 & p1, const glm::vec3 & p2, const glm::vec3 & p3, const glm::vec3 & p4) const;
651 void drawSubsection(float x, float y, float w, float h, float sx, float sy, float sw, float sh) const;
672 void drawSubsection(float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const;
674 ofMesh getQuad(const glm::vec3 & p1, const glm::vec3 & p2, const glm::vec3 & p3, const glm::vec3 & p4) const;
690 ofMesh getMeshForSubsection(float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh, bool vflipped, ofRectMode rectMode) const;
Definition ofGraphicsBaseTypes.h:139
virtual void draw(float x, float y) const
Draw at a position at the native size.
Definition ofGraphicsBaseTypes.h:150
Definition ofBufferObject.h:8
bool bFlipTexture
Should the texture be flipped vertically?
Definition ofTexture.h:209
GLint wrapModeHorizontal
How will the texture wrap around horizontally?
Definition ofTexture.h:216
GLint wrapModeVertical
How will the texture wrap around vertically?
Definition ofTexture.h:217
GLint magFilter
Filter to use for magnification (enlargement).
Definition ofTexture.h:214
ofTexCompression compressionType
Texture compression type.
Definition ofTexture.h:210
float tex_u
Texture vertical coordinate, ratio of height to display height.
Definition ofTexture.h:204
GLint minFilter
Filter to use for minification (reduction).
Definition ofTexture.h:213
unsigned int bufferId
Optionally if the texture is backed by a buffer so we can bind it.
Definition ofTexture.h:219
float tex_t
Texture horizontal coordinate, ratio of width to display width.
Definition ofTexture.h:203
void drawSubsection(float x, float y, float w, float h, float sx, float sy) const
Draw a subsection of the texture.
Definition ofTexture.cpp:1050
void disableMipmap()
Sets flag disallowing texture to auto-generate mipmap.
Definition ofTexture.cpp:1010
void loadScreenData(int x, int y, int w, int h)
Copy an area of the screen into this texture.
Definition ofTexture.cpp:761
ofTexture & operator=(const ofTexture &mom)
Copy a given ofTexture into this texture.
Definition ofTexture.cpp:218
void disableTextureTarget(int textureLocation) const
Disable a texture target.
bool hasMipmap() const
Find out if a mipmap has been generated for the current texture.
Definition ofTexture.cpp:1016
OF_DEPRECATED_MSG("Use isAllocated instead", bool bAllocated() const)
Has the texture been allocated?
void setAnchorPoint(float x, float y)
Set the anchor point the texture is drawn around in pixels.
Definition ofTexture.cpp:816
void copyTo(ofBufferObject &buffer) const
Copy the texture to an ofBufferObject.
Definition ofTexture.cpp:1252
virtual void allocate(const ofTextureData &textureData)
Allocate the texture using the given settings.
Definition ofTexture.cpp:408
void setUseExternalTextureID(GLuint externTexID)
Set the texture ID.
Definition ofTexture.cpp:299
void setCompression(ofTexCompression compression)
Set the texture compression.
Definition ofTexture.cpp:999
void enableMipmap()
Sets flag allowing texture to auto-generate a mipmap.
Definition ofTexture.cpp:1004
void allocateAsBufferTexture(const ofBufferObject &buffer, int glInternalFormat)
Allocate texture as a Buffer Texture.
Definition ofTexture.cpp:378
void setAnchorPercent(float xPct, float yPct)
Set the anchor point the texture is drawn around as a percentage.
Definition ofTexture.cpp:808
void setRGToRGBASwizzles(bool rToRGBSwizzles)
Swizzle RGBA to grayscale with alpha in the red channel.
Definition ofTexture.cpp:486
void disableTextureMatrix()
Disable the texture matrix.
Definition ofTexture.cpp:913
void setTextureMinMagFilter(GLint minFilter, GLint magFilter)
Set texture minification/magnification scaling filters.
Definition ofTexture.cpp:965
glm::vec2 getCoordFromPercent(float xPts, float yPts) const
Helper to convert display coordinate to texture coordinate.
Definition ofTexture.cpp:930
void generateMipmap()
Generate mipmap for the current texture.
Definition ofTexture.cpp:694
void setTextureMatrix(const glm::mat4 &m)
Sets a texture matrix to be uploaded whenever the texture is bound.
Definition ofTexture.cpp:906
void disableAlphaMask()
Disable the alpha mask.
Definition ofTexture.cpp:861
bool isAllocated() const
Determine whether the texture has been allocated.
Definition ofTexture.cpp:256
void setAlphaMask(ofTexture &mask)
Set another ofTexture to use as an alpha mask.
Definition ofTexture.cpp:847
glm::vec2 getCoordFromPoint(float xPos, float yPos) const
Helper to convert display coordinate to texture coordinate.
Definition ofTexture.cpp:869
ofTextureData & getTextureData()
Internal texture data access.
Definition ofTexture.cpp:262
void resetAnchor()
Reset the anchor point to (0, 0).
Definition ofTexture.cpp:824
void setSwizzle(GLenum srcSwizzle, GLenum dstChannel)
Swizzle a channel to another.
Definition ofTexture.cpp:536
void readToPixels(ofPixels &pixels) const
Read current texture data from the GPU into pixels.
Definition ofTexture.cpp:1219
void setTextureWrap(GLint wrapModeHorizontal, GLint wrapModeVertical)
Set texture wrapping.
Definition ofTexture.cpp:955
ofMesh getQuad(const glm::vec3 &p1, const glm::vec3 &p2, const glm::vec3 &p3, const glm::vec3 &p4) const
Definition ofTexture.cpp:1179
void loadData(const uint8_t *const data, int w, int h, int glFormat)
Load byte pixel data.
Definition ofTexture.cpp:545
void enableTextureTarget(int textureLocation) const
Enable a texture target.
void unbind(int textureLocation=0) const
Unbind the texture.
Definition ofTexture.cpp:835
ofMesh getMeshForSubsection(float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh, bool vflipped, ofRectMode rectMode) const
Get a mesh that has the texture coordinates set.
Definition ofTexture.cpp:1079
ofRectMode
Used to represent the available rectangle drawing modes.
Definition ofGraphicsConstants.h:139
void ofSetMinMagFilters(GLfloat minFilter, GLfloat magFilter)
Definition ofTexture.cpp:83
void ofDisableTextureEdgeHack()
Disable global texture "edge hack".
Definition ofTexture.cpp:29
void ofEnableNormalizedTexCoords()
Use normalized (0 - 1) texture coordinates.
Definition ofTexture.cpp:44
bool ofGetUsingNormalizedTexCoords()
Check whether OF is using normalized or pixel texture coordinates.
Definition ofTexture.cpp:39
bool ofIsTextureEdgeHackEnabled()
Check whether OF is using the texture "edge hack".
Definition ofTexture.cpp:34
bool ofGetUsingArbTex()
Check whether OF is using GL_TEXTURE_RECTANGLE rectangular or GL_TEXTURE_2D textures.
Definition ofTexture.cpp:109
void ofDisableNormalizedTexCoords()
Use pixel-based texture coordinates.
Definition ofTexture.cpp:49
void ofEnableTextureEdgeHack()
Enable the global texture "edge hack" to compensate for edge artifacts.
Definition ofTexture.cpp:24