Quoting Richard Hughes <hughsi...@gmail.com>:

> I've been playing around with this idea all morning. I'm struggling to
> feed cmsSliceSpaceFloat the CLUT points in the required format --
> could you be more specific on how the CLUT should be generated please?
> I'm a little confused why the clut points should be uint32 values.


Please consider this piece of sample code:

static
cmsInt32Number MySampler(register const cmsFloat32Number In[],
                         register cmsFloat32Number Out[],
                         register void * Cargo)
{
        int i;

        for (i=0; i < 3; i++)
                printf("%f ", In[i]);
        printf("\n");

        return 1;
}

static
void TestSlicer(void)
{
   cmsUInt32Number Dimensions[] = { 3, 3, 3 };

    cmsSliceSpaceFloat(3, Dimensions, MySampler, NULL);
}


If you execute TestSlicer, you will see the callback MySlicer is
being called for each node. The RGB space is "sliced" into cubes,
and your callback is called on each cube. Then, if you setup a
color transform, you can do in the callback something like:

static
cmsInt32Number MySampler(register const cmsFloat32Number In[],
                         register cmsFloat32Number Out[],
                         register void * Cargo)
{

   cmsDoTransform(hTransform, In, Node, 1);
   return 1;
}


And store "Node" in the CLUT table. You can choose
whatever organization you wish for the table, probably in a way the
GPU would easely acess data.

Hope this helps
Marti



------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to