Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JimBobSquarePants committed Dec 18, 2024
1 parent f21c0c2 commit f147aad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ private static Vector4 GetTargetPcsWithoutAdjustment(
/// Not required if both spaces need adjustment, since they both have the same understanding of the PCS.
/// Not compatible with PCS adjustment for absolute intent.
/// </summary>
/// <param name="sourcePcs">The source PCS values.</param>
/// <param name="sourceParams">The source profile parameters.</param>
/// <param name="targetParams">The target profile parameters.</param>
/// <param name="pcsConverter">The converter to use for the PCS adjustments.</param>
/// <exception cref="ArgumentOutOfRangeException">Thrown when the source or target PCS is not supported.</exception>
private static Vector4 GetTargetPcsWithPerceptualV2Adjustment(
Vector4 sourcePcs,
ConversionParams sourceParams,
Expand Down Expand Up @@ -294,16 +299,12 @@ private static Vector4 GetTargetPcsWithPerceptualV2Adjustment(
case IccColorSpaceType.CieLab:
CieLab lab = pcsConverter.Convert<CieXyz, CieLab>(in xyz);
targetPcs = lab.ToScaledVector4();
targetPcs = targetParams.Is16BitLutEntry ? LabToLabV2(targetPcs) : targetPcs;
break;
return targetParams.Is16BitLutEntry ? LabToLabV2(targetPcs) : targetPcs;
case IccColorSpaceType.CieXyz:
targetPcs = xyz.ToScaledVector4();
break;
return xyz.ToScaledVector4();
default:
throw new ArgumentOutOfRangeException($"Target PCS {targetParams.PcsType} is not supported");
}

return targetPcs;
}

// as per DemoIccMAX icPerceptual values in IccCmm.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public ColorTrcCalculator(
bool toPcs)
{
this.toPcs = toPcs;
this.curveCalculator = new TrcCalculator(new IccTagDataEntry[] { redTrc, greenTrc, blueTrc }, !toPcs);
this.curveCalculator = new TrcCalculator([redTrc, greenTrc, blueTrc], !toPcs);

Vector3 mr = redMatrixColumn.Data[0];
Vector3 mg = greenMatrixColumn.Data[0];
Expand Down

0 comments on commit f147aad

Please sign in to comment.