home
 
 index of namespace default
 
 index of project tkopengl
 
 index of module tkopengl

Class tkopengl.Texture


SynopsisRepresents an OpenGL texture

  Methods:
  Constants:
Method adjustBrightness
Signature
adjustBrightness(floatbrightness)
Arguments
floatbrightness

 
 top of page
Method adjustGamma
Signature
adjustGamma(floatgamma)
Arguments
floatgamma

 
 top of page
Method alloc
Allocate bitmap data
Signature
alloc(intwidth,
  intheight,
  intnumBytesPerPixel 
  )  
 :boolean
Arguments
intwidth
intheight
intnumBytesPerPixel
Returns
boolean

 
 top of page
Method alloc2n
Allocate bitmap
Signature
alloc2n(intwidth,
  intheight,
  intbytesPerPixel 
  )  
 :boolean
Arguments
intwidth
intheight
intbytesPerPixel
Returns
boolean

 
 top of page
Method applyColorMap
Apply colormap to tex and store result in this texture
Signature
applyColorMap(Texturetex,
  Texturecmap 
  )  
Arguments
Texturetex
Texturecmap

 
 top of page
Method bind
Bind texture to associated OpenGL texture target
Signature
bind()

 
 top of page
Method blend
Signature
blend(Texturesrca,
  Texturesrcb,
  byteratio 
  )  
Arguments
Texturesrca
Texturesrcb
byteratio

 
 top of page
Method clear
Fill pixels with given clear color
Signature
clear(intargb32)
Arguments
intargb32

 
 top of page
Method colorKeyToAlpha
Signature
colorKeyToAlpha(intargb32)
Arguments
intargb32

 
 top of page
Method copyRegion
Signature
copyRegion(Texturesrctex,
  intpx,
  intpy,
  intw,
  inth,
  intdx,
  intdy 
  )  
Arguments
Texturesrctex
intpx
intpy
intw
inth
intdx
intdy

 
 top of page
Method countPixels
Signature
countPixels(intargb32)
 :float
Arguments
intargb32
Returns
float

 
 top of page
Method createMask
Signature
createMask(intcolorKey)
Arguments
intcolorKey

 
 top of page
Method disable
Disable texture target (glDisable())
Signature
disable()

 
 top of page
Method drawFilledBox
Signature
drawFilledBox(intpx,
  intpy,
  intsx,
  intsy,
  intargb32 
  )  
Arguments
intpx
intpy
intsx
intsy
intargb32

 
 top of page
Method drawLine
Simple bresenham line renderer
Signature
drawLine(intqx,
  intqy,
  intpx,
  intpy,
  intargb32 
  )  
Arguments
intqx
intqy
intpx
intpy
intargb32
Description

Was once used as a collision detection helper

 
 top of page
Method drawPixels2f
Draw texture via glDrawPixels
Signature
drawPixels2f(floatx,
  floaty 
  )  
Arguments
floatx
floaty

 
 top of page
Method drawPixels2i
Draw texture via glDrawPixels
Signature
drawPixels2i(intx,
  inty 
  )  
Arguments
intx
inty

 
 top of page
Method drawPixels3f
Draw texture via glDrawPixels
Signature
drawPixels3f(floatx,
  floaty,
  floatz 
  )  
Arguments
floatx
floaty
floatz

 
 top of page
Method drawPolygon
Simple polygon renderer
Signature
drawPolygon(Objectarray,
  intargb32 
  )  
Arguments
Objectarray
intargb32
Description

Was once used as a collision detection helper

 
 top of page
Method enable
Enable texture target (glEnable())
Signature
enable()

 
 top of page
Method expand2n
Automatically resize image and add black borders if width or height is not a power of two.
Signature
expand2n()

 
 top of page
Method flipY
Rotate bitmap 180 degrees about the x axis
Signature
flipY()
Description

Remember that (0; 0) is the left/bottom corner in OpenGL..

 
 top of page
Method free
Free bitmap data and OpenGL texture handle
Signature
free()

 
 top of page
Method freeImage
Free bitmap data
Signature
freeImage()

 
 top of page
Method getFgcolor
Signature
getFgcolor():int
Returns
int

 
 top of page
Method getFlags
Signature
getFlags():int
Returns
int

 
 top of page
Method getId
Query OpenGL texture name id
Signature
getId():int
Returns
int

 
 top of page
Method getMipMapLevel
Query OpenGL mip map level
Signature
getMipMapLevel():int
Returns
int

 
 top of page
