Skip to content

hezhao/EDSDK-cpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EDSDK-cpp

EDSDK-cpp is a C++ wrapper of Canon's camera control framework EDSDK. See Canon's compatibility chart for a list of supported cameras.

Features

  • Image capture to memory or on-disk
  • Live view
  • Camera keep-alive
  • Simultaneous control of multiple cameras

Dependencies

Note: Qt is only to handle live view images, you may use another library to handle images.

Install

  1. Move the EDSDK folder into EDSDK-cpp/lib
  2. brew install boost --universal
  3. Open samples/SimpleTether/SimpleTether.xcodeproj and build the target in x86_64 or 32-bit.

Example Code

void CaptureApp::setup() {
    CameraBrowser::instance()->connectAddedHandler(&CaptureApp::browserDidAddCamera, this);
    CameraBrowser::instance()->start();
}

void CaptureApp::browserDidAddCamera(CameraRef camera) {
    mCamera = camera;
    mCamera->connectFileAddedHandler(&CaptureApp::didAddFile, this);
    EdsError error = mCamera->requestOpenSession();
    if (error == EDS_ERR_OK) {
        mCamera->requestTakePicture();
    }
}

void CaptureApp::didAddFile(CameraRef camera, CameraFileRef file) {
    fs::path destinationFolderPath = expandPath(fs::path("~/Desktop/Captures"));
    camera->requestDownloadFile(file, destinationFolderPath, [this](EdsError error, fs::path outputFilePath) {
        if (error == EDS_ERR_OK) {
            console() << "downloaded image to: " << outputFilePath << endl;
        }
    });
}

NOTE - due to a bug introduced in EDSDK 2.10, the CameraBrowser will only call the camera removed handler for cameras with an open session.

Credits

EDSDK-cpp is largely based on Cinder-EDSDK.

About

Canon EDSDK C++ Wrapper

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 99.1%
  • C 0.9%