Package gaiasky.screenshot
Class ImageRenderer
java.lang.Object
gaiasky.screenshot.ImageRenderer
Utility class to render the current frame buffer to images
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
static String
renderToImageGl20(String absoluteLocation, String baseFileName, int w, int h, Settings.ImageFormat format, float quality)
Saves the current screen as an image to the given directory using the given file name.static com.badlogic.gdx.graphics.Pixmap
renderToPixmap(int w, int h)
static void
static String
writePixmapToImage(String absoluteLocation, String baseFileName, com.badlogic.gdx.graphics.Pixmap pixmap, Settings.ImageFormat format, float quality)
-
Constructor Details
-
ImageRenderer
public ImageRenderer()
-
-
Method Details
-
renderToImageGl20
public static String renderToImageGl20(String absoluteLocation, String baseFileName, int w, int h, Settings.ImageFormat format, float quality)Saves the current screen as an image to the given directory using the given file name. The sequence number is added automatically to the file name. This method works with OpenGL 2.0- Parameters:
absoluteLocation
- The location folderbaseFileName
- File name without extensionw
- The width of the imageh
- The height of the imageformat
- The format, either JPG or PNGquality
- Quality, in case of JPG [0..1]
-
renderToPixmap
public static com.badlogic.gdx.graphics.Pixmap renderToPixmap(int w, int h) -
writePixmapToImage
public static String writePixmapToImage(String absoluteLocation, String baseFileName, com.badlogic.gdx.graphics.Pixmap pixmap, Settings.ImageFormat format, float quality) -
getSequenceNumber
public static int getSequenceNumber() -
resetSequenceNumber
public static void resetSequenceNumber()
-