Hi,

>...
>Although I've found that cmsSetUserFormatters is just prepared for this
>purpose, it seems there're no variable that can be used within the
>user program.

There is a way to do that. Note that cmsSetUserFormatters does have two 
additional parameters:

cmsSetUserFormatters(cmsHTRANSFORM hTransform, DWORD dwInput,  cmsFORMATTER Input,
                                                               DWORD dwOutput, 
cmsFORMATTER Output)

Then, dwInput and dwOutput are stored as "user cargo" into InputFormat and 
OutputFormat members
of LPcmsTRANSFORM struct. Since they are unsigned 32 bits values, you can use them to 
keep
pointers to your struct.

Example

typedef struct {
                      ... your data
                    } MY_INFO;

MY_INFO MyCargo;

cmsSetUserFormatters(hTransform, (DWORD) &MyCargo, MyUnroll,...

And then

LPBYTE MyUnroll(
    register _LPcmsTRANSFORM info,
    register WORD wIn[],
    register LPBYTE accum)
  {
    MY_INFO *myinfo = (MY_INFO*) info -> InputFormat;
    ...
  
I'm using it in such way in some of my programs.

Hope this helps
Marti Maria
The little cms project
http://www.littlecms.com
[EMAIL PROTECTED]


----- Original Message ----- 
From: "Takashi Kawasaki" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 14, 2004 11:32 AM
Subject: [Lcms-user] Any user defined parameter for cmsHTRANSFORM ?


Hi Marti,

I'm currently create a program that converts the colorspace and layouts
of Grayscale, RGB, CMYK images.
Since some information (not color channels) is added to the trail of
the normal channels, the number of channels (both normal and extra)
are not fixed.
Although I've found that cmsSetUserFormatters is just prepared for this
purpose, it seems there're no variable that can be used within the
user program. For example:

  LPBYTE MyUnroll(
    register _LPcmsTRANSFORM info,
    register WORD wIn[],
    register LPBYTE accum)
  {
    MY_INFO *info = ...; // how to get my parameters?
    for(size_t i = 0; i < info->channels; i++)
    {
      wIn[i] = info->convert2Word(accum);
      accum += info->bytesPerUnit;
    }
    accum += info->bytesToSkip;
    return accum;
  }

For my purpose, I added a void * member variable to _cmstransform_struct
and it's enough for me, but someone may want to do something like it.
I'm happy if you plan to add a void * member to cmsHTRANSFORM.

Regards,

----------------------------------------------
Takashi Kawasaki <[EMAIL PROTECTED]>
CELARTEM TECHNOLOGY INC.
 



-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Lcms-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/lcms-user



-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Lcms-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to