VLab Issue #15759 - Revert VLab Issue 15201 - Gamma control for true color imagery
This reverts commit 61b0595f9e
[formerly d4a79b75934be787419fd1bad20f84ae838c8a10].
Change-Id: I2184a0edec64761587c1d2312d4015397f047acd
Former-commit-id: 7f770bafdff57c074c76decc44d58d0ec224fde0
This commit is contained in:
parent
61b0595f9e
commit
e891239a89
5 changed files with 9 additions and 61 deletions
|
@ -22,8 +22,6 @@ uniform float width;
|
||||||
uniform int band;
|
uniform int band;
|
||||||
uniform int expectedMask;
|
uniform int expectedMask;
|
||||||
|
|
||||||
uniform float gamma;
|
|
||||||
|
|
||||||
int toBitMask(float alpha) {
|
int toBitMask(float alpha) {
|
||||||
return int((alpha * maskMultiplier) + 0.5);
|
return int((alpha * maskMultiplier) + 0.5);
|
||||||
}
|
}
|
||||||
|
@ -58,9 +56,9 @@ vec4 applyColorBand(int colorband) {
|
||||||
// Lookup raw data value
|
// Lookup raw data value
|
||||||
float dataValue = textureToDataValue(rawDataTex, rawData, gl_TexCoord[0].st);
|
float dataValue = textureToDataValue(rawDataTex, rawData, gl_TexCoord[0].st);
|
||||||
|
|
||||||
float r = pow(curVal.r, gamma);
|
float r = curVal.r;
|
||||||
float g = pow(curVal.g, gamma);
|
float g = curVal.g;
|
||||||
float b = pow(curVal.b, gamma);
|
float b = curVal.b;
|
||||||
float a = curVal.a;
|
float a = curVal.a;
|
||||||
|
|
||||||
if (dataValue != rawData.noDataValue && dataValue == dataValue) {
|
if (dataValue != rawData.noDataValue && dataValue == dataValue) {
|
||||||
|
|
|
@ -54,7 +54,6 @@ import com.raytheon.viz.core.gl.images.AbstractGLImage;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Aug 6, 2012 mschenke Initial creation
|
* Aug 6, 2012 mschenke Initial creation
|
||||||
* Nov 4, 2013 2492 mschenke Reworked to use GLSL Data mapping
|
* Nov 4, 2013 2492 mschenke Reworked to use GLSL Data mapping
|
||||||
* Jan 27, 2016 DR 17997 jgerth Support for gamma control
|
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -246,8 +245,6 @@ public class GLTrueColorImagingExtension extends AbstractGLSLImagingExtension
|
||||||
GLSLStructFactory.createColorMapping(program, "colorMapping", -1,
|
GLSLStructFactory.createColorMapping(program, "colorMapping", -1,
|
||||||
-1, colorMapParameters);
|
-1, colorMapParameters);
|
||||||
|
|
||||||
program.setUniform("gamma", colorMapParameters.getGamma());
|
|
||||||
|
|
||||||
// Set the composite image data
|
// Set the composite image data
|
||||||
program.setUniform("trueColorTexture", 1);
|
program.setUniform("trueColorTexture", 1);
|
||||||
program.setUniform("width", (float) writeToImage.getWidth());
|
program.setUniform("width", (float) writeToImage.getWidth());
|
||||||
|
|
|
@ -43,7 +43,6 @@ import com.raytheon.uf.viz.truecolor.extension.ITrueColorImagingExtension.Channe
|
||||||
* Aug 20, 2012 mschenke Initial creation
|
* Aug 20, 2012 mschenke Initial creation
|
||||||
* Apr 18, 2014 2947 bsteffen Support unitless data.
|
* Apr 18, 2014 2947 bsteffen Support unitless data.
|
||||||
* Sep 9, 2014 DR 17313 jgerth Support for ColorMapParameters
|
* Sep 9, 2014 DR 17313 jgerth Support for ColorMapParameters
|
||||||
* Jan 27, 2016 DR 17997 jgerth Support for gamma control
|
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -62,9 +61,6 @@ public class ChannelInfo {
|
||||||
@XmlElement
|
@XmlElement
|
||||||
private double rangeMax = 1.0;
|
private double rangeMax = 1.0;
|
||||||
|
|
||||||
@XmlElement
|
|
||||||
private double gamma = 1.0;
|
|
||||||
|
|
||||||
private Unit<?> unit;
|
private Unit<?> unit;
|
||||||
|
|
||||||
private ColorMapParameters parameters;
|
private ColorMapParameters parameters;
|
||||||
|
@ -114,21 +110,6 @@ public class ChannelInfo {
|
||||||
this.rangeMax = rangeMax;
|
this.rangeMax = rangeMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the gamma
|
|
||||||
*/
|
|
||||||
public double getGamma() {
|
|
||||||
return gamma;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param gamma
|
|
||||||
* the gamma to set
|
|
||||||
*/
|
|
||||||
public void setGamma(double gamma) {
|
|
||||||
this.gamma = gamma;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the unit
|
* @return the unit
|
||||||
*/
|
*/
|
||||||
|
@ -166,14 +147,13 @@ public class ChannelInfo {
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ColorMapParameters getParameters() {
|
public ColorMapParameters getParameters() {
|
||||||
return parameters;
|
return parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParameters(ColorMapParameters parameters) {
|
public void setParameters(ColorMapParameters parameters) {
|
||||||
this.parameters = parameters;
|
this.parameters = parameters;
|
||||||
this.gamma = parameters.getGamma();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -190,8 +170,6 @@ public class ChannelInfo {
|
||||||
result = prime * result + (int) (temp ^ (temp >>> 32));
|
result = prime * result + (int) (temp ^ (temp >>> 32));
|
||||||
temp = Double.doubleToLongBits(rangeMin);
|
temp = Double.doubleToLongBits(rangeMin);
|
||||||
result = prime * result + (int) (temp ^ (temp >>> 32));
|
result = prime * result + (int) (temp ^ (temp >>> 32));
|
||||||
temp = Double.doubleToLongBits(gamma);
|
|
||||||
result = prime * result + (int) (temp ^ (temp >>> 32));
|
|
||||||
result = prime * result + ((unit == null) ? 0 : unit.hashCode());
|
result = prime * result + ((unit == null) ? 0 : unit.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -218,9 +196,6 @@ public class ChannelInfo {
|
||||||
if (Double.doubleToLongBits(rangeMin) != Double
|
if (Double.doubleToLongBits(rangeMin) != Double
|
||||||
.doubleToLongBits(other.rangeMin))
|
.doubleToLongBits(other.rangeMin))
|
||||||
return false;
|
return false;
|
||||||
if (Double.doubleToLongBits(gamma) != Double
|
|
||||||
.doubleToLongBits(other.gamma))
|
|
||||||
return false;
|
|
||||||
if (unit == null) {
|
if (unit == null) {
|
||||||
if (other.unit != null)
|
if (other.unit != null)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -72,7 +72,6 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* Aug 06, 2012 mschenke Initial creation
|
* Aug 06, 2012 mschenke Initial creation
|
||||||
* Apr 18, 2014 2947 bsteffen Support unitless data.
|
* Apr 18, 2014 2947 bsteffen Support unitless data.
|
||||||
* Sep 10, 2014 DR 17313 jgerth Add inspect method
|
* Sep 10, 2014 DR 17313 jgerth Add inspect method
|
||||||
* Jan 27, 2016 DR 17997 jgerth Support for gamma control
|
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -434,7 +433,6 @@ public class TrueColorResourceGroup extends
|
||||||
.getColorMapMin()));
|
.getColorMapMin()));
|
||||||
ci.setRangeMax(toDisplay.convert(params
|
ci.setRangeMax(toDisplay.convert(params
|
||||||
.getColorMapMax()));
|
.getColorMapMax()));
|
||||||
ci.setGamma(params.getGamma());
|
|
||||||
ci.setUnit(params.getDisplayUnit());
|
ci.setUnit(params.getDisplayUnit());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -487,7 +485,6 @@ public class TrueColorResourceGroup extends
|
||||||
private static void initializeParameters(ChannelInfo ci,
|
private static void initializeParameters(ChannelInfo ci,
|
||||||
ColorMapParameters params) {
|
ColorMapParameters params) {
|
||||||
if (params != null) {
|
if (params != null) {
|
||||||
params.setGamma(ci.getGamma());
|
|
||||||
ci.setParameters(params);
|
ci.setParameters(params);
|
||||||
if (ci.getUnit() != null && params.getColorMapUnit() != null
|
if (ci.getUnit() != null && params.getColorMapUnit() != null
|
||||||
&& ci.getUnit().isCompatible(params.getColorMapUnit())) {
|
&& ci.getUnit().isCompatible(params.getColorMapUnit())) {
|
||||||
|
@ -505,7 +502,6 @@ public class TrueColorResourceGroup extends
|
||||||
.getColorMapToDisplayConverter();
|
.getColorMapToDisplayConverter();
|
||||||
ci.setRangeMin(cmapToDisplay.convert(params.getColorMapMin()));
|
ci.setRangeMin(cmapToDisplay.convert(params.getColorMapMin()));
|
||||||
ci.setRangeMax(cmapToDisplay.convert(params.getColorMapMax()));
|
ci.setRangeMax(cmapToDisplay.convert(params.getColorMapMax()));
|
||||||
ci.setGamma(params.getGamma());
|
|
||||||
ci.setUnit(params.getDisplayUnit());
|
ci.setUnit(params.getDisplayUnit());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,9 +32,7 @@ import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Group;
|
import org.eclipse.swt.widgets.Group;
|
||||||
import org.eclipse.swt.widgets.Label;
|
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.Spinner;
|
|
||||||
|
|
||||||
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
||||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||||
|
@ -58,7 +56,6 @@ import com.raytheon.viz.ui.dialogs.ColorMapSliderComp;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Aug 16, 2012 mschenke Initial creation
|
* Aug 16, 2012 mschenke Initial creation
|
||||||
* Jan 27, 2016 DR 17997 jgerth Support for gamma control
|
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -168,21 +165,6 @@ public class TrueColorDialog extends CaveSWTDialog implements IDisposeListener {
|
||||||
params);
|
params);
|
||||||
cmapSlider.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
|
cmapSlider.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
|
||||||
((GridData) cmapSlider.getLayoutData()).widthHint = 450;
|
((GridData) cmapSlider.getLayoutData()).widthHint = 450;
|
||||||
|
|
||||||
Composite gammaComp = new Composite(group, SWT.NONE);
|
|
||||||
gammaComp.setLayout(new GridLayout(2, false));
|
|
||||||
final Label gammaLabel = new Label(gammaComp, SWT.LEFT);
|
|
||||||
gammaLabel.setText("Gamma:");
|
|
||||||
final Spinner gammaSpinner = new Spinner(gammaComp, SWT.BORDER);
|
|
||||||
gammaSpinner.setValues(100, 0, 500, 2, 10, 10);
|
|
||||||
gammaSpinner.setSelection((int) (params.getGamma() * 100));
|
|
||||||
gammaSpinner.addSelectionListener(new SelectionAdapter() {
|
|
||||||
@Override
|
|
||||||
public void widgetSelected(SelectionEvent e) {
|
|
||||||
cmapSlider.setGamma(gammaSpinner.getSelection() / 100.);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
sliderComps.add(cmapSlider);
|
sliderComps.add(cmapSlider);
|
||||||
|
|
||||||
if (displayedResource == null) {
|
if (displayedResource == null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue