|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jaer.graphics.Chip2DRenderer
net.sf.jaer.graphics.AEChipRenderer
public class AEChipRenderer
Superclass for classes that render AEs to a memory buffer so that they can be painted on the screen. Note these classes do not actually render to the graphcs device; they take AEPacket's and render them to a memory buffer that later gets painted by a ChipCanvas. The method chosen (by user cycling method from GUI) chooses how the events are painted. In effect the events are histogrammed for most rendering methods except for "color-time", and even there they are histogrammed or averaged. For methods that render polarized events (such as ON-OFF) then ON events increase the rendered value while OFF events decreases it. Thus the rendered image fr can be drawn in 3-d if desired and it will represent a histogram, although the default method using for drawing the rendered frame is to paint the cell brightness.
Nested Class Summary | |
---|---|
static class |
AEChipRenderer.ColorMode
|
Field Summary | |
---|---|
protected AEChip |
chip
chip shadows Chip2D's chip to declare it as AEChip |
protected static int[] |
HUES
perceptually separated hues - as estimated quickly by tobi |
protected boolean |
ignorePolarityEnabled
the chip rendered for |
protected java.util.logging.Logger |
log
|
static int |
NUM_METHODS
the number of rendering methods implemented |
static int |
NUM_TIME_COLORS
number of colors used to represent time of event |
protected EventPacket |
packet
|
protected SpikeSound |
spikeSound
|
protected float |
step
|
protected boolean |
stereoEnabled
|
protected int |
subsampleThresholdEventCount
|
protected boolean |
subsamplingEnabled
determines subSampling of rendered events (for speed) |
protected float[][] |
timeColors
|
protected float[][] |
typeColorRGBComponents
Used for rendering multiple cell types in different RGB colors. |
protected java.awt.Color[] |
typeColors
The Colors that different cell types are painted. |
Fields inherited from class net.sf.jaer.graphics.Chip2DRenderer |
---|
accumulateEnabled, annotators, autoscaleEnabled, autoScaleValue, colorScale, eventContrast, fr, grayValue, pixmap, prefs, selectedPixelEventCount, xsel, ysel |
Constructor Summary | |
---|---|
AEChipRenderer(AEChip chip)
|
Method Summary | |
---|---|
protected void |
autoScaleFrame(float[] fr)
autoscales frame data so that max value is 1. |
protected void |
autoScaleFrame(float[][][] fr,
float gray)
autoscales frame data so that max value is 1. |
protected void |
checkTypeColors(int numCellTypes)
Creates colors for each cell type (e.g. |
void |
cycleColorMode()
go on to next rendering method |
AEChip |
getChip()
|
AEChipRenderer.ColorMode |
getColorMode()
|
EventPacket |
getPacket()
returns the last packet rendered |
int |
getSubsampleThresholdEventCount()
|
float[][] |
getTypeColorRGBComponents()
|
java.awt.Color[] |
getTypeColors()
|
boolean |
isIgnorePolarityEnabled()
|
protected boolean |
isMethodMonochrome()
|
boolean |
isStereoEnabled()
|
boolean |
isSubsamplingEnabled()
|
protected void |
playSpike(int type)
|
void |
render(EventPacket packet)
does the rendering using selected method. |
void |
setChip(AEChip chip)
|
void |
setColorMode(AEChipRenderer.ColorMode colorMode)
|
void |
setIgnorePolarityEnabled(boolean ignorePolarityEnabled)
|
void |
setStereoEnabled(boolean stereoEnabled)
|
void |
setSubsampleThresholdEventCount(int subsampleThresholdEventCount)
|
void |
setSubsamplingEnabled(boolean subsamplingEnabled)
|
void |
setTypeColorRGBComponents(float[][] typeColors)
|
void |
setTypeColors(java.awt.Color[] typeColors)
|
Methods inherited from class net.sf.jaer.graphics.Chip2DRenderer |
---|
checkFr, checkPixmapAllocation, decreaseContrast, getColorScale, getGrayValue, getPixmap, getPixmapArray, getPixMapIndex, getPixmapRGB, getSelectedPixelEventCount, getXsel, getYsel, increaseContrast, isAccumulateEnabled, isAutoscaleEnabled, isPixelSelected, removeAllAnnotators, resetFrame, setAccumulateEnabled, setAutoscaleEnabled, setColorScale, setGrayValue, setPixmapPosition, setPixmapRGB, setXsel, setYsel, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int[] HUES
public static int NUM_METHODS
public static final int NUM_TIME_COLORS
protected AEChip chip
protected EventPacket packet
protected boolean ignorePolarityEnabled
protected java.util.logging.Logger log
protected java.awt.Color[] typeColors
protected float[][] typeColorRGBComponents
protected SpikeSound spikeSound
protected float step
protected boolean stereoEnabled
protected int subsampleThresholdEventCount
protected boolean subsamplingEnabled
protected float[][] timeColors
Constructor Detail |
---|
public AEChipRenderer(AEChip chip)
Method Detail |
---|
public float[][] getTypeColorRGBComponents()
typeColorRGBComponents
public void setTypeColorRGBComponents(float[][] typeColors)
typeColorRGBComponents
public java.awt.Color[] getTypeColors()
typeColors
public void setTypeColors(java.awt.Color[] typeColors)
typeColors
public void render(EventPacket packet)
packet
- a packet of events (already extracted from raw events)setColorMode(net.sf.jaer.graphics.AEChipRenderer.ColorMode)
protected void autoScaleFrame(float[][][] fr, float gray)
Global normalizer is tricky because we want to map max value to 1 OR min value to 0, whichever is greater magnitude, max or min. ALSO, max and min are distances from gray level in positive and negative directions. After global normalizer is computed, all values are divided by normalizer in order to keep gray level constant.
fr
- the frame rgb data [y][x][rgb]gray
- the gray levelprotected void autoScaleFrame(float[] fr)
Global normalizer is tricky because we want to map max value to 1 OR min value to 0, whichever is greater magnitude, max or min. ALSO, max and min are distances from gray level in positive and negative directions. After global normalizer is computed, all values are divided by normalizer in order to keep gray level constant.
fr
- the frame rgb data pixmapprotected void checkTypeColors(int numCellTypes)
Subclasses can override this method to customize the colors drawn but the subclasses should check if the color have been created since checkTypeColors is called on every rendering cycle. This method should first check if typeColorRGBComponents already exists and has the correct number of elements. If not, allocate and populate typeColorRGBComponents so that type t corresponds to typeColorRGBComponents[t][0] for red, typeColorRGBComponents[t][1] for green, and typeColorRGBComponents[t][3] for blue. It should also populate the Color[] typeColors.
numCellTypes
- the number of colors to generatetypeColors
,
typeColorRGBComponents
public void cycleColorMode()
public EventPacket getPacket()
public void setChip(AEChip chip)
public AEChip getChip()
public AEChipRenderer.ColorMode getColorMode()
public int getSubsampleThresholdEventCount()
public boolean isIgnorePolarityEnabled()
protected boolean isMethodMonochrome()
public boolean isStereoEnabled()
public boolean isSubsamplingEnabled()
protected void playSpike(int type)
public void setIgnorePolarityEnabled(boolean ignorePolarityEnabled)
public void setColorMode(AEChipRenderer.ColorMode colorMode)
colorMode
- the rendering method, e.g. gray, red/green opponency, time encoded.public void setStereoEnabled(boolean stereoEnabled)
public void setSubsampleThresholdEventCount(int subsampleThresholdEventCount)
public void setSubsamplingEnabled(boolean subsamplingEnabled)
|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |