/// <summary> Construct a 3 component transform based on an input RestricedICCProfile /// This transform will pass the input throught a floating point lut (LookUpTableFP), /// apply a matrix to the output and finally pass the intermediate buffer through /// a 8-bit lut (LookUpTable8). This operation will be designated (LFP*M*L8) * Data /// The operators (LFP*M*L8) are constructed here. Although the data for /// only one component is returned, the transformation must be done for all /// components, because the matrix application involves a linear combination of /// component input to produce the output. /// </summary> /// <param name="ricc">input profile /// </param> /// <param name="dwMaxValue">clipping value for output. /// </param> /// <param name="dwMaxCols">number of columns to transform /// </param> /// <param name="dwMaxRows">number of rows to transform /// </param> public MatrixBasedTransformTosRGB(RestrictedICCProfile ricc, int[] dwMaxValue, int[] dwShiftValue) { // Assure the proper type profile for this xform. if (ricc.Type != RestrictedICCProfile.kThreeCompInput) { throw new System.ArgumentException("MatrixBasedTransformTosRGB: wrong type ICCProfile supplied"); } int c; // component index. this.dwMaxValue = dwMaxValue; this.dwShiftValue = dwShiftValue; // Create the LUTFP from the input profile. for (c = 0; c < 3; ++c) { fLut[c] = LookUpTableFP.createInstance(ricc.trc[c], dwMaxValue[c] + 1); } // Create the Input linear to PCS matrix matrix = createMatrix(ricc, dwMaxValue); // Create and matrix from the ICC profile. // Create the final LUT32 lut = LookUpTable32LinearSRGBtoSRGB.createInstance(dwMaxValue[0], dwMaxValue[0], ksRGBShadowCutoff, ksRGBShadowSlope, ksRGBScaleAfterExp, ksRGBExponent, ksRGBReduceAfterExp); }
/// <summary> Construct a 3 component transform based on an input RestricedICCProfile /// This transform will pass the input throught a floating point lut (LookUpTableFP), /// apply a matrix to the output and finally pass the intermediate buffer through /// a 8-bit lut (LookUpTable8). This operation will be designated (LFP*M*L8) * Data /// The operators (LFP*M*L8) are constructed here. Although the data for /// only one component is returned, the transformation must be done for all /// components, because the matrix application involves a linear combination of /// component input to produce the output. /// </summary> /// <param name="ricc">input profile /// </param> /// <param name="dwMaxValue">clipping value for output. /// </param> /// <param name="dwMaxCols">number of columns to transform /// </param> /// <param name="dwMaxRows">number of rows to transform /// </param> public MatrixBasedTransformTosRGB(RestrictedICCProfile ricc, int[] dwMaxValue, int[] dwShiftValue) { // Assure the proper type profile for this xform. if (ricc.Type != RestrictedICCProfile.kThreeCompInput) throw new System.ArgumentException("MatrixBasedTransformTosRGB: wrong type ICCProfile supplied"); int c; // component index. this.dwMaxValue = dwMaxValue; this.dwShiftValue = dwShiftValue; // Create the LUTFP from the input profile. for (c = 0; c < 3; ++c) { fLut[c] = LookUpTableFP.createInstance(ricc.trc[c], dwMaxValue[c] + 1); } // Create the Input linear to PCS matrix matrix = createMatrix(ricc, dwMaxValue); // Create and matrix from the ICC profile. // Create the final LUT32 lut = LookUpTable32LinearSRGBtoSRGB.createInstance(dwMaxValue[0], dwMaxValue[0], ksRGBShadowCutoff, ksRGBShadowSlope, ksRGBScaleAfterExp, ksRGBExponent, ksRGBReduceAfterExp); }