Class ScreenShotImageExporter

java.lang.Object
com.ardor3d.image.util.awt.ScreenShotImageExporter
All Implemented Interfaces:
ScreenExportable

public class ScreenShotImageExporter extends Object implements ScreenExportable
  • Field Details

    • _directory

      protected File _directory
    • _prepend

      protected String _prepend
    • _fileFormat

      protected String _fileFormat
    • _useAlpha

      protected boolean _useAlpha
    • _lastFile

      protected File _lastFile
  • Constructor Details

    • ScreenShotImageExporter

      public ScreenShotImageExporter()
      Make a new exporter with the default settings:
       directory: local working directory
       prepend: "capture_"
       format: "png"
       useAlpha: false
       
    • ScreenShotImageExporter

      public ScreenShotImageExporter(File directory, String prepend, String format, boolean useAlpha)
      Construct a new exporter.
      Parameters:
      directory - the directory to save the screen shots in.
      prepend - a value to prepend onto the generated file name. This must be at least 3 characters long.
      format - the format to use for saving the image. ImageIO is used for this, so safe values are likely: "png", "jpg", "gif" and "bmp"
      useAlpha - true for alpha values to be stored in image (as applicable, depending on the given format)
  • Method Details

    • export

      public void export(ByteBuffer data, int width, int height)
      Description copied from interface: ScreenExportable
      Export the given image data (byte buffer) in a manner of our choosing. Note that this byte buffer should be treated by the implementing class as immutable and temporary. If you need access to it after returning from the method, make a copy.
      Specified by:
      export in interface ScreenExportable
      Parameters:
      data - the data from the screen. Please respect the data's limit() value.
      width - the width
      height - the height
    • getFormat

      public ImageDataFormat getFormat()
      Specified by:
      getFormat in interface ScreenExportable
      Returns:
      the image data format we'd like to pull in.
    • getLastFile

      public File getLastFile()
      Returns:
      the last File written by this exporter, or null if none were written.
    • getDirectory

      public File getDirectory()
    • setDirectory

      public void setDirectory(File directory)
    • getPrepend

      public String getPrepend()
    • setPrepend

      public void setPrepend(String prepend)
    • isUseAlpha

      public boolean isUseAlpha()
    • setUseAlpha

      public void setUseAlpha(boolean useAlpha)
    • getFileFormat

      public String getFileFormat()
    • setFileFormat

      public void setFileFormat(String format)