codeanticode.glgraphics
Class GLTexture

java.lang.Object
  extended by processing.core.PImage
      extended by codeanticode.glgraphics.GLTexture
All Implemented Interfaces:
GLConstants, java.lang.Cloneable, processing.core.PConstants

public class GLTexture
extends processing.core.PImage
implements processing.core.PConstants, GLConstants

This class adds an opengl texture to a PImage object. The texture is handled in a similar way to the pixels property: image data can be copied to and from the texture using loadTexture and updateTexture methods. However, bringing the texture down to image or pixels data can slow down the application considerably (since involves copying texture data from GPU to CPU), especially when handling large textures. So it is recommended to do all the texture handling without calling updateTexture, and doing so only at the end if the texture is needed as a regular image.


Field Summary
 
Fields inherited from class processing.core.PImage
format, height, parent, pixels, width
 
Fields inherited from interface processing.core.PConstants
A, AB, ADD, AG, ALPHA, ALPHA_MASK, ALT, AMBIENT, AR, ARC, ARGB, ARROW, B, BACKSPACE, BASELINE, BEEN_LIT, BEVEL, BLEND, BLUE_MASK, BLUR, BOTTOM, BOX, BURN, CENTER, CENTER_DIAMETER, CENTER_RADIUS, CHATTER, CLOSE, CMYK, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CUSTOM, DA, DARKEST, DB, DEG_TO_RAD, DELETE, DG, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ACCURATE_TEXTURES, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_OPENGL_2X_SMOOTH, DISABLE_OPENGL_ERROR_REPORT, DODGE, DOWN, DR, DXF, EB, EDGE, EG, ELLIPSE, ENABLE_ACCURATE_TEXTURES, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_2X_SMOOTH, ENABLE_OPENGL_4X_SMOOTH, ENABLE_OPENGL_ERROR_REPORT, ENTER, EPSILON, ER, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, G, GIF, GRAY, GREEN_MASK, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LEFT, LIGHTEST, LINE, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MOVE, MULTIPLY, NORMAL, NORMALIZED, NX, NY, NZ, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, platformNames, POINT, POINTS, POLYGON, POSTERIZE, PROBLEM, PROJECT, QUAD, QUAD_STRIP, QUADS, QUARTER_PI, R, RAD_TO_DEG, RADIUS, RECT, RED_MASK, REPLACE, RETURN, RGB, RIGHT, ROUND, SA, SB, SCREEN, SG, SHAPE, SHIFT, SHINE, SOFT_LIGHT, SPB, SPG, SPHERE, SPOT, SPR, SQUARE, SR, SUBTRACT, SW, TAB, TARGA, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, TX, TY, TZ, U, UP, V, VERTEX_FIELD_COUNT, VW, VX, VY, VZ, WAIT, WHITESPACE, WINDOWS, X, Y, Z
 
Fields inherited from interface codeanticode.glgraphics.GLConstants
COLOR, DOUBLE, FLOAT, GL_DEPTH_STENCIL, GL_DEPTH24_STENCIL8, GL_UNSIGNED_INT_24_8, GLGRAPHICS, LINEAR, LINEAR_MIPMAP_LINEAR, LINEAR_MIPMAP_NEAREST, NEAREST, NEAREST_MIPMAP_LINEAR, NEAREST_MIPMAP_NEAREST, TEX_FILTER_PARAM_FLOAT, TEX_FILTER_PARAM_INT, TEX_FILTER_PARAM_MAT2, TEX_FILTER_PARAM_MAT3, TEX_FILTER_PARAM_MAT4, TEX_FILTER_PARAM_VEC2, TEX_FILTER_PARAM_VEC3, TEX_FILTER_PARAM_VEC4, TEX_INT, TEX_UBYTE, TEX1, TEX1D, TEX2D, TEX3, TEX4, TEXRECT
 
Constructor Summary
GLTexture(processing.core.PApplet parent)
          Creates an instance of GLTexture with size 1x1.
GLTexture(processing.core.PApplet parent, int size)
          Creates an instance of GLTexture with power-of-two width and height that such that width * height is the closest to size.
GLTexture(processing.core.PApplet parent, int size, GLTextureParameters params)
          Creates an instance of GLTexture with power-of-two width and height that such that width height is the closest to size, and with the specified parameters.
