コード例 #1
0
static
int EmitCIEBasedDEF(cmsIOHANDLER* m, cmsPipeline* Pipeline, int Intent, cmsCIEXYZ* BlackPoint)
{
    const char* PreMaj;
    const char* PostMaj;
    const char* PreMin, *PostMin;
    cmsStage* mpe;

    mpe = Pipeline ->Elements;

    switch (cmsStageInputChannels(mpe)) {
    case 3:

            _cmsIOPrintf(m, "[ /CIEBasedDEF\n");
            PreMaj ="<";
            PostMaj= ">\n";
            PreMin = PostMin = "";
            break;
    case 4:
            _cmsIOPrintf(m, "[ /CIEBasedDEFG\n");
            PreMaj = "[";
            PostMaj = "]\n";
            PreMin = "<";
            PostMin = ">\n";
            break;
    default:
            return 0;

    }

    _cmsIOPrintf(m, "<<\n");

    if (cmsStageType(mpe) == cmsSigCurveSetElemType) {

        _cmsIOPrintf(m, "/DecodeDEF [ ");
        EmitNGamma(m, cmsStageOutputChannels(mpe), _cmsStageGetPtrToCurveSet(mpe));
        _cmsIOPrintf(m, "]\n");

        mpe = mpe ->Next;
    }

    if (cmsStageType(mpe) == cmsSigCLutElemType) {

            _cmsIOPrintf(m, "/Table ");
            WriteCLUT(m, mpe, PreMaj, PostMaj, PreMin, PostMin, FALSE, (cmsColorSpaceSignature) 0);
            _cmsIOPrintf(m, "]\n");
    }

    EmitLab2XYZ(m);
    EmitWhiteBlackD50(m, BlackPoint);
    EmitIntent(m, Intent);

    _cmsIOPrintf(m, "   >>\n");
    _cmsIOPrintf(m, "]\n");

    return 1;
}
コード例 #2
0
ファイル: cmsps2.c プロジェクト: LuaDist/lcms2
static
int EmitCIEBasedABC(cmsIOHANDLER* m, cmsFloat64Number* Matrix, cmsToneCurve** CurveSet, cmsCIEXYZ* BlackPoint)
{
	int i;
	
	_cmsIOPrintf(m, "[ /CIEBasedABC\n");
	_cmsIOPrintf(m, "<<\n");
	_cmsIOPrintf(m, "/DecodeABC [ ");

	EmitNGamma(m, 3, CurveSet);

	_cmsIOPrintf(m, "]\n");

	_cmsIOPrintf(m, "/MatrixABC [ " );

	for( i=0; i < 3; i++ ) {

		_cmsIOPrintf(m, "%.6f %.6f %.6f ", Matrix[0 + 3*i],
			                         Matrix[1 + 3*i],
									 Matrix[2 + 3*i]);		
	}


	_cmsIOPrintf(m, "]\n");

	_cmsIOPrintf(m, "/RangeLMN [ 0.0 0.9642 0.0 1.0000 0.0 0.8249 ]\n");

	EmitWhiteBlackD50(m, BlackPoint);
	EmitIntent(m, INTENT_PERCEPTUAL);

	_cmsIOPrintf(m, ">>\n");
	_cmsIOPrintf(m, "]\n");


	return 1;
}