|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ELMatrix
A rectangular grid of floating point triplets (e.g. an X x Y x 3 matrix). To avoid memory allocation and garbage collection, pooled memory is used for allocating. Call alloc() to allocate a new FloatImage and free() when you are done with it.
ELMatrix := ELVector*
Field Summary | |
(package private) float[] |
blu
|
(package private) float[][] |
channel
An array for accessing channels by index instead of direct pointer. |
static boolean |
debugNoisyAllocate
When true, actual memory allocations (not ones that come from the memory pool) will print. |
(package private) float[] |
grn
|
(package private) int |
numElements
|
(package private) float[] |
red
|
Constructor Summary | |
ELMatrix(java.lang.String filename)
Initializes an ELMatrix from an image. |
Method Summary | |
static ELMatrix |
alloc(int width,
int height)
Allocates an image from a memory pool. |
void |
drawImage(java.awt.Graphics2D graphics,
int x,
int y,
int width,
int height)
|
void |
forceClean()
Causes the image to be cleaned, if dirty. |
ELMatrix |
free()
Deallocates an image, placing it in the available memory pool. |
int |
getHeight()
Returns the height of the matrix. |
int |
getIconHeight()
|
int |
getIconWidth()
|
int |
getWidth()
Returns the width of the matrix. |
int |
memorySize()
Number of bytes this object consumes. |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
|
void |
set(ELMatrix other)
Copies from other to this. |
void |
set(int x,
int y,
float r,
float g,
float b)
|
void |
setAll(float r,
float g,
float b)
Sets all values to (r, g, b) |
void |
setDirty()
Marks this matrix's internal image as being dirty. |
Methods inherited from class java.lang.Object |
|
Field Detail |
int numElements
float[] red
float[] grn
float[] blu
float[][] channel
public static boolean debugNoisyAllocate
Constructor Detail |
public ELMatrix(java.lang.String filename)
Method Detail |
public void setAll(float r, float g, float b)
public void set(ELMatrix other)
public void set(int x, int y, float r, float g, float b)
public static ELMatrix alloc(int width, int height)
public ELMatrix free()
im =
im.free()
, which allows garbage collection and tends to prevent
accidental dangling pointers.public int memorySize()
public int getWidth()
public int getHeight()
public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public void setDirty()
public void forceClean()
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon
public void drawImage(java.awt.Graphics2D graphics, int x, int y, int width, int height)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |