Package gov.nasa.worldwind.data
Class BufferWrapperRaster
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.data.AbstractDataRaster
-
- gov.nasa.worldwind.data.BufferWrapperRaster
-
- All Implemented Interfaces:
AVList,Cacheable,DataRaster,Disposable
- Direct Known Subclasses:
ByteBufferRaster
public class BufferWrapperRaster extends AbstractDataRaster implements Cacheable, Disposable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classBufferWrapperRaster.InterpolantLookupTable
-
Field Summary
Fields Modifier and Type Field Description protected BufferWrapperbuffer-
Fields inherited from class gov.nasa.worldwind.data.AbstractDataRaster
height, width
-
-
Constructor Summary
Constructors Constructor Description BufferWrapperRaster(int width, int height, Sector sector, BufferWrapper buffer)BufferWrapperRaster(int width, int height, Sector sector, BufferWrapper buffer, AVList list)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.awt.geom.AffineTransformcomputeGeographicToRasterTransform(int width, int height, Sector sector)protected java.awt.geom.AffineTransformcomputeSourceToDestTransform(int sourceWidth, int sourceHeight, Sector sourceSector, int destWidth, int destHeight, Sector destSector)protected BufferWrapperRaster.InterpolantLookupTablecreateLookupTable(int width, int height, double xMin, double xMax, double yMin, double yMax, java.awt.geom.AffineTransform lookupTransform)protected BufferWrapperRastercreateSubRaster(int width, int height, Sector sector, AVList params)This returns a new sub-raster initialized with the specified properties.voiddispose()Disposes of any internal resources allocated by the object.protected voiddoDrawOnTo(BufferWrapperRaster canvas)voiddrawOnTo(DataRaster canvas)Copies this raster into a specified raster.voidfill(double value)protected voidget(int x, int y, int length, double[] buffer, int pos)BufferWrappergetBuffer()doublegetDoubleAtPosition(int row, int col)double[]getExtremes()Returns a two-element array containing this raster's extreme scalar values, ignoring any values marked as missing-data.longgetSizeInBytes()Retrieves the approximate size of this object in bytes.doublegetTransparentValue()protected intindexFor(int x, int y)protected voidput(int x, int y, double[] buffer, int pos, int length)protected static voidsample(double[] source, int x1, int x2, double xf, int y1, int y2, double yf, int width, double transparent, double[] dest, int destPos)voidsetDoubleAtPosition(int row, int col, double value)voidsetTransparentValue(double transparentValue)-
Methods inherited from class gov.nasa.worldwind.data.AbstractDataRaster
computeClipRect, getHeight, getSector, getSubRaster, getSubRaster, getWidth, setValue
-
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValues
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValues
-
-
-
-
Field Detail
-
buffer
protected BufferWrapper buffer
-
-
Constructor Detail
-
BufferWrapperRaster
public BufferWrapperRaster(int width, int height, Sector sector, BufferWrapper buffer, AVList list)
-
BufferWrapperRaster
public BufferWrapperRaster(int width, int height, Sector sector, BufferWrapper buffer)
-
-
Method Detail
-
getBuffer
public BufferWrapper getBuffer()
-
getSizeInBytes
public long getSizeInBytes()
Description copied from interface:CacheableRetrieves the approximate size of this object in bytes. Implementors are encouraged to calculate the exact size for smaller objects, but use approximate values for objects that include such large components that the approximation would produce an error so small that the extra computation would be wasteful.- Specified by:
getSizeInBytesin interfaceCacheable- Returns:
- this
Cacheableobject's size in bytes
-
dispose
public void dispose()
Description copied from interface:DisposableDisposes of any internal resources allocated by the object.- Specified by:
disposein interfaceDisposable
-
getDoubleAtPosition
public double getDoubleAtPosition(int row, int col)
-
setDoubleAtPosition
public void setDoubleAtPosition(int row, int col, double value)
-
getTransparentValue
public double getTransparentValue()
-
setTransparentValue
public void setTransparentValue(double transparentValue)
-
getExtremes
public double[] getExtremes()
Returns a two-element array containing this raster's extreme scalar values, ignoring any values marked as missing-data. This returns null if this raster contains no values, or if it contains only values marked as missing-data.- Returns:
- a two-element array containing this raster's extreme values, or null if none exist. Entry 0 contains the minimum value; entry 1 contains the maximum value.
-
fill
public void fill(double value)
-
drawOnTo
public void drawOnTo(DataRaster canvas)
Description copied from interface:DataRasterCopies this raster into a specified raster.- Specified by:
drawOnToin interfaceDataRaster- Parameters:
canvas- - the raster to copy into.
-
createSubRaster
protected BufferWrapperRaster createSubRaster(int width, int height, Sector sector, AVList params)
This returns a new sub-raster initialized with the specified properties. Called fromdoGetSubRasterto create the sub-raster instance before populating its contents. This does not place any restrictions on the specifiedwidth,height,sectororparams.This returns a
, a subclass of BufferWrapperRaster backed by a ByteBuffer.BufferWrapper.ByteBufferWrapper- Parameters:
width- the width of the sub-raster, in pixels.height- the height of the sub-raster, in pixels.sector- the sector the sub-raster occupies.params- the parameters associated with the sub-raster.- Returns:
- a new sub-raster initialized with the specified
width,height,sectorandparams.
-
doDrawOnTo
protected void doDrawOnTo(BufferWrapperRaster canvas)
-
get
protected void get(int x, int y, int length, double[] buffer, int pos)
-
put
protected void put(int x, int y, double[] buffer, int pos, int length)
-
indexFor
protected final int indexFor(int x, int y)
-
computeSourceToDestTransform
protected java.awt.geom.AffineTransform computeSourceToDestTransform(int sourceWidth, int sourceHeight, Sector sourceSector, int destWidth, int destHeight, Sector destSector)- Overrides:
computeSourceToDestTransformin classAbstractDataRaster
-
computeGeographicToRasterTransform
protected java.awt.geom.AffineTransform computeGeographicToRasterTransform(int width, int height, Sector sector)- Overrides:
computeGeographicToRasterTransformin classAbstractDataRaster
-
sample
protected static void sample(double[] source, int x1, int x2, double xf, int y1, int y2, double yf, int width, double transparent, double[] dest, int destPos)
-
createLookupTable
protected BufferWrapperRaster.InterpolantLookupTable createLookupTable(int width, int height, double xMin, double xMax, double yMin, double yMax, java.awt.geom.AffineTransform lookupTransform)
-
-