Class OutputModule
- All Implemented Interfaces:
OutputAPI
Screenshots and frames are saved to a pre-defined location. You can get the default locations
with BaseModule.get_default_frame_output_dir() and BaseModule.get_default_screenshots_dir().
-
Field Summary
Fields inherited from class APIModule
api, em, logger, me, nameModifier and TypeFieldDescriptionprotected final APIv2Reference to API object.protected final EventManagerReference to event manager.protected final Logger.Logprotected final APIModuleReference to self.protected final StringModule name. -
Constructor Summary
ConstructorsConstructorDescriptionOutputModule(EventManager em, APIv2 api, String name) Create a new module with the given attributes. -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure_frame_output(int w, int h, double fps, String path, String prefix) Configure the frame output system, setting the resolution of the images, the target frames per second, the output directory and the image name prefix.voidconfigure_frame_output(int w, int h, int fps, String path, String prefix) Configure the frame output system, setting the resolution of the images, the target frames per second, the output directory and the image name prefix.voidconfigure_screenshots(int w, int h, String path, String prefix) Configures the screenshot system, setting the resolution of the images, the output directory and the image name prefix.voidframe_output(boolean active) Activate or deactivate the frame output system.voidframe_output_mode(String mode) Set the frame output mode.Get the current output directory for the frame output system as a string.Get the current output directory for screenshots as a string.doubleGet the current frame rate setting of the frame output system.booleanCheck whether the frame output system is currently on (i.e.voidResets to zero the image sequence number used to generate the file names of the frame output images.voidTake a screenshot of the current frame and saves it to the configured location (seeOutputAPI.configure_screenshots(int, int, String, String)).voidscreenshot_mode(String mode) Set the screenshot mode.
-
Constructor Details
-
OutputModule
Create a new module with the given attributes.- Parameters:
api- Reference to the API class.name- Name of the module.
-
-
Method Details
-
configure_screenshots
Description copied from interface:OutputAPIConfigures the screenshot system, setting the resolution of the images, the output directory and the image name prefix.- Specified by:
configure_screenshotsin interfaceOutputAPI- Parameters:
w- Width of images.h- Height of images.path- The output directory path.prefix- The file name prefix.
-
get_current_screenshots_dir
Description copied from interface:OutputAPIGet the current output directory for screenshots as a string. This comes from a setting stored in the configuration file. To get the default screenshots location, useBaseModule.get_default_screenshots_dir().- Specified by:
get_current_screenshots_dirin interfaceOutputAPI- Returns:
- The absolute path to the current output directory for screenshots.
-
screenshot_mode
Description copied from interface:OutputAPISet the screenshot mode. Possible values aresimpleandadvanced.The simple mode is faster and just outputs the last frame rendered to the Gaia Sky window, with the same resolution and containing the UI elements. The advanced mode redraws the last frame using the resolution configured using
OutputAPI.configure_screenshots(int, int, String, String)and it does not draw the UI.- Specified by:
screenshot_modein interfaceOutputAPI- Parameters:
mode- The screenshot mode.simpleoradvanced.
-
screenshot
public void screenshot()Description copied from interface:OutputAPITake a screenshot of the current frame and saves it to the configured location (seeOutputAPI.configure_screenshots(int, int, String, String)).- Specified by:
screenshotin interfaceOutputAPI
-
configure_frame_output
Description copied from interface:OutputAPIConfigure the frame output system, setting the resolution of the images, the target frames per second, the output directory and the image name prefix. This function sets the frame output mode to 'advanced'.- Specified by:
configure_frame_outputin interfaceOutputAPI- Parameters:
w- Width of images.h- Height of images.fps- Target frames per second (number of images per second).path- The output directory path.prefix- The file name prefix.
-
get_current_frame_output_dir
Description copied from interface:OutputAPIGet the current output directory for the frame output system as a string. This comes from a setting stored in the configuration file. To get the default frame output location, useBaseModule.get_default_frame_output_dir().- Specified by:
get_current_frame_output_dirin interfaceOutputAPI- Returns:
- The absolute path to the current output directory for the frame output system.
-
configure_frame_output
Description copied from interface:OutputAPIConfigure the frame output system, setting the resolution of the images, the target frames per second, the output directory and the image name prefix. This function sets the frame output mode to 'advanced'.- Specified by:
configure_frame_outputin interfaceOutputAPI- Parameters:
w- Width of images.h- Height of images.fps- Target frames per second (number of images per second).path- The output directory path.prefix- The file name prefix.
-
frame_output_mode
Description copied from interface:OutputAPISet the frame output mode. Possible values aresimpleandadvanced.The simple mode is faster and just outputs the last frame rendered to the Gaia Sky window, with the same resolution and containing the UI elements. The advanced mode redraws the last frame using the resolution configured using
OutputAPI.configure_frame_output(int, int, int, String, String)and it does not draw the UI.- Specified by:
frame_output_modein interfaceOutputAPI- Parameters:
mode- The screenshot mode.simpleoradvanced.
-
frame_output
public void frame_output(boolean active) Description copied from interface:OutputAPIActivate or deactivate the frame output system. If called with true, the system starts outputting images right away.- Specified by:
frame_outputin interfaceOutputAPI- Parameters:
active- Whether to activate or deactivate the frame output system.
-
is_frame_output_active
public boolean is_frame_output_active()Description copied from interface:OutputAPICheck whether the frame output system is currently on (i.e. frames are being saved to disk).- Specified by:
is_frame_output_activein interfaceOutputAPI- Returns:
- True if the render output is active.
-
get_frame_output_fps
public double get_frame_output_fps()Description copied from interface:OutputAPIGet the current frame rate setting of the frame output system.- Specified by:
get_frame_output_fpsin interfaceOutputAPI- Returns:
- The frame rate setting of the frame output system.
-
reset_frame_output_sequence_number
public void reset_frame_output_sequence_number()Description copied from interface:OutputAPIResets to zero the image sequence number used to generate the file names of the frame output images.- Specified by:
reset_frame_output_sequence_numberin interfaceOutputAPI
-