Add Image settings setter
This commit is contained in:
@@ -83,5 +83,5 @@ SET:
|
|||||||
- [x] PTZ
|
- [x] PTZ
|
||||||
- [x] Zoom
|
- [x] Zoom
|
||||||
- [x] Focus
|
- [x] Focus
|
||||||
- [ ] Image (Brightness, Contrast, Saturation, Hue, Sharp, Mirror, Rotate)
|
- [X] Image (Brightness, Contrast, Saturation, Hue, Sharp, Mirror, Rotate)
|
||||||
- [X] Advanced Image (Anti-flicker, Exposure, White Balance, DayNight, Backlight, LED light, 3D-NR)
|
- [X] Advanced Image (Anti-flicker, Exposure, White Balance, DayNight, Backlight, LED light, 3D-NR)
|
||||||
|
|||||||
38
api/image.py
38
api/image.py
@@ -2,7 +2,7 @@
|
|||||||
class ImageAPIMixin:
|
class ImageAPIMixin:
|
||||||
"""API calls for image settings."""
|
"""API calls for image settings."""
|
||||||
|
|
||||||
def set_advanced_imaging(self,
|
def set_adv_image_settings(self,
|
||||||
anti_flicker='Outdoor',
|
anti_flicker='Outdoor',
|
||||||
exposure='Auto',
|
exposure='Auto',
|
||||||
gain_min=1,
|
gain_min=1,
|
||||||
@@ -21,6 +21,7 @@ class ImageAPIMixin:
|
|||||||
nr3d=1) -> object:
|
nr3d=1) -> object:
|
||||||
"""
|
"""
|
||||||
Sets the advanced camera settings.
|
Sets the advanced camera settings.
|
||||||
|
|
||||||
:param anti_flicker: string
|
:param anti_flicker: string
|
||||||
:param exposure: string
|
:param exposure: string
|
||||||
:param gain_min: int
|
:param gain_min: int
|
||||||
@@ -63,3 +64,38 @@ class ImageAPIMixin:
|
|||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
return self._execute_command('SetIsp', body)
|
return self._execute_command('SetIsp', body)
|
||||||
|
|
||||||
|
def set_image_settings(self,
|
||||||
|
brightness=128,
|
||||||
|
contrast=62,
|
||||||
|
hue=1,
|
||||||
|
saturation=125,
|
||||||
|
sharpness=128) -> object:
|
||||||
|
"""
|
||||||
|
Sets the camera image settings.
|
||||||
|
|
||||||
|
:param brightness: int
|
||||||
|
:param contrast: string
|
||||||
|
:param hue: int
|
||||||
|
:param saturation: int
|
||||||
|
:param sharpness: int
|
||||||
|
:return: response
|
||||||
|
"""
|
||||||
|
body = [
|
||||||
|
{
|
||||||
|
"cmd": "SetImage",
|
||||||
|
"action": 0,
|
||||||
|
"param": {
|
||||||
|
"Image": {
|
||||||
|
"bright": brightness,
|
||||||
|
"channel": 0,
|
||||||
|
"contrast": contrast,
|
||||||
|
"hue": hue,
|
||||||
|
"saturation": saturation,
|
||||||
|
"sharpen": sharpness
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
return self._execute_command('SetImage', body)
|
||||||
|
|||||||
Reference in New Issue
Block a user