#include <camera_file_wrapper.hpp>
Detailed Description
A wrapper around the gphoto2 CameraFile struct.
Constructor & Destructor Documentation
gphoto2pp::CameraFileWrapper::CameraFileWrapper |
( |
| ) |
|
gphoto2pp::CameraFileWrapper::~CameraFileWrapper |
( |
| ) |
|
- Note
- this copy constructor does not actually copy the image, but rather makes a copy of this wrapper around the gphoto2 struct CameraFile.
Member Function Documentation
void gphoto2pp::CameraFileWrapper::adjustNameForMimeType |
( |
| ) |
|
Adjusts the file name to match the detected MIME type.
- Recognized MIME Types:
- RAW -> raw
- JPEG -> jpg
- PNG -> png
- PPM -> ppm
- PGM -> pgm
- PNM -> pnm
- TIFF -> tif
- WAV -> wav
- BMP -> bmp
- AVI -> avi
- CRW -> crw
- CR2 -> cr2
- Note
- Direct wrapper for
gp_file_adjust_name_for_mime_type(...)
- Exceptions
-
GPhoto2pp::exceptions::gphoto2_exception | |
void gphoto2pp::CameraFileWrapper::detectMimeType |
( |
| ) |
const |
Detects the MIME type and updates the internal structures MIME type. If the MIME type is still unknown/unknown after this, then gphoto2 does not recognize the file type.
- Note
- Direct wrapper for
gp_file_detect_mime_type(...)
- Exceptions
-
GPhoto2pp::exceptions::gphoto2_exception | |
std::vector< char > gphoto2pp::CameraFileWrapper::getDataAndSize |
( |
| ) |
const |
Gets the file's binary data in a std::string. This structure is acceptable for transportation of the camera file, as it has a size() method and c_str() to retrieve the relevant binary picture data.
- Returns
- the picture
- Note
- Direct wrapper for
gp_file_get_data_and_size(...)
- Exceptions
-
GPhoto2pp::exceptions::gphoto2_exception | |
std::string gphoto2pp::CameraFileWrapper::getFileName |
( |
| ) |
const |
Gets the file's name.
- Returns
- the file name
- Note
- Direct wrapper for
gp_file_get_name(...)
- Exceptions
-
GPhoto2pp::exceptions::gphoto2_exception | |
std::string gphoto2pp::CameraFileWrapper::getMimeType |
( |
| ) |
const |
Gets the file's MIME type.
- Returns
- the mime type
- Note
- Direct wrapper for
gp_file_get_mime_type(...)
- Exceptions
-
GPhoto2pp::exceptions::gphoto2_exception | |
std::time_t gphoto2pp::CameraFileWrapper::getMtime |
( |
| ) |
const |
Gets the timestamp of the file.
- Note
- Direct wrapper for
gp_file_get_mtime(...)
- Exceptions
-
GPhoto2pp::exceptions::gphoto2_exception | |
std::string gphoto2pp::CameraFileWrapper::getNameByType |
( |
std::string const & |
baseName, |
|
|
CameraFileTypeWrapper const & |
type |
|
) |
| const |
Generates a file name using the file type, basename, and mime type.
- Parameters
-
[in] | baseName | for this file, which will appear after the file type and before the mime type |
[in] | type | of file that was captured (Image, Movie, Sound) |
- Note
- Direct wrapper for
gp_file_get_name_by_type(...)
- Exceptions
-
GPhoto2pp::exceptions::gphoto2_exception | |
gphoto2::_CameraFile * gphoto2pp::CameraFileWrapper::getPtr |
( |
| ) |
const |
- Note
- this copy assignments does not actually copy the image, but rather makes a copy of this wrapper around the gphoto2 struct CameraFile.
void gphoto2pp::CameraFileWrapper::save |
( |
std::string const & |
filename | ) |
const |
Saves the current file to the current executing directory with the provided filename.
- Parameters
-
[in] | filename | to save as, ignoring any filename that may be set already |
- Note
- Direct wrapper for
gp_file_save(...)
- Exceptions
-
GPhoto2pp::exceptions::gphoto2_exception | |
void gphoto2pp::CameraFileWrapper::setDataAndSize |
( |
std::vector< char > const & |
file | ) |
|
Sets the camera file's binary data.
- Parameters
-
[in] | file | which will be written into the gphoto2 CameraFile struct |
- Note
- Direct wrapper for
gp_file_set_data_and_size(...)
- Exceptions
-
GPhoto2pp::exceptions::gphoto2_exception | |
void gphoto2pp::CameraFileWrapper::setFileName |
( |
std::string const & |
fileName | ) |
|
Sets the file's name.
- Parameters
-
[in] | fileName | to set for this file |
- Note
- Direct wrapper for
gp_file_set_name(...)
- Exceptions
-
GPhoto2pp::exceptions::gphoto2_exception | |
void gphoto2pp::CameraFileWrapper::setMimeType |
( |
std::string const & |
mimeType | ) |
|
Sets the file's MIME type.
- Parameters
-
[in] | mimeType | to set for this file |
- Note
- Direct wrapper for
gp_file_set_mime_type(...)
- Exceptions
-
GPhoto2pp::exceptions::gphoto2_exception | |
void gphoto2pp::CameraFileWrapper::setMtime |
( |
std::time_t |
mtime | ) |
|
Sets the timestamp of the file.
- Parameters
-
[in] | mtime | to set for this file |
- Note
- Direct wrapper for
gp_file_set_mtime(...)
- Exceptions
-
GPhoto2pp::exceptions::gphoto2_exception | |
The documentation for this class was generated from the following files: