All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edsdk.api.commands.LiveViewCommand Maven / Gradle / Ivy

The newest version!
package edsdk.api.commands;

import java.awt.image.BufferedImage;

import edsdk.api.CanonCommand;
import edsdk.utils.CanonUtils;

/**
 * Performs a live view command on the camera.
 * 
 * Copyright © 2014 Hansi Raber , Ananta Palani
 * 
 * This work is free. You can redistribute it and/or modify it under the
 * terms of the Do What The Fuck You Want To Public License, Version 2,
 * as published by Sam Hocevar. See the COPYING file for more details.
 * 
 * @author hansi
 * @author Ananta Palani
 * 
 */
//TODO: probably a bad idea that Begin/End/Download are static
public class LiveViewCommand {

    public static class Begin extends CanonCommand {

        @Override
        public void run() {
            setResult( CanonUtils.beginLiveView( camera.getEdsCamera() ) );
        }
    }

    public static class End extends CanonCommand {

        @Override
        public void run() {
            setResult( CanonUtils.endLiveView( camera.getEdsCamera() ) );
        }
    }

    public static class Download extends CanonCommand {

        @Override
        public void run() {
            setResult( CanonUtils.getLiveViewImage( camera.getEdsCamera() ) );
        }
    }

    public static class IsLiveViewEnabled extends CanonCommand {

        @Override
        public void run() {
            setResult( CanonUtils.isLiveViewEnabled( camera.getEdsCamera(), false ) );
        }
    }

    public static class IsLiveViewActive extends CanonCommand {

        @Override
        public void run() {
            setResult( CanonUtils.isLiveViewEnabled( camera.getEdsCamera(), true ) );
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy