Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/libraries/AP_Camera/AP_Camera_Scripting.h
Views: 1798
/*1This program is free software: you can redistribute it and/or modify2it under the terms of the GNU General Public License as published by3the Free Software Foundation, either version 3 of the License, or4(at your option) any later version.56This program is distributed in the hope that it will be useful,7but WITHOUT ANY WARRANTY; without even the implied warranty of8MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9GNU General Public License for more details.1011You should have received a copy of the GNU General Public License12along with this program. If not, see <http://www.gnu.org/licenses/>.13*/1415/*16Camera driver for scripting backends17*/18#pragma once1920#include "AP_Camera_Backend.h"2122#if AP_CAMERA_SCRIPTING_ENABLED2324class AP_Camera_Scripting : public AP_Camera_Backend25{26public:2728// Constructor29using AP_Camera_Backend::AP_Camera_Backend;3031/* Do not allow copies */32CLASS_NO_COPY(AP_Camera_Scripting);3334// entry point to actually take a picture35bool trigger_pic() override;3637// start or stop video recording. returns true on success38// set start_recording = true to start record, false to stop recording39bool record_video(bool start_recording) override;4041// set zoom specified as a rate or percentage42bool set_zoom(ZoomType zoom_type, float zoom_value) override;4344// set focus specified as rate, percentage or auto45// focus in = -1, focus hold = 0, focus out = 146SetFocusResult set_focus(FocusType focus_type, float focus_value) override;4748// set tracking to none, point or rectangle (see TrackingType enum)49// if POINT only p1 is used, if RECTANGLE then p1 is top-left, p2 is bottom-right50// p1,p2 are in range 0 to 1. 0 is left or top, 1 is right or bottom51bool set_tracking(TrackingType tracking_type, const Vector2f& p1, const Vector2f& p2) override;5253// returns true on success and cam_state is filled in54bool get_state(AP_Camera::camera_state_t& cam_state) override;5556private:5758// current state59AP_Camera::camera_state_t _cam_state;60};6162#endif // AP_CAMERA_SCRIPTING_ENABLED636465