unreal.MagicLeapCameraFunctionLibrary
¶
- class unreal.MagicLeapCameraFunctionLibrary(outer=None, name='None')¶
Bases:
unreal.BlueprintFunctionLibrary
The MagicLeapCameraFunctionLibrary provides access to the camera capture functionality. Users of this library are able to asynchronously capture camera images and footage to file. Alternatively, a camera image can be captured directly to texture. The user need only make the relevant asynchronous call and then register the appropriate event handlers for the operation’s completion.
C++ Source:
Plugin: MagicLeapCamera
Module: MagicLeapCamera
File: MagicLeapCameraFunctionLibrary.h
- classmethod camera_connect(result_delegate) → bool¶
Establishes a connection with the device’s camera. note: A connection will be made automatically upon the first capture call if this is not called first. Calling this function manually allows the developer to control when privilege notifications for this plugin will be activated (if application is being used for the first time).
- Parameters
result_delegate (MagicLeapCameraConnect) –
- Returns
True if the call succeeds, false otherwise.
- Return type
- classmethod camera_disconnect(result_delegate) → bool¶
Disconnects from the device’s camera. note: This function must be called before the application terminates (if the camera has been connected to). Failure to do so will result in the camera connection remaining open (and the camera icon remaining on screen).
- Parameters
result_delegate (MagicLeapCameraDisconnect) –
- Returns
True if the call succeeds, false otherwise.
- Return type
- classmethod capture_image_to_file_async(result_delegate) → bool¶
Initiates a capture image to file task on a separate thread. brief: The newly created jpeg file will have an automatically generated name which is guaranteed to be unique. Upon completion, a successful operation will provide the file path of the newly created jpeg to the FMagicLeapCameraCaptureImgToFile event handler.
- Parameters
result_delegate (MagicLeapCameraCaptureImgToFile) – The delegate to be notified once the camera image has been saved to a jpeg file.
- Returns
True if the call succeeds, false otherwise.
- Return type
- classmethod capture_image_to_texture_async(result_delegate) → bool¶
Initiates a capture image to memory task on a speparate thread. brief: The user should register event handlers for both the success and fail events. Upon completion, a successful operation will provide a dynamically generated texture containing the captured image to the FMagicLeapCameraCaptureImgToTextureSuccess event handler. note: The generated texture will be garbage collected when this app is destroyed.
- Parameters
result_delegate (MagicLeapCameraCaptureImgToTexture) – The delegate to be notified once the camera image has been saved to a texture.
- Returns
True if the call succeeds, false otherwise.
- Return type
- classmethod is_capturing() → bool¶
Gets the capture state of the component.
- Returns
True if the component is currently capturing, false otherwise.
- Return type
- classmethod set_log_delegate(log_delegate) → bool¶
Sets the delegate by which the system can pass log messages back to the calling blueprint.
- Parameters
log_delegate (MagicLeapCameraLogMessage) – The delegate by which the system will return log messages to the calling blueprint.
- Returns
True if the call succeeds, false otherwise.
- Return type
- classmethod start_recording_async(result_delegate) → bool¶
Initiates the capturing of video/audio data on a separate thread. note: The system will continue to record video until StopRecordingVideo is called.
- Parameters
result_delegate (MagicLeapCameraStartRecording) – The delegate to be notified once the recording has begun or failed to begin.
- Returns
True if the call succeeds, false otherwise.
- Return type
- classmethod stop_recording_async(result_delegate) → bool¶
Stops the recording and saves the video/audio data to an mp4 file. note: The newly created mp4 file will have an automatically generated name which is guaranteed to be unique.
- Parameters
result_delegate (MagicLeapCameraStopRecording) – The delegate to be notified once the video/audio data has been saved to an mp4 file.
- Returns
True if the call succeeds, false otherwise.
- Return type