|
| 1 | +from MF.V3.Descriptors.CaptureImage import CaptureImage as MF_V3_Descriptors_CaptureImage_CaptureImage |
| 2 | +from MF.V3.Settings.CaptureImage import CaptureImage as MF_V3_Settings_CaptureImage_CaptureImage |
| 3 | +from MF.V3.Task import TaskState as MF_V3_Task_TaskState, Task as MF_V3_Task_Task |
| 4 | +from typing import List |
| 5 | + |
| 6 | + |
| 7 | +class CaptureImage: |
| 8 | + """* |
| 9 | + Capture an image from one or both cameras. |
| 10 | +
|
| 11 | + > Request example: |
| 12 | +
|
| 13 | + ```json |
| 14 | + { |
| 15 | + "Task":{ |
| 16 | + "Index":1, |
| 17 | + "Type":"CaptureImage" |
| 18 | + "Input":{ |
| 19 | + "selection":{0,1}, |
| 20 | + "grayscale":false, |
| 21 | + "codec":jpg |
| 22 | + } |
| 23 | + } |
| 24 | + } |
| 25 | + ``` |
| 26 | +
|
| 27 | + > Buffer messages from server. |
| 28 | +
|
| 29 | + ```json |
| 30 | + { |
| 31 | + "Buffer":{ |
| 32 | + "Descriptor":"{"camera":0,"codec":"jpg","grayscale":false,"height":1560,"step":6312,"width":2104}, |
| 33 | + "Index":0, |
| 34 | + "Size":856664, |
| 35 | + "Task":{ |
| 36 | + "Index":1, |
| 37 | + "Type":"CaptureImage", |
| 38 | + "Input":{"selection":{0,1}, "grayscale":false, "codec":jpg} |
| 39 | + } |
| 40 | + } |
| 41 | + } |
| 42 | + ``` |
| 43 | + ```json |
| 44 | + { |
| 45 | + "Buffer":{ |
| 46 | + "Descriptor":"{"camera":1,"codec":"jpg","grayscale":false,"height":1560,"step":6312,"width":2104}, |
| 47 | + "Index":1, |
| 48 | + "Size":847726, |
| 49 | + "Task":{ |
| 50 | + "Index":1, |
| 51 | + "Type":"CaptureImage", |
| 52 | + "Input":{"selection":{0,1}, "grayscale":false, "codec":jpg} |
| 53 | + } |
| 54 | + } |
| 55 | + } |
| 56 | + ``` |
| 57 | +
|
| 58 | + > Response example: |
| 59 | +
|
| 60 | + ```json |
| 61 | + { |
| 62 | + "Task":{ |
| 63 | + "Index":1, |
| 64 | + "Type":"CaptureImage" |
| 65 | + "Input":{ |
| 66 | + "selection":{0,1}, |
| 67 | + "grayscale":false, |
| 68 | + "codec":jpg |
| 69 | + } |
| 70 | + "Output":[ |
| 71 | + {"camera":0,"codec":"jpg","grayscale":false,"height":1560,"step":6312,"width":2104}, |
| 72 | + {"camera":1,"codec":"jpg","grayscale":false,"height":1560,"step":6312,"width":2104} |
| 73 | + ], |
| 74 | + "State":"Completed" |
| 75 | + } |
| 76 | + } |
| 77 | + ``` |
| 78 | + """ |
| 79 | + class Request: |
| 80 | + |
| 81 | + """ |
| 82 | + Client request for the `CaptureImage` task. |
| 83 | + """ |
| 84 | + def __init__(self, Index: int, Type: str, Input: int): |
| 85 | + # A unique identifier generated by the client. |
| 86 | + self.Index = Index |
| 87 | + # "CaptureImage" |
| 88 | + self.Type = Type |
| 89 | + # Index of the project to download. |
| 90 | + self.Input = Input |
| 91 | + |
| 92 | + class Response: |
| 93 | + |
| 94 | + """ |
| 95 | + Server response for the `CaptureImage` task. |
| 96 | + """ |
| 97 | + def __init__(self, Index: int, Type: str, Input: MF_V3_Settings_CaptureImage_CaptureImage, Output: List[MF_V3_Descriptors_CaptureImage_CaptureImage] = None, State: MF_V3_Task_TaskState = None, Error: str = None): |
| 98 | + # The unique identifier generated by the client. |
| 99 | + self.Index = Index |
| 100 | + # "CaptureImage" |
| 101 | + self.Type = Type |
| 102 | + # Requested capture image settings.s |
| 103 | + self.Input = Input |
| 104 | + # A capture image descriptors for each selected camera. |
| 105 | + self.Output = Output |
| 106 | + # The current state of the task. |
| 107 | + self.State = State |
| 108 | + # A string describing the error if the task has failed. |
| 109 | + self.Error = Error |
| 110 | + |
| 111 | + class Buffer: |
| 112 | + |
| 113 | + """ |
| 114 | + Server buffer message for the `CaptureImage` task. |
| 115 | + """ |
| 116 | + def __init__(self, Index: int, Size: int, Task: MF_V3_Task_Task, Descriptor: MF_V3_Descriptors_CaptureImage_CaptureImage): |
| 117 | + # The zero-based index identifying the data buffer. |
| 118 | + self.Index = Index |
| 119 | + # The size of the incoming data buffer in bytes. |
| 120 | + self.Size = Size |
| 121 | + # The requested CaptureImage task. |
| 122 | + self.Task = Task |
| 123 | + # The capture image descriptor. |
| 124 | + self.Descriptor = Descriptor |
| 125 | + |
| 126 | + def __init__(self): |
| 127 | + pass |
| 128 | + |
0 commit comments