Skip to content

Commit

Permalink
[nodes] Replace the list of colorspaces with the utilitary constant
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiencastan committed Feb 1, 2024
1 parent a7fc167 commit 092dcfe
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 14 deletions.
5 changes: 5 additions & 0 deletions meshroom/core/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
COLORSPACES = ["AUTO", "sRGB", "rec709", "Linear", "ACES2065-1", "ACEScg", "Linear ARRI Wide Gamut 3",
"ARRI LogC3 (EI800)", "Linear ARRI Wide Gamut 4", "ARRI LogC4", "Linear BMD WideGamut Gen5",
"BMDFilm WideGamut Gen5", "CanonLog2 CinemaGamut D55", "CanonLog3 CinemaGamut D55",
"Linear CinemaGamut D55", "Linear V-Gamut", "V-Log V-Gamut", "Linear REDWideGamutRGB",
"Log3G10 REDWideGamutRGB", "Linear Venice S-Gamut3.Cine", "S-Log3 Venice S-Gamut3.Cine", "no_conversion"]
3 changes: 2 additions & 1 deletion meshroom/nodes/aliceVision/FeatureExtraction.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
__version__ = "1.3"

from meshroom.core import desc
from meshroom.core.utils import COLORSPACES


class FeatureExtraction(desc.AVCommandLineNode):
Expand Down Expand Up @@ -140,8 +141,8 @@ class FeatureExtraction(desc.AVCommandLineNode):
name="workingColorSpace",
label="Working Color Space",
description="Allows you to choose the color space in which the data are processed.",
values=COLORSPACES,
value="sRGB",
values=["sRGB", "Linear", "ACES2065-1", "ACEScg", "no_conversion"],
exclusive=True,
uid=[0],
),
Expand Down
7 changes: 4 additions & 3 deletions meshroom/nodes/aliceVision/ImageProcessing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
__version__ = "3.3"

from meshroom.core import desc
from meshroom.core.utils import COLORSPACES

import os.path

