public class FloatMap
extends java.lang.Object
DisplacementMap
.Modifier and Type | Class and Description |
---|---|
private static class |
FloatMap.Entry |
Modifier and Type | Field and Description |
---|---|
private java.nio.FloatBuffer |
buf |
private java.util.Map<FilterContext,FloatMap.Entry> |
cache |
private boolean |
cacheValid |
private int |
height |
private int |
width |
Constructor and Description |
---|
FloatMap(int width,
int height)
Constructs a new
FloatMap of the given width and height. |
Modifier and Type | Method and Description |
---|---|
LockableResource |
getAccelData(FilterContext fctx) |
java.nio.FloatBuffer |
getBuffer() |
float[] |
getData() |
int |
getHeight()
Returns the height of the map, in pixels.
|
float |
getSample(int x,
int y,
int band)
Gets the sample for a specific band from the given
(x,y) location. |
int |
getWidth()
Returns the width of the map, in pixels.
|
void |
put(float[] floatBuf) |
void |
setSample(int x,
int y,
int band,
float sample)
Sets the sample for a specific band at the given (x,y) location.
|
void |
setSamples(int x,
int y,
float s0)
Sets the sample for the first band at the given (x,y) location.
|
void |
setSamples(int x,
int y,
float s0,
float s1)
Sets the sample for the first two bands at the given (x,y) location.
|
void |
setSamples(int x,
int y,
float s0,
float s1,
float s2)
Sets the sample for the first three bands at the given (x,y) location.
|
void |
setSamples(int x,
int y,
float s0,
float s1,
float s2,
float s3)
Sets the sample for each of the four bands at the given (x,y) location.
|
private final int width
private final int height
private final java.nio.FloatBuffer buf
private boolean cacheValid
private java.util.Map<FilterContext,FloatMap.Entry> cache
public FloatMap(int width, int height)
FloatMap
of the given width and height.width
- the width of the map, in pixelsheight
- the height of the map, in pixelsjava.lang.IllegalArgumentException
- if either width
or
height
is outside the range [1, 4096]public int getWidth()
public int getHeight()
public float[] getData()
public java.nio.FloatBuffer getBuffer()
public float getSample(int x, int y, int band)
(x,y)
location.x
- the x locationy
- the y locationband
- the band to get (must be 1, 2, 3, or 4)public void setSample(int x, int y, int band, float sample)
x
- the x locationy
- the y locationband
- the band to set (must be 1, 2, 3, or 4)sample
- the sample value to setpublic void setSamples(int x, int y, float s0)
x
- the x locationy
- the y locations0
- the sample value to set for the first bandpublic void setSamples(int x, int y, float s0, float s1)
x
- the x locationy
- the y locations0
- the sample value to set for the first bands1
- the sample value to set for the second bandpublic void setSamples(int x, int y, float s0, float s1, float s2)
x
- the x locationy
- the y locations0
- the sample value to set for the first bands1
- the sample value to set for the second bands2
- the sample value to set for the third bandpublic void setSamples(int x, int y, float s0, float s1, float s2, float s3)
x
- the x locationy
- the y locations0
- the sample value to set for the first bands1
- the sample value to set for the second bands2
- the sample value to set for the third bands3
- the sample value to set for the fourth bandpublic void put(float[] floatBuf)
public LockableResource getAccelData(FilterContext fctx)