mirror of
https://github.com/iluvcapra/pycmx.git
synced 2025-12-31 00:40:57 +00:00
Added raw ASC_SOP line method
This commit is contained in:
@@ -177,6 +177,16 @@ class Edit:
|
||||
|
||||
return self._asc_sop_statement.cdl_sop
|
||||
|
||||
@property
|
||||
def asc_sop_raw(self) -> Optional[str]:
|
||||
"""
|
||||
ASC CDL Slope-Offset-Power statement raw line
|
||||
"""
|
||||
if self._asc_sop_statement is None:
|
||||
return None
|
||||
|
||||
return self._asc_sop_statement.line
|
||||
|
||||
@property
|
||||
def asc_sat(self) -> Optional[float]:
|
||||
"""
|
||||
|
||||
@@ -121,15 +121,19 @@ def _parse_remark(line, line_number) -> object:
|
||||
|
||||
else:
|
||||
try:
|
||||
return StmtCdlSop(cdl_sop=AscSopComponents(
|
||||
slope=Rgb(red=float(v[0][0]), green=float(v[0][1]),
|
||||
blue=float(v[0][2])),
|
||||
offset=Rgb(red=float(v[1][0]), green=float(v[1][1]),
|
||||
blue=float(v[1][2])),
|
||||
power=Rgb(red=float(v[2][0]), green=float(v[2][1]),
|
||||
blue=float(v[2][2]))
|
||||
),
|
||||
line_number=line_number)
|
||||
return StmtCdlSop(line=line,
|
||||
cdl_sop=AscSopComponents(
|
||||
slope=Rgb(red=float(v[0][0]),
|
||||
green=float(v[0][1]),
|
||||
blue=float(v[0][2])),
|
||||
offset=Rgb(red=float(v[1][0]),
|
||||
green=float(v[1][1]),
|
||||
blue=float(v[1][2])),
|
||||
power=Rgb(red=float(v[2][0]),
|
||||
green=float(v[2][1]),
|
||||
blue=float(v[2][2]))
|
||||
),
|
||||
line_number=line_number)
|
||||
|
||||
except ValueError as e:
|
||||
return StmtCorruptRemark('ASC_SOP', e, line_number)
|
||||
|
||||
@@ -50,6 +50,7 @@ class StmtSourceFile(NamedTuple):
|
||||
|
||||
|
||||
class StmtCdlSop(NamedTuple):
|
||||
line: str
|
||||
cdl_sop: AscSopComponents[float]
|
||||
line_number: int
|
||||
|
||||
|
||||
Reference in New Issue
Block a user