Expand Down Expand Up @@ -497,26 +498,26 @@ class ImageProcessing(desc.AVCommandLineNode):
name="inputColorSpace",
label="Input Color Space",
description="Allows you to force the color space of the input image.",
values=COLORSPACES,
value="AUTO",
values=["AUTO", "sRGB", "rec709", "Linear", "ACES2065-1", "ACEScg", "no_conversion"],
exclusive=True,
uid=[0],
),
desc.ChoiceParam(
name="outputColorSpace",
label="Output Color Space",
description="Allows you to choose the color space of the output image.",
values=COLORSPACES,
value="AUTO",
values=["AUTO", "sRGB", "rec709", "Linear", "ACES2065-1", "ACEScg", "no_conversion"],
exclusive=True,
uid=[0],
),
desc.ChoiceParam(
name="workingColorSpace",
label="Working Color Space",
description="Allows you to choose the color space in which the data are processed.",
values=COLORSPACES,
value="Linear",
values=["sRGB", "rec709", "Linear", "ACES2065-1", "ACEScg", "no_conversion"],
exclusive=True,
uid=[0],
enabled=lambda node: not node.applyDcpMetadata.value,
Expand Down
5 changes: 3 additions & 2 deletions meshroom/nodes/aliceVision/LdrToHdrCalibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from collections import Counter

from meshroom.core import desc
from meshroom.core.utils import COLORSPACES

def findMetadata(d, keys, defaultValue):
v = None
Expand Down Expand Up @@ -126,8 +127,8 @@ class LdrToHdrCalibration(desc.AVCommandLineNode):
label="Working Color Space",
description="Color space in which the data are processed.\n"
"If 'auto' is selected, the working color space will be 'Linear' if RAW images are detected; otherwise, it will be set to 'sRGB'.",
value="auto",
values=["auto", "sRGB", "Linear", "ACES2065-1", "ACEScg"],
values=COLORSPACES,
value="AUTO",
exclusive=True,
uid=[],
group="user", # not used directly on the command line
Expand Down
5 changes: 3 additions & 2 deletions meshroom/nodes/aliceVision/LdrToHdrMerge.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from collections import Counter

from meshroom.core import desc
from meshroom.core.utils import COLORSPACES

def findMetadata(d, keys, defaultValue):
v = None
Expand Down Expand Up @@ -169,8 +170,8 @@ class LdrToHdrMerge(desc.AVCommandLineNode):
label="Working Color Space",
description="Color space in which the data are processed.\n"
"If 'auto' is selected, the working color space will be 'Linear' if RAW images are detected; otherwise, it will be set to 'sRGB'.",
value="auto",
values=["auto", "sRGB", "Linear", "ACES2065-1", "ACEScg", "no_conversion"],
values=COLORSPACES,
value="AUTO",
exclusive=True,
uid=[0],
enabled=lambda node: node.byPass.enabled and not node.byPass.value,
Expand Down
5 changes: 3 additions & 2 deletions meshroom/nodes/aliceVision/LdrToHdrSampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from collections import Counter

from meshroom.core import desc
from meshroom.core.utils import COLORSPACES


def findMetadata(d, keys, defaultValue):
Expand Down Expand Up @@ -126,8 +127,8 @@ class LdrToHdrSampling(desc.AVCommandLineNode):
label="Working Color Space",
description="Color space in which the data are processed.\n"
"If 'auto' is selected, the working color space will be 'Linear' if RAW images are detected; otherwise, it will be set to 'sRGB'.",
value="auto",
values=["auto", "sRGB", "Linear", "ACES2065-1", "ACEScg", "no_conversion"],
values=COLORSPACES,
value="AUTO",
exclusive=True,
uid=[0],
enabled=lambda node: node.byPass.enabled and not node.byPass.value,
Expand Down
3 changes: 2 additions & 1 deletion meshroom/nodes/aliceVision/PanoramaPostProcessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os

from meshroom.core import desc
from meshroom.core.utils import COLORSPACES


class PanoramaPostProcessing(desc.CommandLineNode):
Expand Down Expand Up @@ -58,8 +59,8 @@ class PanoramaPostProcessing(desc.CommandLineNode):
name="outputColorSpace",
label="Output Color Space",
description="The color space of the output image.",
values=COLORSPACES,
value="Linear",
values=["sRGB", "rec709", "Linear", "ACES2065-1", "ACEScg"],
exclusive=True,
uid=[0],
),
Expand Down
3 changes: 2 additions & 1 deletion meshroom/nodes/aliceVision/PanoramaWarping.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os

from meshroom.core import desc
from meshroom.core.utils import COLORSPACES


class PanoramaWarping(desc.AVCommandLineNode):
Expand Down Expand Up @@ -69,8 +70,8 @@ class PanoramaWarping(desc.AVCommandLineNode):
name="workingColorSpace",
label="Working Color Space",
description="Colorspace in which the panorama warping will be performed.",
values=COLORSPACES,
value="Linear",
values=["Linear", "ACES2065-1", "ACEScg", "no_conversion"],
exclusive=True,
uid=[0],
),
Expand Down
5 changes: 3 additions & 2 deletions meshroom/nodes/aliceVision/Texturing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
__version__ = "6.0"

from meshroom.core import desc, Version
from meshroom.core.utils import COLORSPACES
import logging


Expand Down Expand Up @@ -259,8 +260,8 @@ class Texturing(desc.AVCommandLineNode):
name="workingColorSpace",
label="Working Color Space",
description="Color space for the texturing internal computation (does not impact the output file color space).",
values=COLORSPACES,
value="sRGB",
values=("sRGB", "Linear", "ACES2065-1", "ACEScg"),
exclusive=True,
uid=[0],
advanced=True,
Expand All @@ -269,8 +270,8 @@ class Texturing(desc.AVCommandLineNode):
name="outputColorSpace",
label="Output Color Space",
description="Color space for the output texture files.",
values=COLORSPACES,
value="AUTO",
values=("sRGB", "rec709", "Linear", "ACES2065-1", "ACEScg", "AUTO"),
exclusive=True,
uid=[0],
),
Expand Down

0 comments on commit 092dcfe

Please sign in to comment.