Add a bool parameter to correct principal point and another to export full RoI in exr format

This commit is contained in:
jouetp 2021-01-29 17:19:20 +01:00 committed by Fabien Castan
parent 743fdce1a4
commit d77d26889f

View file

@ -41,11 +41,25 @@ Based on the input image filenames, it will recognize the input video sequence t
value=False,
uid=[0],
),
desc.BoolParam(
name='exportFullROD',
label='Export Full ROD',
description='Export Full ROD.',
value=False,
uid=[0],
),
desc.BoolParam(
name='correctPrincipalPoint',
label='Correct Principal Point ',
description='Correct Principal Point.',
value=True,
uid=[0],
),
desc.ChoiceParam(
name='undistortedImageType',
label='Undistort Image Format',
label='Undistort Image Format ',
description='Image file format to use for undistorted images ("jpg", "png", "tif", "exr (half)").',
value='jpg',
value= lambda node: 'jpg' or 'exr' and not node.exportFullROD,
values=['jpg', 'png', 'tif', 'exr'],
exclusive=True,
uid=[0],
@ -78,4 +92,23 @@ Based on the input image filenames, it will recognize the input video sequence t
group='', # exclude from command line
uid=[],
),
]
]
prev = False
@classmethod
def update(cls, node):
if not isinstance(node.nodeDesc, cls):
raise ValueError("Node {} is not an instance of type {}".format(node, cls))
# TODO: use Node version for this test
if not cls.prev:
node.undistortedImageType.value = 'jpg'
cls.prev = True
if node.exportFullROD.value:
node.undistortedImageType.value = 'exr'
node.undistortedImageType.enabled = False
else:
node.undistortedImageType.enabled = True
if not node.exportUndistortedImages.value:
node.exportFullROD.value = False