Could you tell me how to convert colors from lab to RGB to lab, and how to convert colors and code? Or refer to some books. Thank you.

Source: Internet
Author: User
Could you tell me how to convert the color of lab-> RGB, RGB-> lab, as well as the Code, or any reference books? Thank you for choosing Delphi/Windows SDK/API.
Http://www.delphi2007.net/DelphiMultimedia/html/delphi_2006121620555555.html
How to convert colors from lab to RGB to lab, and Code Or any reference books. Thank you.

See:

Http://delphicikk.atw.hu/listaz.php? Id = 1452 & oldal = 22

thank you!
but an error occurs during compilation.
[Error] ulabrgb. PAS (175): Left side cannot be assigned to
[fatal error] colorconvert. DPR (6): cocould not compile used unit 'ulabrgb. pa'
in the last section
for I: = 1 to 3 DO
for J: = 1 to 3 DO
rgbxyz [I, j]: = ctoxyz [I, j] * C [J];
xyzrgb: = invertmatrix3 (rgbxyz)

I have no problems with the test here.

Uses ulabrgb;

{$ R *. DFM}

Procedure tform1.button1click (Sender: tobject );
VaR
RGB: tvector3;
Lab: tvector3;
Begin
RGB [1]: = 255;
RGB [2]: = 125;
RGB [3]: = 233;
Lab: = rgbtolab (RGB );
Caption: = floattostr (lab [1]) + ':' + floattostr (lab [2]) + ':' + floattostr (lab [3]);
End;

Const
Rgbxyz: tmatrix3 = (1, 0, 0), (0, 1, 0), (0, 0, 1 ));
Xyzrgb: tmatrix3 = (1, 0, 0), (0, 1, 0), (0, 0, 1 ));

....

Procedure inittransformationmatrices;
VaR
I: integer;
J: integer;
Phosphorz: tvector3;
C: tvector3;
Ctoxyz: tmatrix3;
Xyztoc: tmatrix3;
Begin
For I: = 1 to 3 do
Begin
Ctoxyz [1, I]: = phosphorx [I];
Ctoxyz [2, I]: = phosphory [I];
Ctoxyz [3, I]: = 1-phosphorx [I]-phosphory [I]
End;
Xyztoc: = invertmatrix3 (ctoxyz );
C: = multiplymatrix3byvector3 (xyztoc, whitepoint );
For I: = 1 to 3 do
For J: = 1 to 3 do
Rgbxyz [I, j]: = ctoxyz [I, j] * C [J]; // a compilation error occurs.
Xyzrgb: = invertmatrix3 (rgbxyz) // a compilation error occurs.
End;

I have no compilation errors here.

[Error] ulabrgb. PAS (175): Left side cannot be assigned

------------------

This error generally indicates that the read/write attribute of the variable assigned on the left is read-only, but this should not happen here.

Const
Rgbxyz: tmatrix3 = (1, 0, 0), (0, 1, 0), (0, 0, 1 ));
Xyzrgb: tmatrix3 = (1, 0, 0), (0, 1, 0), (0, 0, 1 ));

It is not a const in the true sense, so it is no problem to assign values to them.

I sent it three times, so I had to try my vest again.

False compilation indicator

Unit ulabrgb;

Interface

Type
Tvector3 = array [1 .. 3] of double;

Function labtorgb (LAB: tvector3): tvector3;
Function rgbtolab (RGB: tvector3): tvector3;

Implementation

{$ J +} // note

................

Thanks!

The value after labtorgb is very small. Is it black?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.