Calibration now stores to a config file, which can be loaded
This commit is contained in:
parent
f0e638f894
commit
2cf025088b
4 changed files with 235 additions and 15 deletions
|
|
@ -9,9 +9,10 @@ import time
|
|||
MMAL_PARAMETER_ANALOG_GAIN = mmal.MMAL_PARAMETER_GROUP_CAMERA + 0x59
|
||||
MMAL_PARAMETER_DIGITAL_GAIN = mmal.MMAL_PARAMETER_GROUP_CAMERA + 0x5A
|
||||
|
||||
|
||||
def set_gain(camera, gain, value):
|
||||
"""Set the analog gain of a PiCamera.
|
||||
|
||||
|
||||
camera: the picamera.PiCamera() instance you are configuring
|
||||
gain: either MMAL_PARAMETER_ANALOG_GAIN or MMAL_PARAMETER_DIGITAL_GAIN
|
||||
value: a numeric value that can be converted to a rational number.
|
||||
|
|
@ -26,10 +27,12 @@ def set_gain(camera, gain, value):
|
|||
elif ret != 0:
|
||||
raise exc.PiCameraMMALError(ret)
|
||||
|
||||
|
||||
def set_analog_gain(camera, value):
|
||||
"""Set the gain of a PiCamera object to a given value."""
|
||||
set_gain(camera, MMAL_PARAMETER_ANALOG_GAIN, value)
|
||||
|
||||
|
||||
def set_digital_gain(camera, value):
|
||||
"""Set the digital gain of a PiCamera object to a given value."""
|
||||
set_gain(camera, MMAL_PARAMETER_DIGITAL_GAIN, value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue