gphoto2pp
A C++ Wrapper for libgphoto2
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
gphoto2pp::helper Namespace Reference

Namespaces

namespace  debugging

Functions

void capturePreview (CameraWrapper &cameraWrapper, std::string const &outputFilename)
 Takes a preview picture from the camera. This capture type might not be supported by all cameras (requires a live view/mirror lockup mode for continuous captures)
void capturePreview (CameraWrapper &cameraWrapper, std::ostream &outputStream)
 Takes a preview picture from the camera. This capture type might not be supported by all cameras (requires a live view/mirror lockup mode for continuous captures)
void capture (CameraWrapper &cameraWrapper, CameraFileWrapper &cameraFile, bool autoDeleteFileFromSrc=false, CameraCaptureTypeWrapper const &captureType=CameraCaptureTypeWrapper::Image, CameraFileTypeWrapper const &fileType=CameraFileTypeWrapper::Normal)
 Captures a file from the camera.
void capture (CameraWrapper &cameraWrapper, std::string const &outputFilename, bool autoDeleteFileFromSrc=false, CameraCaptureTypeWrapper const &captureType=CameraCaptureTypeWrapper::Image, CameraFileTypeWrapper const &fileType=CameraFileTypeWrapper::Normal)
 Captures a file from the camera.
void capture (CameraWrapper &cameraWrapper, std::ostream &outputStream, bool autoDeleteFileFromSrc=false, CameraCaptureTypeWrapper const &captureType=CameraCaptureTypeWrapper::Image, CameraFileTypeWrapper const &fileType=CameraFileTypeWrapper::Normal)
 Captures a file from the camera.
std::vector< std::string > getAllFolders (CameraWrapper &cameraWrapper)
 Recursively scans the camera's filesystem and compiles a list of all folders present.
std::vector< std::string > getAllFiles (CameraWrapper &cameraWrapper)
 Recursively scans the camera's filesystem and compiles a list of all files present.
void setCanonCapture (CameraWrapper &cameraWrapper, bool capture)
 Canon cameras need this set to true to allow pictures to save to the sd card.
std::vector< std::string > getAllWidgetsNames (NonValueWidget const &parentWidget, bool showFullName=false)
 Traverses the widget tree (depth first pre-order) and returns all widgets.
std::vector< std::string > getAllWidgetsNamesOfType (NonValueWidget const &parentWidget, CameraWidgetTypeWrapper const &filterByWidgetType, bool showFullName=false)
 Traverses the widget tree (depth first pre-order) and returns all widgets matching the provided type.
void getChildrenItems (CameraWrapper &cameraWrapper, std::string const &folder, std::vector< std::string > &allItems, bool getFiles)
void getWidgetSummary (NonValueWidget const &currentWidget, std::string const &parentWidgetPath, std::vector< std::string > &allWidgetNames, bool showFullName, bool onlySpecificWidgetType, CameraWidgetTypeWrapper const &filterByWidgetType)

Function Documentation

void gphoto2pp::helper::capture ( CameraWrapper &  cameraWrapper,
CameraFileWrapper &  cameraFile,
bool  autoDeleteFileFromSrc = false,
CameraCaptureTypeWrapper const &  captureType = CameraCaptureTypeWrapper::Image,
CameraFileTypeWrapper const &  fileType = CameraFileTypeWrapper::Normal 
)

Captures a file from the camera.

Parameters
[in]cameraWrapperinstance which will be used to issue the capture command
[out]cameraFilewill have the captured file's contents loaded into it's instance
[in]autoDeleteImageFromSrcwill remove the file from temporary memory after it's contents have been copied into the cameraFile. The capt0000 is never cleaned up automatically until the camera exists. Most cases will want this set to true, especially long running programs.
[in]captureTypeindicates to the camera what file we want (Image, Sound, Movie)
[in]fileTypeindicates the type of file to capture from the camera (Raw, Normal, exif, etc...). Most modern cameras can leave this as default.
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
void gphoto2pp::helper::capture ( CameraWrapper &  cameraWrapper,
std::string const &  outputFilename,
bool  autoDeleteFileFromSrc = false,
CameraCaptureTypeWrapper const &  captureType = CameraCaptureTypeWrapper::Image,
CameraFileTypeWrapper const &  fileType = CameraFileTypeWrapper::Normal 
)

Captures a file from the camera.

