|
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); } |