Method getStride
Query number of bytes per scanline
Signature
getStride():int
Returns
int

 
 top of page
Method getSx
Query texture width
Signature
getSx():int
Returns
int

 
 top of page
Method getSy
Query texture height
Signature
getSy():int
Returns
int

 
 top of page
Method getTarget
Query OpenGL texture target
Signature
getTarget():int
Returns
int

 
 top of page
Method getXY32
Query pixel
Signature
getXY32(intx,
  inty 
  )  
 :int
Arguments
intx
inty
Returns
int

 
 top of page
Method getZ
Query number of bytes per pixel
Signature
getZ():int
Returns
int

 
 top of page
Method grayscale
Signature
grayscale():boolean
Returns
boolean

 
 top of page
Method interleaveAlpha
Signature
interleaveAlpha(TexturealphaTex)
Arguments
TexturealphaTex

 
 top of page
Method loadImage
Load local image and scale to the given geometry and depth.
Signature
loadImage(StringpakFileName,
  intnewWidth,
  intnewHeight,
  intnewNumBytes 
  )  
 :boolean
Arguments
StringpakFileNameLogic PAK file name
intnewWidthIf 0, keep original image width. Otherwise, scale loaded image to this width
intnewHeightIf 0, keep original image height. Otherwise, scale loaded image to this height
intnewNumBytesIf 0, keep original image depth. Otherwise, scale loaded image to the given number of bytes per pixel
Returns
boolean

 
 top of page
Method loadLocalImage
Load local image and scale to the given geometry and depth.
Signature
loadLocalImage(StringlocalFileName,
  intnewWidth,
  intnewHeight,
  intnewNumBytes 
  )  
 :boolean
Arguments
StringlocalFileNameLocal file name
intnewWidthIf 0, keep original image width. Otherwise, scale loaded image to this width
intnewHeightIf 0, keep original image height. Otherwise, scale loaded image to this height
intnewNumBytesIf 0, keep original image depth. Otherwise, scale loaded image to the given number of bytes per pixel
Returns
boolean

 
 top of page
Method multiply
Signature
multiply(Texturesrca,
  Texturesrcb 
  )  
Arguments
Texturesrca
Texturesrcb

 
 top of page
Method renderFixedText
Simple fixed font text renderer
Signature
renderFixedText(TexturefontTex,
  intcharWidth,
  Stringtext,
  intx,
  inty,
  IntArraycolors,
  IntArrayattributes 
  )  
Arguments
TexturefontTex
intcharWidth
Stringtext
intx
inty
IntArraycolors
IntArrayattributes

 
 top of page
Method saveImage
Signature
saveImage(StringlocalFileName)
 :boolean
Arguments
StringlocalFileName
Returns
boolean

 
 top of page
Method scaleFrom
Signature
scaleFrom(Texturesrc)
Arguments
Texturesrc

 
 top of page
Method scroll
Signature
scroll(intdx,
  intdy 
  )  
Arguments
intdx
intdy

 
 top of page
Method setEnvColor
Signature
setEnvColor(intargb32)
Arguments
intargb32

 
 top of page
Method setFgcolor
Set foreground color for image manipulation helpers
Signature
setFgcolor(intargb32)
Arguments
intargb32

 
 top of page
Method setFlags
Set texture flags.
Signature
setFlags(intflags)
Arguments
intflags
Description

These flags should usually be set before uploading the texture to OpenGL.

 
 top of page
Method setFlags
Signature
setFlags()

 
 top of page
Method setFlags
Signature
setFlags()

 
 top of page
Method setId
Set OpenGL texture name id
Signature
setId(intname)
Arguments
intname

 
 top of page
Method setMipMapLevel
Set OpenGL mip map level
Signature
setMipMapLevel(intlevel)
Arguments
intlevel

 
 top of page
Method setPriority
Set OpenGL texture priority
Signature
setPriority(floatprio)
 :float
Arguments
floatprio
Returns
float

 
 top of page
Method setScreen
Share bitmap data with other Texture
Signature
setScreen(Texturesrctex)
Arguments
Texturesrctex

 
 top of page
Method setScreenArea
Signature
setScreenArea(Texturesrctex,
  intltx,
  intlty,
  intwidth,
  intheight 
  )  
Arguments
Texturesrctex
intltx
intlty
intwidth
intheight

 
 top of page
