Hi All

I have been asked to convert our v1.18 code to V2.6 in a quick a time as 
possible. I have no experience of either v1 or v2 code so could someone please 
point me in the right direction, the LUT code is particularly problematic?

The code I'm having trouble with is below.

    hICC = _cmsCreateProfilePlaceholder();
    if (!hICC)                          // can't allocate
        return NULL;
   cmsSetDeviceClass(hICC, icSigOutputClass);
    cmsSetColorSpace(hICC, ColorSpace);
    cmsSetPCS(hICC, icSigLabData);
    cmsSetRenderingIntent( hICC, intent );

    // Creates a LUT with 3D grid only
    Lut = cmsAllocLUT();

    cmsAlloc3DGrid(Lut, 48, _cmsChannelsOf(icSigLabData),
                            _cmsChannelsOf(ColorSpace));

    if (!cmsSample3DGrid(Lut, ProfileResampler, (LPVOID) this, 0)) {
            // Shouldn't reach here
            cmsFreeLUT(Lut);
            cmsCloseProfile(hICC);
            return NULL;
    }

    // Create tags
    cmsAddTag(hICC, icSigDeviceMfgDescTag,      (LPVOID) "(ixPressia 
internal)");
    cmsAddTag(hICC, icSigProfileDescriptionTag, (LPVOID) "ixPressia extended 
profile");
    cmsAddTag(hICC, icSigDeviceModelDescTag,    (LPVOID) "ixPressia built-in");

    cmsAddTag(hICC, icSigMediaWhitePointTag, (LPVOID) cmsD50_XYZ());

                icTagSignature sig1 = icSigAToB0Tag;
                icTagSignature sig2 = icSigBToA0Tag;
                switch (intent)
                {
                case 0:
                                sig1 = icSigAToB0Tag;
                                sig2 = icSigBToA0Tag;
                                break;
                case 1:  // relative colourimetric
                case 3: // absolute colourimetric - should be same as relative 
not saturated as it was previously
                                sig1 = icSigAToB1Tag;
                                sig2 = icSigBToA1Tag;
                                break;
                case 2: // saturated
                                sig1 = icSigAToB2Tag;
                                sig2 = icSigBToA2Tag;
                                break;
                }

                // PCS->Device LUT
    cmsAddTag(hICC, sig2,    (LPVOID) Lut);

                // Device->PCS LUT
                if (ColorSpace == icSigCmykData)
                {
                                // Use for PRESERVE BLACK only
                                LPLUT cmsLut2 = cmsReadICCLut( input_profile, 
sig1 );
                                cmsAddTag(hICC, sig1, (LPVOID) cmsLut2 );
                }
                else
                {
                                cmsAddTag(hICC, sig1, (LPVOID) Lut );
                }

    // LUT is already on virtual profile
    cmsFreeLUT(Lut);

Thanks in advance

Dave Freer


This message has been scanned for malware by Websense. www.websense.com
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to