public class DwGLTexture extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DwGLTexture.TexturePingPong |
Modifier and Type | Field and Description |
---|---|
int |
byte_per_channel |
DwPixelFlow |
context |
int |
filter |
int |
format |
DwGLFrameBuffer |
framebuffer |
static int |
GPU_DATA_READ |
int |
h |
int[] |
HANDLE |
int |
internalFormat |
int |
num_channel |
int |
target |
DwGLTexture |
texsub |
int |
type |
int |
w |
Constructor and Description |
---|
DwGLTexture() |
Modifier and Type | Method and Description |
---|---|
void |
clear(float v) |
void |
generateMipMap() |
byte[] |
getByteTextureData(byte[] data)
byte[] px_byte = Fluid.getByteTextureData(Fluid.tex_obstacleC.src, null);
PGraphics2D pg_tmp = (PGraphics2D) createGraphics(Fluid.fluid_w, Fluid.fluid_h, P2D);
pg_tmp.loadPixels();
for(int i = 0; i < pg_tmp.pixels.length; i++){
int O = (int)(px_byte[i]);
pg_tmp.pixels[i] = O << 24 | O << 16 | O << 8 | O;
}
pg_tmp.updatePixels();
|
byte[] |
getByteTextureData(byte[] data,
int x,
int y,
int w,
int h) |
ByteBuffer |
getData_GL2ES3()
TODO: currently, this only works on float textures (32 bit, half-float?)
|
ByteBuffer |
getData_GL2ES3(int x,
int y,
int w,
int h) |
void |
getData_GL2GL3(Buffer buffer) |
void |
getData_GL2GL3(int x,
int y,
int w,
int h,
Buffer buffer) |
float[] |
getFloatTextureData(float[] data) |
float[] |
getFloatTextureData(float[] data,
int x,
int y,
int w,
int h) |
int |
h() |
void |
release() |
boolean |
resize(DwPixelFlow context,
DwGLTexture othr) |
boolean |
resize(DwPixelFlow context,
int internalFormat,
int w,
int h,
int format,
int type,
int filter,
int num_channel,
int byte_per_channel) |
boolean |
resize(DwPixelFlow context,
int internalFormat,
int w,
int h,
int format,
int type,
int filter,
int num_channel,
int byte_per_channel,
Buffer data) |
void |
setParam_Border(float[] border) |
void |
setParam_Border(int[] border) |
void |
setParam_Filter(int minfilter,
int magfilter) |
void |
setParam_WRAP_S_T(int param) |
void |
setParam_WRAP_S_T(int param,
float[] border_color) |
int |
w() |
public DwPixelFlow context
public int[] HANDLE
public int target
public int internalFormat
public int w
public int h
public int format
public int type
public int filter
public int num_channel
public int byte_per_channel
public DwGLFrameBuffer framebuffer
public DwGLTexture texsub
public static int GPU_DATA_READ
public void release()
public int w()
public int h()
public boolean resize(DwPixelFlow context, DwGLTexture othr)
public boolean resize(DwPixelFlow context, int internalFormat, int w, int h, int format, int type, int filter, int num_channel, int byte_per_channel)
public boolean resize(DwPixelFlow context, int internalFormat, int w, int h, int format, int type, int filter, int num_channel, int byte_per_channel, Buffer data)
public void setParam_WRAP_S_T(int param)
public void setParam_WRAP_S_T(int param, float[] border_color)
public void setParam_Filter(int minfilter, int magfilter)
public void generateMipMap()
public void setParam_Border(float[] border)
public void setParam_Border(int[] border)
public ByteBuffer getData_GL2ES3()
cx
- cy
- w
- h
- data
- array, for the returned opengl-texture-datapublic ByteBuffer getData_GL2ES3(int x, int y, int w, int h)
public void getData_GL2GL3(Buffer buffer)
public void getData_GL2GL3(int x, int y, int w, int h, Buffer buffer)
public float[] getFloatTextureData(float[] data)
public float[] getFloatTextureData(float[] data, int x, int y, int w, int h)
public byte[] getByteTextureData(byte[] data)
tex
- data
- public byte[] getByteTextureData(byte[] data, int x, int y, int w, int h)
public void clear(float v)
Processing library PixelFlow by Thomas Diewald. (c) 2017