Issue #1782 fix merge problems related to graphics API.

Former-commit-id: 9689a020a25ffdbf8a13abb02506d6e3e4dcdbb8
This commit is contained in:
Ben Steffensmeier 2013-03-26 12:06:45 -05:00
parent f062e43f8c
commit 6edee13cdd
7 changed files with 36 additions and 39 deletions

View file

@ -47,40 +47,6 @@ import com.raytheon.uf.viz.core.exception.VizException;
public interface IColorMapDataRetrievalCallback {
/**
* @param dataType
* @param dataBounds
*/
public ColorMapData(ColorMapDataType dataType, int[] dimensions) {
this.buffer = getBuffer(dataType, dimensions);
this.dimensions = dimensions;
this.dataType = dataType;
}
}
private static Buffer getBuffer(ColorMapDataType dataType,
int[] dimensions) {
int size = 1;
for (int i : dimensions) {
size *= i;
}
switch (dataType) {
case BYTE:
case SIGNED_BYTE:
return ByteBuffer.allocate(size);
case SHORT:
case UNSIGNED_SHORT:
return ShortBuffer.allocate(size);
case FLOAT:
return FloatBuffer.allocate(size);
case INT:
return IntBuffer.allocate(size);
default:
throw new RuntimeException("Could not find Buffer for "
+ dataType);
}
/**
* Get the ColorMapData. IMPORTANT NOTE: This method should retrieve the
* ColorMapData from wherever it lives. ColorMapData objects should not be

View file

@ -20,7 +20,7 @@
package com.raytheon.viz.core.gl.dataformat;
import com.raytheon.uf.common.colormap.image.ColorMapData;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapDataType;
import com.raytheon.uf.common.colormap.image.ColorMapData.ColorMapDataType;
/**
* Factory class for getting GLColorMapDataFormat objects given the ColorMapData

View file

@ -29,11 +29,11 @@ import java.util.Stack;
import javax.media.opengl.GL;
import com.raytheon.uf.common.colormap.image.ColorMapData;
import com.raytheon.uf.common.colormap.image.ColorMapData.ColorMapDataType;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.IView;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapDataType;
import com.raytheon.uf.viz.core.data.IRenderedImageCallback;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension;

View file

@ -27,8 +27,8 @@ import javax.media.opengl.GL;
import javax.media.opengl.glu.GLU;
import com.raytheon.uf.common.colormap.image.ColorMapData;
import com.raytheon.uf.common.colormap.image.ColorMapData.ColorMapDataType;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapDataType;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.viz.core.gl.GLContextBridge;
import com.raytheon.viz.core.gl.dataformat.GLColorMapData;

View file

@ -21,9 +21,9 @@ package com.raytheon.viz.core.gl.images;
import javax.media.opengl.GL;
import com.raytheon.uf.common.colormap.image.ColorMapData.ColorMapDataType;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapDataType;
import com.raytheon.uf.viz.core.drawables.IColormappedImage;
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension;
import com.raytheon.uf.viz.core.exception.VizException;

View file

@ -21,11 +21,11 @@ package com.raytheon.viz.core.gl.internal.ext.mosaic;
import javax.media.opengl.GL;
import com.raytheon.uf.common.colormap.image.ColorMapData.ColorMapDataType;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.viz.core.DrawableImage;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.PixelCoverage;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapDataType;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.IImage.Status;
import com.raytheon.uf.viz.core.drawables.ImagingSupport;

View file

@ -75,6 +75,16 @@ public class ColorMapData {
this.dataType = dataType;
}
/**
* @param dataType
* @param dataBounds
*/
public ColorMapData(ColorMapDataType dataType, int[] dimensions) {
this.buffer = getBuffer(dataType, dimensions);
this.dimensions = dimensions;
this.dataType = dataType;
}
public Buffer getBuffer() {
return buffer;
}
@ -100,4 +110,25 @@ public class ColorMapData {
throw new RuntimeException("Could not find ColorMapDataType for "
+ buffer);
}
private static Buffer getBuffer(ColorMapDataType dataType, int[] dimensions) {
int size = 1;
for (int i : dimensions) {
size *= i;
}
switch (dataType) {
case BYTE:
case SIGNED_BYTE:
return ByteBuffer.allocate(size);
case SHORT:
case UNSIGNED_SHORT:
return ShortBuffer.allocate(size);
case FLOAT:
return FloatBuffer.allocate(size);
case INT:
return IntBuffer.allocate(size);
default:
throw new RuntimeException("Could not find Buffer for " + dataType);
}
}
}