Documentation of 'visad.ImageFlatField' Java class
ImageFlatField
visad

Class ImageFlatField

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Data, Field, FlatFieldIface, Function, Thing


    public class ImageFlatField
    extends FlatField
    ImageFlatField is a VisAD FlatField backed by a java.awt.image.BufferedImage object, instead of the usual float[][] or double[][] samples array. Expands the samples into floats or doubles on demand using unpackFloats(boolean), which can be expensive for repeated operations of certain types. Such calls can be avoided for certain types of visualization using an 8-bit image with ShadowImageFunctionTypeJ3D.
    See Also:
    Serialized Form
    • Method Detail

      • make3ByteRGB

        public static java.awt.image.BufferedImage make3ByteRGB(java.awt.image.BufferedImage image)
        Converts the given BufferedImage to a format efficient with ImageFlatField's grabBytes method and usable with Java3D texturing by reference.
      • makeFunctionType

        public static FunctionType makeFunctionType(java.awt.image.BufferedImage img)
                                             throws VisADException
        Constructs a FunctionType suitable for use with the given image.
        Throws:
        VisADException
      • makeDomainSet

        public static Set makeDomainSet(java.awt.image.BufferedImage img)
                                 throws VisADException
        Constructs a domain Set suitable for use with the given image.
        Throws:
        VisADException
      • getImage

        public java.awt.image.BufferedImage getImage()
        Gets the image backing this FlatField.
      • setImage

        public void setImage(java.awt.image.BufferedImage image)
                      throws VisADException,
                             java.rmi.RemoteException
        Sets the image backing this FlatField.
        Throws:
        VisADException
        java.rmi.RemoteException
      • getDomainTypes

        public RealType[] getDomainTypes()
        Gets RealType for each domain component (X and Y).
      • getRangeTypes

        public RealType[] getRangeTypes()
        Gets RealType for each range component.
      • setSamples

        public void setSamples(Data[] range,
                               boolean copy)
                        throws VisADException,
                               java.rmi.RemoteException
        Description copied from class: FlatField
        set the range values of the function; the order of range values must be the same as the order of domain indices in the DomainSet; copy argument included for consistency with Field, but ignored
        Specified by:
        setSamples in interface Field
        Overrides:
        setSamples in class FlatField
        Parameters:
        range - The range values
        copy - should the range values be copied
        Throws:
        VisADException
        java.rmi.RemoteException
      • computeRanges

        public DataShadow computeRanges(ShadowType type,
                                        DataShadow shadow)
                                 throws VisADException
        This method has been overridden to avoid a call to unpackValues or unpackFloats during range computation.
        Specified by:
        computeRanges in interface Data
        Overrides:
        computeRanges in class FlatField
        Parameters:
        type - ShadowType generated for MathType of this
        shadow - DataShadow instance whose contained double[][] array and animation sampling Set are modified according to RealType values in this, and used as return value
        Returns:
        DataShadow instance containing double[][] array of RealType ranges, and an animation sampling Set
        Throws:
        VisADException - a VisAD error occurred
      • getSample

        public Data getSample(int index)
                       throws VisADException,
                              java.rmi.RemoteException
        Description copied from class: FlatField
        Get the range value at the index-th sample. FlatField does not override evaluate, but the correctness of FlatField.evaluate depends on overriding getSample
        Specified by:
        getSample in interface Field
        Overrides:
        getSample in class FlatField
        Parameters:
        index - index of requested range sample
        Returns:
        Data object (Real, RealTuple, or Tuple) corresponding to the range at the index-th sample.
        Throws:
        VisADException - problem getting data
        java.rmi.RemoteException - problem getting data from remote object
      • setSamples

        public void setSamples(double[][] range,
                               boolean copy)
                        throws java.rmi.RemoteException,
                               VisADException
        Description copied from class: FlatField
        set range array as range values of this FlatField; the array is dimensioned double[number_of_range_components][number_of_range_samples]; the order of range values must be the same as the order of domain indices in the DomainSet; copy array if copy flag is true
        Specified by:
        setSamples in interface FlatFieldIface
        Overrides:
        setSamples in class FlatField
        Throws:
        java.rmi.RemoteException
        VisADException
      • setSamples

        public void setSamples(float[][] range,
                               boolean copy)
                        throws java.rmi.RemoteException,
                               VisADException
        Description copied from class: FlatField
        set range array as range values of this FlatField; the array is dimensioned float[number_of_range_components][number_of_range_samples]; the order of range values must be the same as the order of domain indices in the DomainSet; copy array if copy flag is true
        Specified by:
        setSamples in interface FlatFieldIface
        Overrides:
        setSamples in class FlatField
        Throws:
        java.rmi.RemoteException
        VisADException
      • setSamples

        public void setSamples(double[][] range,
                               ErrorEstimate[] errors,
                               boolean copy)
                        throws java.rmi.RemoteException,
                               VisADException
        Description copied from class: FlatField
        set the range values of the function including ErrorEstimate-s; the order of range values must be the same as the order of domain indices in the DomainSet
        Specified by:
        setSamples in interface FlatFieldIface
        Overrides:
        setSamples in class FlatField
        Throws:
        java.rmi.RemoteException
        VisADException
      • setSamples

        public void setSamples(int start,
                               double[][] range)
                        throws java.rmi.RemoteException,
                               VisADException
        Description copied from class: FlatField
        update a subset of a FlatField's range samples, where start is the index of the first sample to update and range[0].length is the number of samples to update; the array is dimensioned double[number_of_range_components][number_of_range_samples]
        Specified by:
        setSamples in interface FlatFieldIface
        Overrides:
        setSamples in class FlatField
        Throws:
        java.rmi.RemoteException
        VisADException
      • setSamples

        public void setSamples(float[][] range,
                               ErrorEstimate[] errors,
                               boolean copy)
                        throws java.rmi.RemoteException,
                               VisADException
        Description copied from class: FlatField
        set the range values of the function including ErrorEstimate-s; the order of range values must be the same as the order of domain indices in the DomainSet
        Specified by:
        setSamples in interface FlatFieldIface
        Overrides:
        setSamples in class FlatField
        Throws:
        java.rmi.RemoteException
        VisADException
      • grabBytes

        public static byte[][] grabBytes(java.awt.image.BufferedImage image)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.