Your transform specifies the data types for input and output.
Specifically, the 2nd and 4th arguments of the cmsCreateTransform call
set the size and sequence of the input and output data respectively.
Then when the transform is executed, it processes the data per that size
and sequence.

For example, the following would set up to transform an image set up as
a sequence of 8 bit RGBA pixels...

cmsCreateTransform(InputProfile, TYPE_RGBA_8, OutputProfile,
TYPE_RGBA_8, Intent, Options);

Once a particular transform is created, its use in a cmsDoTransform call
will cause the processing of the data at the specified pointers in the
manner specified in the cmsCreateTransform call, for as many pixels as
you specify.

-Noel

-----Original Message-----
From: Roger Breton [mailto:gr...@videotron.ca]
Sent: Thu, June 23, 2016 7:44 PM
To: lcms-user@lists.sourceforge.net
Subject: [Lcms-user] Double or byte

I would like to start converting Bitmap images.

So far, with Marti's help, I have been perfectly content with converting
single pixel values, from RGB to RGB, from RGB to Lab and so on.
But converting entire images is a different kind of challenge.

The example on Page 10 of LittleCMS2.6 tutorial does not specify the
consequence of passing different data types to the library.
It only list the function call with its parameters :

> cmsDoTransform(hTransform, YourInputBuffer, YourOutputBuffer,
YourBuffersSizeInPixels);

So far, Input and Output buffers in my function call were arrays of
double :

double[] input = { 0, 0, 0, 0 };
double[] output = { 0, 0, 0, 0 };

This is my function call :

> cmsDoTransform(xform, input, output, 1);

But now, my Input and Output buffers can no longer be declared this way?

In C#, I use :

IntPtr InputBufferPointer = ImageData.Scan0; <---- The 'Scan0' property
comes from the Bitmap data object and indicates the address of the first
scanline

So my new cmsDoTransform call looks like this :

> cmsDoTransform(xform, InputBufferPointer, OutputBufferPointer,
NumberOfPixelsPerScanLine);

The only question I have is what happens to the type of data passed to
cmsDoTransform?

The Bitmap data is copied into an array of BYTES :

     byte[] imagePixelsValues = new byte[bytes];

     // Copy the RGB values into the array
     Marshal.Copy(InputBufferPointer, imagePixelsValues, 0, bytes);

Does the compiler know to automatically cast the byte values to doubles?
Or is that done by LittleCMS?

I am confused...

/ Roger Breton


------------------------------------------------------------------------
------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user



------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to