Пример #1
0
def __get_options():
    """ Return lut_to_lut option parser

    Returns:
        .argparse.ArgumentParser.args

    """
    # Define parser
    description = 'Convert a LUT into another format'
    parser = argparse.ArgumentParser(description=description)
    # input lut
    add_inlutfile_option(parser, is_list=True)
    add_outlutfile_option(parser)
    # type, format, ranges,  out bit depth, out cube size
    add_export_lut_options(parser)
    # inverse (1d arg)
    add_inverse_option(parser)
    # Smooth size
    parser.add_argument("-sms",
                        "--smooth-size",
                        help=("Smooth sub-sampling size (1D only). Ex : 17"),
                        default=None,
                        type=int)
    # version
    full_version = debug_helper.get_imported_modules_versions(
        sys.modules, globals())
    add_version_option(parser, description, __version__, full_version)
    # verbose
    add_silent_option(parser)
    # trace
    add_trace_option(parser)
    return parser.parse_args()
Пример #2
0
def __get_options():
    """ Return lut_to_lut option parser

    Returns:
        .argparse.ArgumentParser.args

    """
    # Define parser
    description = 'Convert a LUT into another format'
    parser = argparse.ArgumentParser(description=description)
    # input lut
    add_inlutfile_option(parser, is_list=True)
    add_outlutfile_option(parser)
    # type, format, ranges,  out bit depth, out cube size
    add_export_lut_options(parser)
    # inverse (1d arg)
    add_inverse_option(parser)
    # Smooth size
    parser.add_argument("-sms", "--smooth-size", help=(
        "Smooth sub-sampling size (1D only). Ex : 17"
    ), default=None, type=int)
    # version
    full_version = debug_helper.get_imported_modules_versions(sys.modules,
                                                              globals())
    add_version_option(parser, description, __version__, full_version)
    # verbose
    add_silent_option(parser)
    # trace
    add_trace_option(parser)
    return parser.parse_args()
Пример #3
0
def __get_options():
    """Return curve_to_lut option parser

    Returns:
        .argparse.ArgumentParser.args

    """
    # Define parser
    description = ('Create lut file corresponding to a colorspace or gamma '
                   'gradation')
    parser = argparse.ArgumentParser(description=description)
    # RGB colorspace
    action = parser.add_mutually_exclusive_group(required=True)
    action.add_argument("--colorspace",
                        help=("Input RGB Colorspace."),
                        type=str,
                        choices=sorted(list(COLORSPACES.keys()) +
                                       list(PRIVATE_COLORSPACES.keys())))
    action.add_argument("--gamma",
                        help="Input pure gamma gradation",
                        type=float)
    # direction
    parser.add_argument("-d", "--direction", help=("Direction : "
                                                   "encode or decode."),
                        type=str, choices=[Direction.ENCODE, Direction.DECODE],
                        default=Direction.ENCODE)
    # out lut file, type, format, ranges,  out bit depth, out cube size
    add_outlutfile_option(parser, required=True)
    add_export_lut_options(parser)
    parser.add_argument("--process-input-range", action="store_true",
                        help=("If true, input range will be computed from "
                              " colorspace gradation functions."
                              "(Colorspace only))"))
    # version
    full_version = debug_helper.get_imported_modules_versions(sys.modules,
                                                              globals())
    add_version_option(parser, description, __version__, full_version)
    # verbose
    add_silent_option(parser)
    # trace
    add_trace_option(parser)
    return parser.parse_args()
Пример #4
0
def __get_options():
    """Return curve_to_lut option parser

    Returns:
        .argparse.ArgumentParser.args

    """
    # Define parser
    description = ('Create lut file corresponding to a colorspace or gamma '
                   'gradation')
    parser = argparse.ArgumentParser(description=description)
    # RGB colorspace
    action = parser.add_mutually_exclusive_group(required=True)
    action.add_argument("--colorspace",
                        help=("Input RGB Colorspace."),
                        type=str,
                        choices=sorted(COLORSPACES.keys() +
                                       PRIVATE_COLORSPACES.keys()))
    action.add_argument("--gamma",
                        help="Input pure gamma gradation",
                        type=float)
    # direction
    parser.add_argument("-d", "--direction", help=("Direction : "
                                                   "encode or decode."),
                        type=str, choices=[Direction.ENCODE, Direction.DECODE],
                        default=Direction.ENCODE)
    # out lut file, type, format, ranges,  out bit depth, out cube size
    add_outlutfile_option(parser, required=True)
    add_export_lut_options(parser)
    parser.add_argument("--process-input-range", action="store_true",
                        help=("If true, input range will be computed from "
                              " colorspace gradation functions."
                              "(Colorspace only))"))
    # version
    full_version = debug_helper.get_imported_modules_versions(sys.modules,
                                                              globals())
    add_version_option(parser, description, __version__, full_version)
    # verbose
    add_silent_option(parser)
    # trace
    add_trace_option(parser)
    return parser.parse_args()