ampas / idt-calculator

ACES Input Device Transform Calculator Apps
Other
10 stars 3 forks source link

PR: Improve API #63

Closed KelSolaar closed 1 year ago

KelSolaar commented 1 year ago

This PR improves the API:

resources_directory = Path(__file__).parent / "tests" / "resources"

idt_generator = IDTGeneratorProsumerCamera.from_archive(
    resources_directory / "synthetic_001.zip", cleanup=True
)

logger.info("LUT :\n%s", idt_generator.LUT_decoding)
logger.info("M :\n%s", idt_generator.M)
logger.info("White Balance Multipliers :\n%s", idt_generator.RGB_w)
logger.info("k :\n%s", idt_generator.k)

with open(
    resources_directory / "synthetic_001" / "synthetic_001.json"
) as json_file:
    specification = json.load(json_file)

idt_generator = IDTGeneratorProsumerCamera.from_specification(
    specification, resources_directory / "synthetic_001"
)

logger.info("LUT :\n%s", idt_generator.LUT_decoding)
logger.info("M :\n%s", idt_generator.M)
logger.info("White Balance Multipliers :\n%s", idt_generator.RGB_w)
logger.info("k :\n%s", idt_generator.k)