GLTexture(processing.core.PApplet parent, int width, int height)
          Creates an instance of GLTexture with size width x height.
GLTexture(processing.core.PApplet parent, int width, int height, GLTextureParameters params)
          Creates an instance of GLTexture with size width x height and with the specified parameters.
GLTexture(processing.core.PApplet parent, int width, int height, int format)
          Creates an instance of GLTexture with size width x height and with the specified format.
GLTexture(processing.core.PApplet parent, int width, int height, int format, int filter)
          Creates an instance of GLTexture with size width x height and with the specified format and filtering.
GLTexture(processing.core.PApplet parent, java.lang.String filename)
          Creates an instance of GLTexture using image file filename as source.
GLTexture(processing.core.PApplet parent, java.lang.String filename, GLTextureParameters params)
          Creates an instance of GLTexture using image file filename as source and the specified texture parameters.
GLTexture(processing.core.PApplet parent, java.lang.String filename, int format)
          Creates an instance of GLTexture using image file filename as source and the specified format.
GLTexture(processing.core.PApplet parent, java.lang.String filename, int format, int filter)
          Creates an instance of GLTexture using image file filename as source and the specified format and filtering.
 
Method Summary
 boolean available()
          Returns true if the texture has been initialized.
 void clear(float gray)
          Fills the texture with the specified gray tone.
 void clear(float gray, float alpha)
          Fills the texture with the specified gray tone and alpha value.
 void clear(float x, float y, float z)
          Fills the texture with the specified color components.
 void clear(float x, float y, float z, float a)
          Fills the texture with the specified color components and alpha component.
 void clear(int gray)
          Fills the texture with the specified gray tone.
 void clear(int rgb, float alpha)
          Fills the texture with the specified rgb color and alpha value.
 void clear(int gray, int alpha)
          Fills the texture with the specified gray tone and alpha value.
 void clear(int x, int y, int z)
          Fills the texture with the specified color components.
 void clear(int x, int y, int z, int a)
          Fills the texture with the specified color components and alpha component.
 void filter(GLTextureFilter texFilter, GLTexture destTex)
          Applies filter texFilter using this texture as source and destTex as destination.
 void filter(GLTextureFilter texFilter, GLTexture[] destTexArray, float fadeConst)
          Applies filter texFilter using this texture as source, destTex as multiple destinations and fadeConst as the fading constant for the filter.
 void filter(GLTextureFilter texFilter, GLTexture[] destTexArray, float fadeConst, float[]... values)
          Applies filter texFilter using this texture as source, destTex as multiple destinations and fadeConst as the fading constant for the filter.
 void filter(GLTextureFilter texFilter, GLTexture destTex, float fadeConst)
          Applies filter texFilter using this texture as source, destTex as destination and fadeConst as the fading constant for the filter.
 void filter(GLTextureFilter texFilter, GLTexture destTex, float[]... values)
          Applies filter texFilter using this texture as source and destTex as destination.
 void filter(GLTextureFilter texFilter, GLTexture destTex, float fadeConst, float[]... values)
          Applies filter texFilter using this texture as source, destTex as destination and fadeConst as the fading constant for the filter.
 void getBuffer(float[] floatArray, int format)
          Copies the texture into floatArray.
 void getBuffer(int[] intArray)
          Copies the texture into intArray, assuming that the array has 4 components and the pixels are unsigned bytes.
 void getBuffer(int[] intArray, int format)
          Copies the texture into intArray, using the specified format and assuming that the pixels are unsigned bytes.
 void getBuffer(int[] intArray, int format, int type)
          Copies the texture into intArray, using the specified format and type.
 void getByteBuffer(int[] intArray, int format)
          Copies the texture into intArray, using the specified format and assuming that the pixels are unsigned bytes.
 void getImage(processing.core.PImage img)
          Copies texture to img.
 void getIntBuffer(int[] intArray, int format)
          Copies the texture into intArray, using the specified format and assuming that the pixels are integers.
 float getMaxTextureCoordS()
          Returns the maximum possible value for the texture coordinate S.
 float getMaxTextureCoordT()
          Returns the maximum possible value for the texture coordinate T.
 int getTextureID()
          Provides the ID of the opegl texture object.
 int getTextureInternalFormat()
          Returns the texture internal format.
 int getTextureMagFilter()
          Returns the texture magnification filter.
 int getTextureMinFilter()
          Returns the texture minimization filter.
 int getTextureTarget()
          Returns the texture target.
 void init(int width, int height)
          Sets the size of the image and texture to width x height.
 void init(int width, int height, GLTextureParameters params)
          Sets the size of the image and texture to width x height, and the parameters of the texture to params.
 boolean isFlippedX()
          Returns true if the texture is flipped along the horizontal direction.
 boolean isFlippedY()
          Returns true if the texture is flipped along the vertical direction.
 void loadTexture()
          Copy pixels to texture (loadPixels should have been called beforehand).
 void loadTexture(java.lang.String filename)
          Load texture, pixels and image from file.
 void loadTexture(java.lang.String filename, GLTextureParameters params)
          Load texture, pixels and image from file using the specified texture parameters.
 void loadTexture(java.lang.String filename, int format)
          Load texture, pixels and image from file using the specified texture format.
 void loadTexture(java.lang.String filename, int format, int filter)
          Load texture, pixels and image from file using the specified texture format and filtering.
 void paint(float gray)
          Paints the texture with the specified gray tone.
 void paint(float gray, float alpha)
          Paints the texture with the specified gray tone and alpha value.
 void paint(float x, float y, float z)
          Paints the texture with the specified color components.
 void paint(float x, float y, float z, float a)
          Paints the texture with the specified color components and alpha component.
 void paint(int gray)
          Paints the texture with the specified gray tone.
 void paint(int rgb, float alpha)
          Paints the texture with the specified rgb color and alpha value.
 void paint(int gray, int alpha)
          Paints the texture with the specified gray tone and alpha value.
 void paint(int x, int y, int z)
          Paints the texture with the specified color components.
 void paint(int x, int y, int z, int a)
          Paints the texture with the specified color components and alpha component.
 void putBuffer(float[] floatArray)
          Copies floatArray into the texture, assuming that the array has 4 components.
 void putBuffer(float[] floatArray, int format)
          Copies floatArray into the texture, using the specified format.
 void putBuffer(int[] intArray)
          Copies intArray into the texture, assuming that the array contains 4 color components and pixels are unsigned bytes.
 void putBuffer(int[] intArray, int format)
          Copies intArray into the texture, using the specified format and assuming that the pixels are unsigned bytes.
 void putBuffer(int[] intArray, int format, int type)
          Copies intArray into the texture, using the format and type specified.
 void putBuffer(java.nio.IntBuffer buffer, int format, int type)
          Copies buffer into the texture, using the format and type specified.
 void putByteBuffer(int[] intArray, int format)
          Copies intArray into the texture, using the specified format and assuming that the pixels are unsigned bytes.
 void putImage(processing.core.PImage img)
          Puts img into texture, pixels and image.
 void putImage(processing.core.PImage img, GLTextureParameters params)
          Puts img into texture, pixels and image.
 void putImage(processing.core.PImage img, int format)
          Puts img into texture, pixels and image.
 void putImage(processing.core.PImage img, int format, int filter)
          Puts img into texture, pixels and image.
 void putIntBuffer(int[] intArray, int format)
          Copies intArray into the texture, using the specified format and assuming that the pixels are integers.
 void putPixelsIntoTexture(processing.core.PImage img)
          Puts pixels of img into texture only.
 void putPixelsIntoTexture(processing.core.PImage img, int x, int y, int w, int h)
          Puts the pixels of img inside the rectangle (x, y, x+w, y+h) into texture only.
 void render()
          Draws the texture using the opengl commands, inside a rectangle located at the origin with the original size of the texture.
 void render(float x, float y)
          Draws the texture using the opengl commands, inside a rectangle located at (x,y) with the original size of the texture.
 void render(float x, float y, float w, float h)
          Draws the texture using the opengl commands, inside a rectangle of width w and height h located at (x,y).
 void setFlippedX(boolean v)
          Sets the texture as flipped or not flipped on the horizontal direction.
 void setFlippedY(boolean v)
          Sets the texture as flipped or not flipped on the vertical direction.
 void setRandom(float r0, float r1, float g0, float g1, float b0, float b1, float a0, float a1)
          Sets the texture to have random values in the ranges specified for each component.
 void setRandomDir2D(float r0, float r1, float phi0, float phi1)
          Sets the texture to have random values in the first two coordinates chosen on the circular region defined by the parameters.
 void setRandomDir3D(float r0, float r1, float phi0, float phi1, float theta0, float theta1)
          Sets the texture to have random values in the first three coordinates chosen on the spherical region defined by the parameters.
 void setValue(float r, float g, float b, float a)
          Sets the texture to have the same given float value in each component.
 void setZero()
          Sets to zero all the pixels of the texture.
 void updateTexture()
          Copy texture to pixels (doesn't call updatePixels).
 boolean usingMipmaps()
          Returns true or false whether or not the texture is using mipmaps.
 
Methods inherited from class processing.core.PImage
blend, blend, blendColor, clone, copy, copy, filter, filter, get, get, get, getCache, getImage, init, isModified, loadPixels, mask, mask, removeCache, resize, save, set, set, setCache, setModified, setModified, updatePixels, updatePixels
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GLTexture

public GLTexture(processing.core.PApplet parent)
Creates an instance of GLTexture with size 1x1. The texture is not initialized.

Parameters:
parent - PApplet

GLTexture

public GLTexture(processing.core.PApplet parent,
                 int width,
                 int height)
Creates an instance of GLTexture with size width x height. The texture is initialized (empty) to that size.

Parameters:
parent - PApplet
width - int
height - int

GLTexture

public GLTexture(processing.core.PApplet parent,
                 int width,
                 int height,
                 GLTextureParameters params)
Creates an instance of GLTexture with size width x height and with the specified parameters. The texture is initialized (empty) to that size.

Parameters:
parent - PApplet
width - int
height - int
params - GLTextureParameters

GLTexture

public GLTexture(processing.core.PApplet parent,
                 int width,
                 int height,
                 int format)
Creates an instance of GLTexture with size width x height and with the specified format. The texture is initialized (empty) to that size.

Parameters:
parent - PApplet
width - int
height - int
format - int

GLTexture

public GLTexture(processing.core.PApplet parent,
                 int width,
                 int height,
                 int format,
                 int filter)
Creates an instance of GLTexture with size width x height and with the specified format and filtering. The texture is initialized (empty) to that size.

Parameters:
parent - PApplet
width - int
height - int
format - int
filter - int

GLTexture

public GLTexture(processing.core.PApplet parent,
                 java.lang.String filename)
Creates an instance of GLTexture using image file filename as source.

Parameters:
parent - PApplet
filename - String

GLTexture

public GLTexture(processing.core.PApplet parent,
                 java.lang.String filename,
                 GLTextureParameters params)
Creates an instance of GLTexture using image file filename as source and the specified texture parameters.

Parameters:
parent - PApplet
filename - String
params - GLTextureParameters

GLTexture

public GLTexture(processing.core.PApplet parent,
                 java.lang.String filename,
                 int format)
Creates an instance of GLTexture using image file filename as source and the specified format.

Parameters:
parent - PApplet
filename - String
format - int

GLTexture

public GLTexture(processing.core.PApplet parent,
                 java.lang.String filename,
                 int format,
                 int filter)
Creates an instance of GLTexture using image file filename as source and the specified format and filtering.

Parameters:
parent - PApplet
filename - String
format - int
filter - int

GLTexture

public GLTexture(processing.core.PApplet parent,
                 int size)
Creates an instance of GLTexture with power-of-two width and height that such that width * height is the closest to size. The texture is initialized (empty) to that size.

Parameters:
parent - PApplet
size - int

GLTexture

public GLTexture(processing.core.PApplet parent,
                 int size,
                 GLTextureParameters params)
Creates an instance of GLTexture with power-of-two width and height that such that width height is the closest to size, and with the specified parameters. The texture is initialized (empty) to that size.

Parameters:
parent - PApplet
size - int
params - GLTextureParameters
Method Detail

init

public void init(int width,
                 int height)
Sets the size of the image and texture to width x height. If the texture is already initialized, it first destroys the current opengl texture object and then creates a new one with the specified size.

Parameters:
width - int
height - int

init

public void init(int width,
                 int height,
                 GLTextureParameters params)
Sets the size of the image and texture to width x height, and the parameters of the texture to params. If the texture is already initialized, it first destroys the current opengl texture object and then creates a new one with the specified size.

Parameters:
width - int
height - int
params - GLTextureParameters

available

public boolean available()
Returns true if the texture has been initialized.

Returns:
boolean

getTextureID

public int getTextureID()
Provides the ID of the opegl texture object.

Returns:
int

getTextureTarget

public int getTextureTarget()
Returns the texture target.

Returns:
int

getTextureInternalFormat

public int getTextureInternalFormat()
Returns the texture internal format.

Returns:
int

getTextureMinFilter

public int getTextureMinFilter()
Returns the texture minimization filter.

Returns:
int

getTextureMagFilter

public int getTextureMagFilter()
Returns the texture magnification filter.

Returns:
int

usingMipmaps

public boolean usingMipmaps()
Returns true or false whether or not the texture is using mipmaps.

Returns:
boolean

getMaxTextureCoordS

public float getMaxTextureCoordS()
Returns the maximum possible value for the texture coordinate S.

Returns:
float

getMaxTextureCoordT

public float getMaxTextureCoordT()
Returns the maximum possible value for the texture coordinate T.

Returns:
float

isFlippedX

public boolean isFlippedX()
Returns true if the texture is flipped along the horizontal direction.

Returns:
boolean;

setFlippedX

public void setFlippedX(boolean v)
Sets the texture as flipped or not flipped on the horizontal direction.

Parameters:
v - boolean;

isFlippedY

public boolean isFlippedY()
Returns true if the texture is flipped along the vertical direction.

Returns:
boolean;

setFlippedY

public void setFlippedY(boolean v)
Sets the texture as flipped or not flipped on the vertical direction.

Parameters:
v - boolean;

putImage

public void putImage(processing.core.PImage img)
Puts img into texture, pixels and image.

Parameters:
img - PImage

putImage

public void putImage(processing.core.PImage img,
                     int format)
Puts img into texture, pixels and image.

Parameters:
img - PImage
format - int

putImage

public void putImage(processing.core.PImage img,
                     int format,
                     int filter)
Puts img into texture, pixels and image.

Parameters:
img - PImage
format - int
filter - int

putImage

public void putImage(processing.core.PImage img,
                     GLTextureParameters params)
Puts img into texture, pixels and image.

Parameters:
img - PImage
params - GLTextureParameters

putPixelsIntoTexture

public void putPixelsIntoTexture(processing.core.PImage img)
Puts pixels of img into texture only.

Parameters:
img - PImage

putPixelsIntoTexture

public void putPixelsIntoTexture(processing.core.PImage img,
                                 int x,
                                 int y,
                                 int w,
                                 int h)
Puts the pixels of img inside the rectangle (x, y, x+w, y+h) into texture only.

Parameters:
img - PImage
x - int
y - int
w - int
h - int

getImage

public void getImage(processing.core.PImage img)
Copies texture to img.

Parameters:
img - PImage

loadTexture

public void loadTexture(java.lang.String filename)
Load texture, pixels and image from file.

Parameters:
filename - String

loadTexture

public void loadTexture(java.lang.String filename,
                        GLTextureParameters params)
Load texture, pixels and image from file using the specified texture parameters.

Parameters:
filename - String
params - GLTextureParameters

loadTexture

public void loadTexture(java.lang.String filename,
                        int format)
Load texture, pixels and image from file using the specified texture format.

Parameters:
filename - String
format - int

loadTexture

public void loadTexture(java.lang.String filename,
                        int format,
                        int filter)
Load texture, pixels and image from file using the specified texture format and filtering.

Parameters:
filename - String
format - int
filter - int

loadTexture

public void loadTexture()
Copy pixels to texture (loadPixels should have been called beforehand).


updateTexture

public void updateTexture()
Copy texture to pixels (doesn't call updatePixels).


filter

public void filter(GLTextureFilter texFilter,
                   GLTexture destTex)
Applies filter texFilter using this texture as source and destTex as destination.

Parameters:
texFilter - GLTextureFilter
destTex - GLTexture

filter

public void filter(GLTextureFilter texFilter,
                   GLTexture destTex,
                   float[]... values)
Applies filter texFilter using this texture as source and destTex as destination. Sets all the value for all the parameters, by means of a parameter list of variable length. values is an array of float[].

Parameters:
texFilter - GLTextureFilter
destTex - GLTexture
float[] - values

filter

public void filter(GLTextureFilter texFilter,
                   GLTexture destTex,
                   float fadeConst)
Applies filter texFilter using this texture as source, destTex as destination and fadeConst as the fading constant for the filter.

Parameters:
texFilter - GLTextureFilter
destTex - GLTexture
fadeConst - float

filter

public void filter(GLTextureFilter texFilter,
                   GLTexture destTex,
                   float fadeConst,
                   float[]... values)
Applies filter texFilter using this texture as source, destTex as destination and fadeConst as the fading constant for the filter. Sets all the value for all the parameters, by means of a parameter list of variable length. values is an array of float[].

Parameters:
texFilter - GLTextureFilter
destTex - GLTexture
fadeConst - float
float[] - values

filter

public void filter(GLTextureFilter texFilter,
                   GLTexture[] destTexArray,
                   float fadeConst)
Applies filter texFilter using this texture as source, destTex as multiple destinations and fadeConst as the fading constant for the filter.

Parameters:
texFilter - GLTextureFilter
destTexArray - GLTexture[]
fadeConst - float

filter

public void filter(GLTextureFilter texFilter,
                   GLTexture[] destTexArray,
                   float fadeConst,
                   float[]... values)
Applies filter texFilter using this texture as source, destTex as multiple destinations and fadeConst as the fading constant for the filter. Sets all the value for all the parameters, by means of a parameter list of variable length. values is an array of float[].

Parameters:
texFilter - GLTextureFilter
destTexArray - GLTexture[]
fadeConst - float
float[] - values

render

public void render()
Draws the texture using the opengl commands, inside a rectangle located at the origin with the original size of the texture.


render

public void render(float x,
                   float y)
Draws the texture using the opengl commands, inside a rectangle located at (x,y) with the original size of the texture.

Parameters:
x - float
y - float

render

public void render(float x,
                   float y,
                   float w,
                   float h)
Draws the texture using the opengl commands, inside a rectangle of width w and height h located at (x,y).

Parameters:
x - float
y - float
w - float
h - float

putBuffer

public void putBuffer(int[] intArray)
Copies intArray into the texture, assuming that the array contains 4 color components and pixels are unsigned bytes.

Parameters:
intArray - int[]

putBuffer

public void putBuffer(int[] intArray,
                      int format)
Copies intArray into the texture, using the specified format and assuming that the pixels are unsigned bytes.

Parameters:
intArray - int[]
format - int

putByteBuffer

public void putByteBuffer(int[] intArray,
                          int format)
Copies intArray into the texture, using the specified format and assuming that the pixels are unsigned bytes.

Parameters:
intArray - int[]
format - int

putIntBuffer

public void putIntBuffer(int[] intArray,
                         int format)
Copies intArray into the texture, using the specified format and assuming that the pixels are integers.

Parameters:
intArray - int[]
format - int

putBuffer

public void putBuffer(int[] intArray,
                      int format,
                      int type)
Copies intArray into the texture, using the format and type specified.

Parameters:
intArray - int[]
format - int
type - int

putBuffer

public void putBuffer(java.nio.IntBuffer buffer,
                      int format,
                      int type)
Copies buffer into the texture, using the format and type specified.

Parameters:
buffer - IntBuffer
format - int
type - int

putBuffer

public void putBuffer(float[] floatArray)
Copies floatArray into the texture, assuming that the array has 4 components.

Parameters:
floatArray - float[]
format - int

putBuffer

public void putBuffer(float[] floatArray,
                      int format)
Copies floatArray into the texture, using the specified format.

Parameters:
floatArray - float[]
format - int

getBuffer

public void getBuffer(int[] intArray)
Copies the texture into intArray, assuming that the array has 4 components and the pixels are unsigned bytes.

Parameters:
intArray - int[]
format - int

getBuffer

public void getBuffer(int[] intArray,
                      int format)
Copies the texture into intArray, using the specified format and assuming that the pixels are unsigned bytes.

Parameters:
intArray - int[]
format - int

getByteBuffer

public void getByteBuffer(int[] intArray,
                          int format)
Copies the texture into intArray, using the specified format and assuming that the pixels are unsigned bytes.

Parameters:
intArray - int[]
format - int

getIntBuffer

public void getIntBuffer(int[] intArray,
                         int format)
Copies the texture into intArray, using the specified format and assuming that the pixels are integers.

Parameters:
intArray - int[]
format - int

getBuffer

public void getBuffer(int[] intArray,
                      int format,
                      int type)
Copies the texture into intArray, using the specified format and type.

Parameters:
intArray - int[]
format - int
type - int

getBuffer

public void getBuffer(float[] floatArray,
                      int format)
Copies the texture into floatArray.

Parameters:
floatArray - float[]
format - int

setRandom

public void setRandom(float r0,
                      float r1,
                      float g0,
                      float g1,
                      float b0,
                      float b1,
                      float a0,
                      float a1)
Sets the texture to have random values in the ranges specified for each component.

Parameters:
r0 - float
r1 - float
g0 - float
g1 - float
b0 - float
b1 - float
a0 - float
a1 - float

setRandomDir2D

public void setRandomDir2D(float r0,
                           float r1,
                           float phi0,
                           float phi1)
Sets the texture to have random values in the first two coordinates chosen on the circular region defined by the parameters.

Parameters:
r0 - float
r1 - float
phi0 - float
phi1 - float

setRandomDir3D

public void setRandomDir3D(float r0,
                           float r1,
                           float phi0,
                           float phi1,
                           float theta0,
                           float theta1)
Sets the texture to have random values in the first three coordinates chosen on the spherical region defined by the parameters.

Parameters:
r0 - float
r1 - float
phi0 - float
phi1 - float
theta0 - float
theta1 - float

setValue

public void setValue(float r,
                     float g,
                     float b,
                     float a)
Sets the texture to have the same given float value in each component.

Parameters:
r - float
g - float
b - float
a - float

setZero

public void setZero()
Sets to zero all the pixels of the texture.


clear

public void clear(int gray)
Fills the texture with the specified gray tone.

Parameters:
gray - int

clear

public void clear(float gray)
Fills the texture with the specified gray tone.

Parameters:
gray - float

clear

public void clear(int gray,
                  int alpha)
Fills the texture with the specified gray tone and alpha value.

Parameters:
gray - int
alpha - int

clear

public void clear(int rgb,
                  float alpha)
Fills the texture with the specified rgb color and alpha value.

Parameters:
rgb - int
alpha - float

clear

public void clear(float gray,
                  float alpha)
Fills the texture with the specified gray tone and alpha value.

Parameters:
gray - float
alpha - float

clear

public void clear(int x,
                  int y,
                  int z)
Fills the texture with the specified color components.

Parameters:
x - int
y - int
z - int

clear

public void clear(float x,
                  float y,
                  float z)
Fills the texture with the specified color components.

Parameters:
x - float
y - float
z - float

clear

public void clear(int x,
                  int y,
                  int z,
                  int a)
Fills the texture with the specified color components and alpha component.

Parameters:
x - int
y - int
z - int
a - int

clear

public void clear(float x,
                  float y,
                  float z,
                  float a)
Fills the texture with the specified color components and alpha component.

Parameters:
x - float
y - float
z - float
a - float

paint

public void paint(int gray)
Paints the texture with the specified gray tone.

Parameters:
gray - int

paint

public void paint(float gray)
Paints the texture with the specified gray tone.

Parameters:
gray - float

paint

public void paint(int gray,
                  int alpha)
Paints the texture with the specified gray tone and alpha value.

Parameters:
gray - int
alpha - int

paint

public void paint(int rgb,
                  float alpha)
Paints the texture with the specified rgb color and alpha value.

Parameters:
rgb - int
alpha - float

paint

public void paint(float gray,
                  float alpha)
Paints the texture with the specified gray tone and alpha value.

Parameters:
gray - float
alpha - float

paint

public void paint(int x,
                  int y,
                  int z)
Paints the texture with the specified color components.

Parameters:
x - int
y - int
z - int

paint

public void paint(float x,
                  float y,
                  float z)
Paints the texture with the specified color components.

Parameters:
x - float
y - float
z - float

paint

public void paint(int x,
                  int y,
                  int z,
                  int a)
Paints the texture with the specified color components and alpha component.

Parameters:
x - int
y - int
z - int
a - int

paint

public void paint(float x,
                  float y,
                  float z,
                  float a)
Paints the texture with the specified color components and alpha component.

Parameters:
x - float
y - float
z - float
a - float


processing library glgraphics by Andres Colubri. (c) 2008