Hi, > I am not sure how you ask lcms to create a Version 4 profile as opposed to a > Version 2
Sorry to say, but currently, lcms only supports reading of v4 profiles. There are, however, some reserved entries for v4 tags, since I intend to provide writing support in next revisions. But still, v4 is a moving target and I am waiting the ICC spec to stabilize enough to figure out which tags are worth to implement. Multilocalized unicode is right now read only, as well as parametric curves. The header is same in both versions. ProfileID is supported across cmsTakeProfileID() and cmsSetProfileID() and you can set version number using cmsSetProfileICCversion() Regarding v2, there are some samples on how to build profiles in the "samples" directory. Take a look on itufax.c, mkgrayer.c, mktiff8.c or mkcmy.c Basically, your code is correct, except you are putting anything in the LUT. The correct sequence would be: Lut = cmsAllocLUT(); cmsAlloc3DGrid(Lut, GRID_POINTS, 3, 4); cmsAllocLinearTable(... <= This one for setting input/output tables cmsSample3DGrid(... <= This one for filling the grid See the tutorial, part "13. LUT handling" for more details. Regards, Marti Maria The little cms project http://www.littlecms.com [EMAIL PROTECTED] ----- Original Message ----- From: Mike Wilsher To: [EMAIL PROTECTED] Sent: Saturday, August 14, 2004 10:38 AM Subject: Tips on using lcms Hi I am looking at using your excellent little cms to create ICC profiles: I am not sure how you ask lcms to create a Version 4 profile as opposed to a Version 2, as the header version, description and lut tags are different but I could not spot how you tell little cms how to write V4. The header looks like it is defaulted to version 2 and I can't find V4 format description tag. So does lcms support writing V4 profiles, if so how do you do this, or is it just some support for the lut tags. I also wondered if you had any skeleton code which listed the sort of calls you would use to create a basic profile and fill it out. I was guessing something like the skeleton listed below, it seems to work !! I am fairly conversant with the ICC profile format so I don't need to know what to put in just a few pointers to a typical way of doing things. Lastly I did not spot how you set up the input and output lookup tables in _lcms_LUT_struc, you can set number of channels and entry points unless LPWORD L1[MAXCHANNELS]; LPWORD L2[MAXCHANNELS]; are simply pointers to the input and output tables ?? Any pointers would really help Many Thanks Mike Wilsher #include "lcms.h" #include <stdarg.h> int main(int argc, char *argv[]) { cmsHPROFILE hProfile; LPLUT Lut; DWORD Flags = 0; // Create Blank Output Profile hProfile = _cmsCreateProfilePlaceholder(); if (!hProfile) // can't allocate return NULL; cmsSetDeviceClass(hProfile,icSigInputClass); cmsSetColorSpace(hProfile, icSigRgbData); cmsSetPCS(hProfile, icSigLabData); cmsSetRenderingIntent(hProfile, INTENT_PERCEPTUAL); cmsSetHeaderFlags(hProfile, Flags); cmsAddTag(hProfile, icSigMediaWhitePointTag, cmsD50_XYZ() ); // An empty LUT for test Lut = cmsAllocLUT(); if (Lut == NULL) return NULL; Lut -> InputChan = 3; Lut -> OutputChan = 4; cmsAddTag(hProfile, icSigAToB0Tag, (LPVOID) Lut); cmsFreeLUT(Lut); cmsAddTag(hProfile, icSigDeviceMfgDescTag, (LPVOID) "lcms internal"); cmsAddTag(hProfile, icSigDeviceModelDescTag, (LPVOID) "lcms built-in"); cmsAddTag(hProfile, icSigProfileDescriptionTag, (LPVOID) "mjw_Description"); cmsAddTag(hProfile, icSigCopyrightTag, (LPVOID) "No copyright, use freely"); // Save resultant profile _cmsSaveProfile(hProfile, "test.icm"); // Tidy up cmsCloseProfile(hProfile); return (1); } ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ Lcms-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/lcms-user
