from openflexure_microscope.api.utilities import get_bool, JsonResponse from openflexure_microscope.api.views import MicroscopeView from openflexure_microscope.utilities import filter_dict import logging from flask import jsonify, request, abort, url_for, redirect, send_file class CaptureAPI(MicroscopeView): def post(self): """ Create a new image capture. .. :quickref: Actions; New capture **Example request**: .. sourcecode:: http POST /actions/camera/capture HTTP/1.1 Accept: application/json { "filename": "myfirstcapture", "temporary": false, "use_video_port": true, "bayer": true, "size": { "width": 640, "height": 480 } } :>header Accept: application/json :json boolean available: availability of capture data :>json string filename: filename of capture :>json string id: unique id of the capture object :>json boolean temporary: delete the capture file on microscope after closing :>json boolean locked: file locked for modifications (mostly used for video recording) :>json string path: path on pi storage to the capture file, if available :>json boolean stream: capture stored in-memory as a BytesIO stream :>json json uri: - **download** *(string)*: api uri to the capture file download - **state** *(string)*: api uri to the capture json representation :
header Accept: application/json :
header Accept: application/json :