Class AbstractCoverage.Renderable

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected GeneralPosition coordinate
      A coordinate point where to evaluate the function.
      protected int xAxis
      Dimension to use for x axis.
      protected int yAxis
      Dimension to use for y axis.
      • Fields inherited from class PropertySourceImpl

        cachedPropertyNames, properties, propertySources
    • Constructor Summary

      Constructors 
      Constructor Description
      Renderable​(int xAxis, int yAxis)
      Constructs a renderable image.
    • Field Detail

      • xAxis

        protected final int xAxis
        Dimension to use for x axis.
      • yAxis

        protected final int yAxis
        Dimension to use for y axis.
      • coordinate

        protected final GeneralPosition coordinate
        A coordinate point where to evaluate the function. The point dimension is equals to the coverage's dimension. The x and y ordinates will be ignored, since they will vary for each pixel to be evaluated. Other ordinates, if any, should be set to a fixed value. For example a coverage may be three-dimensional, where the third dimension is the time axis. In such case, coordinate.ord[2] should be set to the point in time where to evaluate the coverage. By default, all ordinates are initialized to 0. Subclasses should set the desired values in their constructor if needed.
    • Constructor Detail

      • Renderable

        public Renderable​(int xAxis,
                          int yAxis)
        Constructs a renderable image.
        Parameters:
        xAxis - Dimension to use for x axis.
        yAxis - Dimension to use for y axis.
    • Method Detail

      • isComplex

        public boolean isComplex()
        Returns false since values are not complex.
        Specified by:
        isComplex in interface ImageFunction
        Returns:
        Always false in default implementation.
      • createDefaultRendering

        public RenderedImage createDefaultRendering()
        Returns a rendered image with a default width and height in pixels.
        Specified by:
        createDefaultRendering in interface RenderableImage
        Returns:
        A rendered image containing the rendered data
      • createRendering

        public RenderedImage createRendering​(RenderContext context)
        Creates a rendered image using a given render context. This method will uses an "ImageFunction" operation if possible (i.e. if the area of interect is rectangular and the affine transform contains only translation and scale coefficients).
        Specified by:
        createRendering in interface RenderableImage
        Parameters:
        context - The render context to use to produce the rendering.
        Returns:
        A rendered image containing the rendered data
      • createRenderContext

        protected RenderContext createRenderContext​(Rectangle2D gridBounds,
                                                    RenderingHints hints)
        Initializes a render context with an affine transform that maps the coverage envelope to the specified destination rectangle. The affine transform mays swap axis in order to normalize their order (i.e. make them appear in the (x,y) order), so that the image appears properly oriented when rendered.
        Parameters:
        gridBounds - The two-dimensional destination rectangle.
        hints - The rendering hints, or null if none.
        Returns:
        A render context initialized with an affine transform from the coverage to the grid coordinate system. This transform is the inverse of GridGeometry2D.getGridToCRS2D().
        See Also:
        GridGeometry2D.getGridToCRS2D()
      • getNumElements

        public int getNumElements()
        Returns the number of elements per value at each position. This is the maximum value plus 1 allowed in getElements(...) methods invocation. The default implementation returns the number of sample dimensions in the coverage.
        Specified by:
        getNumElements in interface ImageFunction
        Returns:
        The number of sample dimensions.
      • getElements

        public void getElements​(float startX,
                                float startY,
                                float deltaX,
                                float deltaY,
                                int countX,
                                int countY,
                                int element,
                                float[] real,
                                float[] imag)
        Returns all values of a given element for a specified set of coordinates. This method is automatically invoked at rendering time for populating an image tile, providing that the rendered image is created using the "ImageFunction" operator and the image type is not double.
        Specified by:
        getElements in interface ImageFunction
      • getElements

        public void getElements​(double startX,
                                double startY,
                                double deltaX,
                                double deltaY,
                                int countX,
                                int countY,
                                int element,
                                double[] real,
                                double[] imag)
        Returns all values of a given element for a specified set of coordinates. This method is automatically invoked at rendering time for populating an image tile, providing that the rendered image is created using the "ImageFunction" operator and the image type is double. The default implementation invokes AbstractCoverage.evaluate(Position,double[]) recursively.
        Specified by:
        getElements in interface ImageFunction