gphoto2pp
A C++ Wrapper for libgphoto2
|
#include <camera_wrapper.hpp>
Public Member Functions | |
CameraWrapper () | |
Create a Camera without prior using autoDetect static method. This method will automatically choose the first camera it finds. | |
CameraWrapper (std::string const &model, std::string const &port) | |
Connects and initializes using the provided model and port. | |
~CameraWrapper () | |
CameraWrapper (CameraWrapper &&other) | |
CameraWrapper & | operator= (CameraWrapper &&other) |
CameraWrapper (const CameraWrapper &other) | |
CameraWrapper & | operator= (CameraWrapper const &other) |
std::string | getSummary () const |
Gets the complete summary of the currently connected camera. This summary indicates numerous details about make, model, and configurable abilities. | |
std::string | getModel () const |
Gets the camera model currently connected to. | |
std::string | getPort () const |
Gets the computer port currently connected to the camera. | |
CameraFileWrapper | capturePreview () |
Captures a preview image from the camera. This capture type might not be supported by all cameras (requires a live view/mirror lockup mode for continuous captures). The image does not persist on the camera. | |
CameraFilePathWrapper | capture (CameraCaptureTypeWrapper const &captureType) |
Captures a file from the camera. | |
void | triggerCapture () |
Triggers the camera to take a picture (similar to a remote shutter release). The image is saved to the camera's portable storage for retrieval later. | |
WindowWidget | getConfig () const |
Queries all the properties/abilities on the camera and compiles them in a Widget N-way tree hierarchy. | |
void | setConfig (CameraWidgetWrapper const &cameraWidget) |
Sets the widgets to the provided settings. It's important to note, that if camera settings change (manually by physical interaction), and then you call this method with the old settings, it will change the camera back to the old settings. It's best practice to query the camera, change the settings, and then immediately set the config again. | |
CameraListWrapper | folderListFiles (std::string const &folder) const |
Lists all files in the provided folder. | |
CameraListWrapper | folderListFolders (std::string const &folder) const |
Lists all folders in the provided folder. | |
void | folderDeleteAll (std::string const &folder) |
Delete all files in the provided folder. | |
void | folderPutFile (std::string const &folder, std::string const &fileName, CameraFileTypeWrapper const &fileType, CameraFileWrapper cameraFile) |
Write a file in the provided folder. | |
void | folderMakeDir (std::string const &folder, std::string const &name) |
Make a new folder in the provided directory. | |
void | folderRemoveDir (std::string const &folder, std::string const &name) |
Remove a directory from the provided folder. | |
CameraFileWrapper | fileGet (std::string const &folder, std::string const &fileName, CameraFileTypeWrapper const &fileType) const |
Retrieve a file from the camera. | |
void | fileDelete (std::string const &folder, std::string const &fileName) const |
Delete a file from the camera. | |
observer::Registration | subscribeToCameraEvent (CameraEventTypeWrapper const &event, std::function< void(const CameraFilePathWrapper &, const std::string &)> func) |
Helper method used to subscribe to Camera Wait For events. This method should be used to setup all the callbacks necessary before calling startListeningForEvents. Provide your callback method with lambdas or static/instance methods (use std::bind). | |
bool | startListeningForEvents () |
Starts monitoring the camera events You must subscribe to at least one event type and then perform some action on the camera to see this in action. | |
void | stopListeningForEvents () |
Signals the thread to stop listening. If there is no thread, it leaves the method immediately, if there is a thread running, it is a blocking call which will not return until the thread exits. |
gphoto2pp::CameraWrapper::CameraWrapper | ( | ) |
Create a Camera without prior using autoDetect static method. This method will automatically choose the first camera it finds.
gphoto2pp::CameraWrapper::CameraWrapper | ( | std::string const & | model, |
std::string const & | port | ||
) |
Connects and initializes using the provided model and port.
gphoto2pp::CameraWrapper::~CameraWrapper | ( | ) |
gphoto2pp::CameraWrapper::CameraWrapper | ( | CameraWrapper && | other | ) |
gphoto2pp::CameraWrapper::CameraWrapper | ( | const CameraWrapper & | other | ) |
CameraFilePathWrapper gphoto2pp::CameraWrapper::capture | ( | CameraCaptureTypeWrapper const & | captureType | ) |
Captures a file from the camera.
[in] | captureType | of file to retrieve from the camera |
gp_camera_capture(...)
GPhoto2pp::exceptions::gphoto2_exception |
CameraFileWrapper gphoto2pp::CameraWrapper::capturePreview | ( | ) |
Captures a preview image from the camera. This capture type might not be supported by all cameras (requires a live view/mirror lockup mode for continuous captures). The image does not persist on the camera.
gp_camera_capture_preview(...)
GPhoto2pp::exceptions::gphoto2_exception |
void gphoto2pp::CameraWrapper::fileDelete | ( | std::string const & | folder, |
std::string const & | fileName | ||
) | const |
Delete a file from the camera.
[in] | folder | containing the file to delete |
[in] | fileName | of the file to delete |
gp_camera_file_get(...)
GPhoto2pp::exceptions::gphoto2_exception |
CameraFileWrapper gphoto2pp::CameraWrapper::fileGet | ( | std::string const & | folder, |
std::string const & | fileName, | ||
CameraFileTypeWrapper const & | fileType | ||
) | const |
Retrieve a file from the camera.
[in] | folder | containing the file to get |
[in] | fileName | of the file to retrieve |
[in] | fileType | of the file to retrieve |
gp_camera_file_get(...)
GPhoto2pp::exceptions::gphoto2_exception |
void gphoto2pp::CameraWrapper::folderDeleteAll | ( | std::string const & | folder | ) |
Delete all files in the provided folder.
[in] | folder | to delete all files |
gp_camera_folder_delete_all(...)
GPhoto2pp::exceptions::gphoto2_exception |
CameraListWrapper gphoto2pp::CameraWrapper::folderListFiles | ( | std::string const & | folder | ) | const |
Lists all files in the provided folder.
[in] | folder | to list all files in |
gp_camera_folder_list_files(...)
GPhoto2pp::exceptions::gphoto2_exception |
CameraListWrapper gphoto2pp::CameraWrapper::folderListFolders | ( | std::string const & | folder | ) | const |
Lists all folders in the provided folder.
[in] | folder | to list all folders in |
gp_camera_folder_list_folders(...)
GPhoto2pp::exceptions::gphoto2_exception |
void gphoto2pp::CameraWrapper::folderMakeDir | ( | std::string const & | folder, |
std::string const & | name | ||
) |
Make a new folder in the provided directory.
[in] | folder | to make the new folder in |
[in] | name | for the new folder |
gp_camera_folder_make_dir(...)
GPhoto2pp::exceptions::gphoto2_exception |
void gphoto2pp::CameraWrapper::folderPutFile | ( | std::string const & | folder, |
std::string const & | fileName, | ||
CameraFileTypeWrapper const & | fileType, | ||
CameraFileWrapper | cameraFile | ||
) |
Write a file in the provided folder.
[in] | folder | to write the new file in |
[in] | fileName | for the new file to be written |
[in] | fileType | for the new file to be written |
[in] | cameraFile | contains the new file to be written to the folder |
gp_camera_folder_put_file(...)
GPhoto2pp::exceptions::gphoto2_exception |
void gphoto2pp::CameraWrapper::folderRemoveDir | ( | std::string const & | folder, |
std::string const & | name | ||
) |
Remove a directory from the provided folder.
[in] | folder | containing the folder to remove |
[in] | name | of the folder to remove |
gp_camera_folder_remove_dir(...)
GPhoto2pp::exceptions::gphoto2_exception |
WindowWidget gphoto2pp::CameraWrapper::getConfig | ( | ) | const |
Queries all the properties/abilities on the camera and compiles them in a Widget N-way tree hierarchy.
gp_camera_get_config(...)
GPhoto2pp::exceptions::gphoto2_exception |
std::string gphoto2pp::CameraWrapper::getModel | ( | ) | const |
Gets the camera model currently connected to.
std::string gphoto2pp::CameraWrapper::getPort | ( | ) | const |
Gets the computer port currently connected to the camera.
std::string gphoto2pp::CameraWrapper::getSummary | ( | ) | const |
Gets the complete summary of the currently connected camera. This summary indicates numerous details about make, model, and configurable abilities.
gp_camera_get_summary(...)
GPhoto2pp::exceptions::gphoto2_exception |
CameraWrapper& gphoto2pp::CameraWrapper::operator= | ( | CameraWrapper && | other | ) |
CameraWrapper& gphoto2pp::CameraWrapper::operator= | ( | CameraWrapper const & | other | ) |
void gphoto2pp::CameraWrapper::setConfig | ( | CameraWidgetWrapper const & | cameraWidget | ) |
Sets the widgets to the provided settings. It's important to note, that if camera settings change (manually by physical interaction), and then you call this method with the old settings, it will change the camera back to the old settings. It's best practice to query the camera, change the settings, and then immediately set the config again.
[in] | cameraWidget | to traverse and write all settings to the camera |
gp_camera_set_config(...)
GPhoto2pp::exceptions::gphoto2_exception |
bool gphoto2pp::CameraWrapper::startListeningForEvents | ( | ) |
Starts monitoring the camera events You must subscribe to at least one event type and then perform some action on the camera to see this in action.
void gphoto2pp::CameraWrapper::stopListeningForEvents | ( | ) |
Signals the thread to stop listening. If there is no thread, it leaves the method immediately, if there is a thread running, it is a blocking call which will not return until the thread exits.
observer::Registration gphoto2pp::CameraWrapper::subscribeToCameraEvent | ( | CameraEventTypeWrapper const & | event, |
std::function< void(const CameraFilePathWrapper &, const std::string &)> | func | ||
) |
Helper method used to subscribe to Camera Wait For events. This method should be used to setup all the callbacks necessary before calling startListeningForEvents. Provide your callback method with lambdas or static/instance methods (use std::bind).
[in] | event | type to subscribe to |
[in] | func | callback which will be called each time the event type is triggered |
gp_camera_wait_for_event(...)
GPhoto2pp::exceptions::gphoto2_exception |
void gphoto2pp::CameraWrapper::triggerCapture | ( | ) |
Triggers the camera to take a picture (similar to a remote shutter release). The image is saved to the camera's portable storage for retrieval later.
gp_camera_trigger_capture(...)
GPhoto2pp::exceptions::gphoto2_exception |