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