Files
WATFAG/src/watfag/parsers/generic/hdr.py

21 lines
807 B
Python

import regex as re
from watfag.parsers.generic import GenericParser
from watfag.parsers.generic.parsers import CheckParser
from watfag.parsers.generic.watfag import DynamicRange
checks = {
re.compile(r"hybrid|do?vi? ?hdr(?:10)?[\+p]?", re.IGNORECASE): DynamicRange.HYBRID,
re.compile(r"do?vi?", re.IGNORECASE): DynamicRange.DV,
re.compile(r"hdr10\+?", re.IGNORECASE): DynamicRange.HDR10P,
re.compile(r"hdr", re.IGNORECASE): DynamicRange.HDR
}
class DynamicRangeParser(CheckParser, GenericParser):
def __init__(self, release):
super().__init__(release)
self.checks = checks
self.remove_checks = [] # No remove checks for HDR
self.attribute_name = "dynamic_range"
self.default = DynamicRange.SDR # Default to SDR if no HDR indicators are found