Parameters
[in]cameraWrapperinstance which will be used to issue the capture command
[out]outputFilenamewill be used when saving the captured file to disk
[in]autoDeleteImageFromSrcwill remove the file from temporary memory after it's contents have been copied into the cameraFile. The capt0000 is never cleaned up automatically until the camera exists. Most cases will want this set to true, especially long running programs.
[in]captureTypeindicates to the camera what file we want (Image, Sound, Movie)
[in]fileTypeindicates the type of file to capture from the camera (Raw, Normal, exif, etc...). Most modern cameras can leave this as default.
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
void gphoto2pp::helper::capture ( CameraWrapper &  cameraWrapper,
std::ostream &  outputStream,
bool  autoDeleteFileFromSrc = false,
CameraCaptureTypeWrapper const &  captureType = CameraCaptureTypeWrapper::Image,
CameraFileTypeWrapper const &  fileType = CameraFileTypeWrapper::Normal 
)

Captures a file from the camera.

Parameters
[in]cameraWrapperinstance which will be used to issue the capture command
[out]outputStreamwill contain the file data in the ostream memory
[in]autoDeleteImageFromSrcwill remove the file from temporary memory after it's contents have been copied into the cameraFile. The capt0000 is never cleaned up automatically until the camera exists. Most cases will want this set to true, especially long running programs.
[in]captureTypeindicates to the camera what file we want (Image, Sound, Movie)
[in]fileTypeindicates the type of file to capture from the camera (Raw, Normal, exif, etc...). Most modern cameras can leave this as default.
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
void gphoto2pp::helper::capturePreview ( CameraWrapper &  cameraWrapper,
std::string const &  outputFilename 
)

Takes a preview picture from the camera. This capture type might not be supported by all cameras (requires a live view/mirror lockup mode for continuous captures)

Parameters
[in]cameraWrapperinstance which will be used to issue the capture_preview command
[in]outputFilenamewill be used when saving the captured image to disk
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
void gphoto2pp::helper::capturePreview ( CameraWrapper &  cameraWrapper,
std::ostream &  outputStream 
)

Takes a preview picture from the camera. This capture type might not be supported by all cameras (requires a live view/mirror lockup mode for continuous captures)

Parameters
[in]cameraWrapperinstance which will be used to issue the capture_preview command
[out]outputStreamwill contain the file data in the ostream memory
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
std::vector< std::string > gphoto2pp::helper::getAllFiles ( CameraWrapper &  cameraWrapper)

Recursively scans the camera's filesystem and compiles a list of all files present.

Parameters
[in]cameraWrapperinstance which will be used to issue the capture command
Returns
the list of all files
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
std::vector< std::string > gphoto2pp::helper::getAllFolders ( CameraWrapper &  cameraWrapper)

Recursively scans the camera's filesystem and compiles a list of all folders present.

Parameters
[in]cameraWrapperinstance which will be used to issue the capture command
Returns
the list of all folders
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
std::vector< std::string > gphoto2pp::helper::getAllWidgetsNames ( NonValueWidget const &  parentWidget,
bool  showFullName = false 
)

Traverses the widget tree (depth first pre-order) and returns all widgets.

Parameters
[in]parentWidgetis the starting node, and this will only traverse children of this node (it will not visit ancestors, if present)
[in]showFullNameindicates whether to show the full widget path (eg... true = /main/imgsettings/iso vs. false = iso)
Returns
the compiled list of all widgets found
std::vector< std::string > gphoto2pp::helper::getAllWidgetsNamesOfType ( NonValueWidget const &  parentWidget,
CameraWidgetTypeWrapper const &  filterByWidgetType,
bool  showFullName = false 
)

Traverses the widget tree (depth first pre-order) and returns all widgets matching the provided type.

Parameters
[in]parentWidgetis the starting node, and this will only traverse children of this node (it will not visit ancestors, if present)
[in]filterByWidgetTypewill only show results that match this widget type
[in]showFullNameindicates whether to show the full widget path (eg... true = /main/imgsettings/iso vs. false = iso)
void gphoto2pp::helper::getChildrenItems ( CameraWrapper &  cameraWrapper,
std::string const &  folder,
std::vector< std::string > &  allItems,
bool  getFiles 
)
void gphoto2pp::helper::getWidgetSummary ( NonValueWidget const &  currentWidget,
std::string const &  parentWidgetPath,
std::vector< std::string > &  allWidgetNames,
bool  showFullName,
bool  onlySpecificWidgetType,
CameraWidgetTypeWrapper const &  filterByWidgetType 
)
void gphoto2pp::helper::setCanonCapture ( CameraWrapper &  cameraWrapper,
bool  capture 
)

Canon cameras need this set to true to allow pictures to save to the sd card.

Parameters
[in]cameraWrapperinstance which will be used to issue the capture command
Exceptions
GPhoto2pp::exceptions::gphoto2_exception