Class FileDisplay

  • All Implemented Interfaces:
    Display

    public class FileDisplay
    extends java.lang.Object
    implements Display
    • Constructor Summary

      Constructors 
      Constructor Description
      FileDisplay​(boolean saveImage)  
      FileDisplay​(java.lang.String filename)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void imageBegin​(int w, int h, int bucketSize)
      This is called before an image is rendered to indicate how large the rendered image will be.
      void imageEnd()
      This call is made after the image has been rendered.
      void imageFill​(int x, int y, int w, int h, Color c, float alpha)
      Update the current image with a region of flat color.
      void imagePrepare​(int x, int y, int w, int h, int id)
      Prepare the specified area to be rendered.
      void imageUpdate​(int x, int y, int w, int h, Color[] data, float[] alpha)
      Update the current image with a bucket of data.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileDisplay

        public FileDisplay​(boolean saveImage)
      • FileDisplay

        public FileDisplay​(java.lang.String filename)
    • Method Detail

      • imageBegin

        public void imageBegin​(int w,
                               int h,
                               int bucketSize)
        Description copied from interface: Display
        This is called before an image is rendered to indicate how large the rendered image will be. This allows the display driver to write out image headers or allocate surfaces. Bucket size will be 0 when called from a non-bucket based source.
        Specified by:
        imageBegin in interface Display
        Parameters:
        w - width of the rendered image in pixels
        h - height of the rendered image in pixels
        bucketSize - size of the buckets in pixels
      • imagePrepare

        public void imagePrepare​(int x,
                                 int y,
                                 int w,
                                 int h,
                                 int id)
        Description copied from interface: Display
        Prepare the specified area to be rendered. This may be used to highlight the work in progress area or simply to setup the display driver to receive the specified portion of the image
        Specified by:
        imagePrepare in interface Display
        Parameters:
        x - x coordinate of the bucket within the image
        y - y coordinate of the bucket within the image
        w - width of the bucket in pixels
        h - height of the bucket in pixels
        id - unique identifier corresponding to the thread which invoked this call
      • imageUpdate

        public void imageUpdate​(int x,
                                int y,
                                int w,
                                int h,
                                Color[] data,
                                float[] alpha)
        Description copied from interface: Display
        Update the current image with a bucket of data. The region is guarenteed to be within the bounds created by the call to imageBegin. No clipping is necessary. Colors are passed in unprocessed. It is up the display driver to do any type of quantization, gamma compensation or tone-mapping needed. The array of colors will be exactly w * h long and in row major order.
        Specified by:
        imageUpdate in interface Display
        Parameters:
        x - x coordinate of the bucket within the image
        y - y coordinate of the bucket within the image
        w - width of the bucket in pixels
        h - height of the bucket in pixels
        data - bucket data, this array will be exactly w * h long
        alpha - pixel coverage data, this array will be exactly w * h long
      • imageFill

        public void imageFill​(int x,
                              int y,
                              int w,
                              int h,
                              Color c,
                              float alpha)
        Description copied from interface: Display
        Update the current image with a region of flat color. This is used by progressive rendering to render progressively smaller regions of the screen which will overlap. The region is guarenteed to be within the bounds created by the call to imageBegin. No clipping is necessary. Colors are passed in unprocessed. It is up the display driver to do any type of quantization , gamma compensation or tone-mapping needed.
        Specified by:
        imageFill in interface Display
        Parameters:
        x - x coordinate of the region within the image
        y - y coordinate of the region within the image
        w - with of the region in pixels
        h - height of the region in pixels
        c - color to fill the region with
        alpha - pixel coverage
      • imageEnd

        public void imageEnd()
        Description copied from interface: Display
        This call is made after the image has been rendered. This allows the display driver to close any open files, write the image to disk or flush any other type of buffers.
        Specified by:
        imageEnd in interface Display