Method setTarget
Set OpenGL texture target
Signature
setTarget(inttarget)
Arguments
inttarget

 
 top of page
Method setXY32
Put pixel
Signature
setXY32(intx,
  inty,
  intargb32 
  )  
Arguments
intx
inty
intargb32

 
 top of page
Method simpleBlur
Signature
simpleBlur(Texturesrc)
Arguments
Texturesrc

 
 top of page
Method simpleBlurX
Signature
simpleBlurX(Texturesrc)
Arguments
Texturesrc

 
 top of page
Method simpleBlurY
Signature
simpleBlurY(Texturesrc)
Arguments
Texturesrc

 
 top of page
Method swapScreen
Swap bitmap data
Signature
swapScreen(Texturetex)
Arguments
Texturetex

 
 top of page
Method unload
Free OpenGL texture handle
Signature
unload()

 
 top of page
Method update
(Re-)Upload to OpenGL
Signature
update()

 
 top of page
Method updateRegion
(Re-) upload region to OpenGL
Signature
updateRegion(intx,
  inty,
  intw,
  inth 
  )  
Arguments
intx
inty
intw
inth

 
 top of page
Method upload
Signature
upload()

 
 top of page
Method visitBuffer
Share (non-deletable) buffer view.
Signature
visitBuffer(Bufferbuffer,
  intw,
  inth,
  intbpp 
  )  
Arguments
BufferbufferBuffer object that holds the pixel data. Please notice that the buffer "offset" is taken into account when determing the effective buffer pointer and available size.
intwWidth
inthHeight
intbppBytes per pixel

 
 top of page
Constant TEX_16BIT (int)
Hint OpenGL to store that texture in a 16bit per pixel format
Constant TEX_1D (int)
Use GL_TEXTURE_1D texture target
Constant TEX_ALPHA (int)
Use alpha channel
Constant TEX_AUTOMIPMAP (int)
Automatically generate mip maps
Constant TEX_BLEND (int)
Constant TEX_CLAMPTOEDGE_S (int)
Constant TEX_CLAMPTOEDGE_T (int)
Constant TEX_DECAL (int)
Constant TEX_DELETE (int)
Delete bitmap after texture has been uploaded to OpenGL
Constant TEX_ENVMASK (int)
Constant TEX_FILTERMASK (int)
Constant TEX_FORCEHOSTBYTEORDER (int)
Hint that the bitmap uses the host byte order (e.g. A,B,G,R on little endian)
Constant TEX_INTENSITY (int)
Upload 8bit texture in INTENSITY format
Constant TEX_MAGFILTERLINEAR (int)
Constant TEX_MAGFILTERTRILINEAR (int)
Constant TEX_MINFILTERLINEAR (int)
Constant TEX_MINFILTERTRILINEAR (int)
Constant TEX_MODULATE (int)
Allow the texels to be modulated by the current OpenGL color
Constant TEX_POINTSPRITE (int)
Constant TEX_REPEATMASK (int)
Constant TEX_REPEAT_S (int)
Repeat texels along the x axis
Constant TEX_REPEAT_T (int)
Repeat texels along the y axis
Constant TEX_REPLACE (int)
Constant TEX_UPLOADED (int)
This flag is set when the texture has been uploaded to OpenGL

 

