Skip to content

Commit

Permalink
fixed white background mode to correctly show ON and OFF green and re…
Browse files Browse the repository at this point in the history
…d colors
  • Loading branch information
Tobi Delbruck authored and Tobi Delbruck committed Jan 13, 2019
1 parent a535c27 commit c9e51a6
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/net/sf/jaer/graphics/AEFrameChipRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,6 @@ protected void resetPixmapGrayLevel(final float value) {
grayBuffer.put(0);
grayBuffer.put(.5f);
grayBuffer.put(.5f);
} else if (colorMode == ColorMode.WhiteBackground) {
grayBuffer.put(1.0f);
grayBuffer.put(1.0f);
grayBuffer.put(1.0f);
grayBuffer.put(1.0f);
} else {
grayBuffer.put(grayValue);
grayBuffer.put(grayValue);
Expand Down Expand Up @@ -282,13 +277,13 @@ private void setColors() {
offColor[3] = 0.0f;
break;
case WhiteBackground:
onColor[0] = 1.0f;
onColor[0] = 0.2f;
onColor[1] = 1.0f;
onColor[2] = 1.0f;
onColor[2] = 0.2f;
onColor[3] = 0.0f;
offColor[0] = 1.0f;
offColor[1] = 1.0f;
offColor[2] = 1.0f;
offColor[1] = 0.2f;
offColor[2] = 0.2f;
offColor[3] = 0.0f;
break;
case RedGreen:
Expand Down Expand Up @@ -590,7 +585,7 @@ protected void updateEventMaps(final PolarityEvent e) {
map[index + 1] = timeColors[ind][1];
map[index + 2] = timeColors[ind][2];
map[index + 3] = 0.5f;
} else if (colorMode == ColorMode.HotCode || colorMode == ColorMode.WhiteBackground) {
} else if (colorMode == ColorMode.HotCode ) {
final float alpha = map[index + 3] + (1.0f / colorScale);
map[index + 3] = normalizeEvent(alpha);
int ind = (int) Math.floor(((AEChipRenderer.NUM_TIME_COLORS - 1) * alpha));
Expand Down Expand Up @@ -975,7 +970,7 @@ public void setMaxADC(final int max) {
public float getGrayValue() {
if (isDisplayFrames() || (colorMode == ColorMode.Contrast) || (colorMode == ColorMode.GrayLevel)) {
grayValue = 0.5f;
} else if (colorMode == ColorMode.GrayTime || colorMode==ColorMode.WhiteBackground) {
} else if (colorMode == ColorMode.GrayTime || colorMode == ColorMode.WhiteBackground) {
grayValue = 1.0f;
} else {
grayValue = 0.0f;
Expand Down

0 comments on commit c9e51a6

Please sign in to comment.