NASA World Wind

gov.nasa.worldwind.data
Class BufferWrapperRaster

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.data.AbstractDataRaster
          extended by 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
protected static class BufferWrapperRaster.InterpolantLookupTable
           
 
Field Summary
protected  BufferWrapper buffer
           
 
Fields inherited from class gov.nasa.worldwind.data.AbstractDataRaster
height, width
 
Constructor Summary
BufferWrapperRaster(int width, int height, Sector sector, BufferWrapper buffer)
           
BufferWrapperRaster(int width, int height, Sector sector, BufferWrapper buffer, AVList list)
           
 
Method Summary
protected  AffineTransform computeGeographicToRasterTransform(int width, int height, Sector sector)
           
protected  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, 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, finalize, 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)

BufferWrapperRaster

public BufferWrapperRaster(int width,
                           int height,
                           Sector sector,
                           BufferWrapper buffer,
                           AVList list)
Method Detail

computeGeographicToRasterTransform

protected AffineTransform computeGeographicToRasterTransform(int width,
                                                             int height,
                                                             Sector sector)
Overrides:
computeGeographicToRasterTransform in class AbstractDataRaster

computeSourceToDestTransform

protected AffineTransform computeSourceToDestTransform(int sourceWidth,
                                                       int sourceHeight,
                                                       Sector sourceSector,
                                                       int destWidth,
                                                       int destHeight,
                                                       Sector destSector)
Overrides:
computeSourceToDestTransform in class AbstractDataRaster

createLookupTable

protected BufferWrapperRaster.InterpolantLookupTable createLookupTable(int width,
                                                                       int height,
                                                                       double xMin,
                                                                       double xMax,
                                                                       double yMin,
                                                                       double yMax,
                                                                       AffineTransform lookupTransform)

createSubRaster

protected BufferWrapperRaster createSubRaster(int width,
                                              int height,
                                              Sector sector,
                                              AVList params)
This returns a new sub-raster initialized with the specified properties. Called from doGetSubRaster to create the sub-raster instance before populating its contents. This does not place any restrictions on the specified width, height, sector or params.

This returns a BufferWrapper.ByteBufferWrapper, a subclass of BufferWrapperRaster backed by a ByteBuffer.

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 and params.

dispose

public void dispose()
Description copied from interface: Disposable
Disposes of any internal resources allocated by the object.

Specified by:
dispose in interface Disposable

doDrawOnTo

protected void doDrawOnTo(BufferWrapperRaster canvas)

drawOnTo

public void drawOnTo(DataRaster canvas)
Description copied from interface: DataRaster
Copies this raster into a specified raster.

Specified by:
drawOnTo in interface DataRaster
Parameters:
canvas - - the raster to copy into.

fill

public void fill(double value)

get

protected void get(int x,
                   int y,
                   int length,
                   double[] buffer,
                   int pos)

getBuffer

public BufferWrapper getBuffer()

getDoubleAtPosition

public double getDoubleAtPosition(int row,
                                  int col)

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.

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 interface Cacheable
Returns:
this Cacheable object's size in bytes

getTransparentValue

public double getTransparentValue()

indexFor

protected final int indexFor(int x,
                             int y)

put

protected void put(int x,
                   int y,
                   double[] buffer,
                   int pos,
                   int length)

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)

setDoubleAtPosition

public void setDoubleAtPosition(int row,
                                int col,
                                double value)

setTransparentValue

public void setTransparentValue(double transparentValue)

NASA World Wind