Project Modules:tkopengl 
Project Classes:DisplayList , Texture 
Project Functions:glActiveTexture , glAlphaFunc , glArrayElement , glAttachShader , glBegin , glBindAttribLocation , glBindBuffer , glBindFragDataLocation , glBindFragDataLocationIndexed , glBindFramebuffer , glBindRenderbuffer , glBindSampler , glBindTexture , glBlendColor , glBlendEquation , glBlendFunc , glBlendFuncSeparate , glCallList , glCheckFramebufferStatus , glClear , glClearColor , glClearDepth , glClearStencil , glClientActiveTexture , glColor3f , glColor3ub , glColor4f , glColor4ub , glColorMask , glColorMaterial , glCompileShader , glCopyPixels , glCopyTexImage2D , glCopyTexSubImage2D , glCopyTexSubImage3D , glCreateProgram , glCreateShader , glCullFace , glDeleteProgram , glDeleteShader , glDepthFunc , glDepthMask , glDetachShader , glDisable , glDisableClientState , glDisableVertexAttribArray , glDrawArrays , glDrawBuffer , glDrawBuffers , glDrawElements , glEdgeFlag , glEnable , glEnableClientState , glEnableVertexAttribArray , glEnd , glFinish , glFlush , glFramebufferRenderbuffer , glFramebufferTexture1D , glFramebufferTexture2D , glFramebufferTexture3D , glFrontFace , glFrustum , glGenerateMipmap , glGetAttribLocation , glGetError , glGetFloatv , glGetFragDataIndex , glGetFragDataLocation , glGetIntegerv , glGetProgramInfoLog , glGetShaderInfoLog , glGetString , glGetUniformLocation , glHint , glIsBuffer , glIsEnabled , glIsFramebuffer , glIsRenderbuffer , glLightModeli , glLineStipple , glLineWidth , glLinkProgram , glLoadIdentity , glLoadMatrixf , glLogicOp , glMatrixMode , glMultiTexCoord1f , glMultiTexCoord2f , glMultiTexCoord3f , glNormal3f , glOrtho , glPixelZoom , glPointParameterf , glPointSize , glPolygonMode , glPolygonOffset , glPopAttrib , glPopClientAttrib , glPopMatrix , glPushAttrib , glPushClientAttrib , glPushMatrix , glRasterPos2i , glRasterPos3f , glReadBuffer , glRectf , glRenderbufferStorage , glRotatef , glSamplerParameteri , glScalef , glScissor , glShadeModel , glStencilFunc , glStencilMask , glStencilOp , glTexCoord1f , glTexCoord1i , glTexCoord2f , glTexCoord2i , glTexCoord3f , glTexEnvf , glTexEnvi , glTexGeni , glTexImage1D , glTexImage2D , glTexImage3D , glTexParameteri , glTexSubImage2D , glTranslatef , glUniform1f , glUniform1i , glUniform2f , glUniform2i , glUniform3f , glUniform3i , glUniform4f , glUniform4i , glUniformMatrix2fv , glUniformMatrix3fv , glUniformMatrix4fv , glUnmapBuffer , glUseProgram , glValidateProgram , glVertex2f , glVertex2i , glVertex3f , glVertex4f , glVertexAttrib1f , glVertexAttrib2f , glVertexAttrib3f , glVertexAttrib4f , glVertexAttrib4Nub , glVertexAttribPointer , glViewport , zglBufferData , zglBufferSubData , zglClipPlane , zglColor1f , zglColorARGB , zglColorOffset , zglColorPointer3f , zglColorPointer4b , zglColorPointer4f , zglDeleteBuffer , zglDeleteFramebuffer , zglDeleteRenderbuffer , zglDeleteSampler , zglDeleteTexture , zglFogAlphaMode , zglFogColor4f , zglFogDensity , zglFogEnd , zglFogMode , zglFogStart , zglFrustum , zglGenBuffer , zglGenFramebuffer , zglGenRenderbuffer , zglGenSampler , zglGenTexture , zglGetActiveUniform , zglGetFloat , zglGetFramebufferAttachmentParameteri , zglGetInteger , zglGetProgrami , zglGetRenderbufferParameteri , zglGetShaderi , zglInit2D , zglInitOrtho , zglInitPerspective , zglLightAmbient4f , zglLightConstantAttenuation , zglLightDiffuse4f , zglLightLinearAttenuation , zglLightMaterialAmbient4f , zglLightMaterialAmbientAndDiffuse4f , zglLightMaterialDiffuse4f , zglLightMaterialEmission4f , zglLightMaterialShininess , zglLightMaterialSpecular4f , zglLightModelAmbient4f , zglLightModelColorControl , zglLightModelLocalViewer , zglLightModelTwoSide , zglLightPositionf , zglLightQuadraticAttenuation , zglLightSpecular4f , zglLightSpotCutOff , zglLightSpotDirectionf , zglLightSpotExponent , zglLoadExtensions , zglMapBuffer , zglNormalOffset , zglNormalPointer , zglPointParameter3f , zglReadColorPixel , zglReadColorPixelsX , zglReadDepthPixel , zglShaderSource , zglTexCoordOffset , zglTexCoordPointer1f , zglTexCoordPointer2f , zglTexEnvColor4f , zglTexGen4f , zgluLookAt , zglVertexOffset , zglVertexPointer , zglVertexPointer2f 
All Namespaces:default , ui 
All Projects:core , debugtext , tkfreetype2 , tkmath , tkmidi , tkopengl , tkportaudio , tksdl , tkui , tkunit 


auto-generated by "DOG", the TkScript document generator. Mon, 28/Dec/2015 13:15:54