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 class
BufferWrapperRaster.InterpolantLookupTable
-
Field Summary
Fields Modifier and Type Field Description protected BufferWrapper
buffer
-
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.AffineTransform
computeGeographicToRasterTransform(int width, int height, Sector sector)
protected java.awt.geom.AffineTransform
computeSourceToDestTransform(int sourceWidth, int sourceHeight, Sector sourceSector, int destWidth, int destHeight, Sector destSector)
protected BufferWrapperRaster.InterpolantLookupTable
createLookupTable(int width, int height, double xMin, double xMax, double yMin, double yMax, java.awt.geom.AffineTransform lookupTransform)
protected BufferWrapperRaster
createSubRaster(int width, int height, Sector sector, AVList params)
This returns a new sub-raster initialized with the specified properties.void
dispose()
Disposes of any internal resources allocated by the object.protected void
doDrawOnTo(BufferWrapperRaster canvas)
void
drawOnTo(DataRaster canvas)
Copies this raster into a specified raster.void
fill(double value)
protected void
get(int x, int y, int length, double[] buffer, int pos)
BufferWrapper
getBuffer()
double
getDoubleAtPosition(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.long
getSizeInBytes()
Retrieves the approximate size of this object in bytes.double
getTransparentValue()
protected int
indexFor(int x, int y)
protected void
put(int x, int y, double[] buffer, int pos, int length)
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)
void
setDoubleAtPosition(int row, int col, double value)
void
setTransparentValue(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:Cacheable
Retrieves 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:
getSizeInBytes
in interfaceCacheable
- Returns:
- this
Cacheable
object's size in bytes
-
dispose
public void dispose()
Description copied from interface:Disposable
Disposes of any internal resources allocated by the object.- Specified by:
dispose
in 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:DataRaster
Copies this raster into a specified raster.- Specified by:
drawOnTo
in 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 fromdoGetSubRaster
to create the sub-raster instance before populating its contents. This does not place any restrictions on the specifiedwidth
,height
,sector
orparams
.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
,sector
andparams
.
-
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:
computeSourceToDestTransform
in classAbstractDataRaster
-
computeGeographicToRasterTransform
protected java.awt.geom.AffineTransform computeGeographicToRasterTransform(int width, int height, Sector sector)
- Overrides:
computeGeographicToRasterTransform
in 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)
-
-