Bob Friesenhahn <[EMAIL PROTECTED]> said:
>
> Does LCMS copy and reformat the pixel data into its own allocated
> buffers, or does it read/write the user data "in place" without
> copying to/from buffers in some native representation?
Inplace. There is an small overhead doing that in such way, but the
memory savings are enormous. For example, an unsigned int formatter
for RGB (quick and dirty, just as example):
LPBYTE UnrollUINT(register LPCMMCARGO info, register WORD wIn[], register
LPBYTE accum)
{
unsigned int* pixel = (unsigned int*) accum;
wIn[0] = (WORD) ((double) (0xFFFFL * pixel[0]) / 0xFFFFFFFFL);
wIn[1] = (WORD) ((double) (0xFFFFL * pixel[1]) / 0xFFFFFFFFL);
wIn[2] = (WORD) ((double) (0xFFFFL * pixel[2]) / 0xFFFFFFFFL);
accum += 3*sizeof(unsigned int)
return accum;
}
The function is called by lcms for each single pixel, with "accum"
holding a pointer to the user supplied buffer (that one passed to
cmsDoTransform) and have to decode the current pixel to "wIn" as
16-bit values. Then, should return a pointer to the next pixel in
buffer.
Finally, is just a matter of registering this formatter passing a
pointer to this function as argument to cmmSetUserFormatters
Regards
Marti.
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Lcms-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/lcms-user