3 // Copyright (C) 1998-2000 Marti Maria
5 // THIS SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
6 // EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
7 // WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
9 // IN NO EVENT SHALL MARTI MARIA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
10 // INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
11 // OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
12 // WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
13 // LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
17 // This library is free software; you can redistribute it and/or
18 // modify it under the terms of the GNU Lesser General Public
19 // License as published by the Free Software Foundation; either
20 // version 2 of the License, or (at your option) any later version.
22 // This library is distributed in the hope that it will be useful,
23 // but WITHOUT ANY WARRANTY; without even the implied warranty of
24 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 // Lesser General Public License for more details.
27 // You should have received a copy of the GNU Lesser General Public
28 // License along with this library; if not, write to the Free Software
29 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 // Example: how to show white points of profiles
39 void ShowWhitePoint(LPcmsCIEXYZ WtPt
)
47 _cmsIdentifyWhitePoint(Buffer
, WtPt
);
48 printf("%s\n", Buffer
);
50 cmsXYZ2Lab(NULL
, &Lab
, WtPt
);
51 cmsLab2LCh(&LCh
, &Lab
);
52 cmsXYZ2xyY(&xyY
, WtPt
);
54 printf("XYZ=(%3.1f, %3.1f, %3.1f)\n", WtPt
->X
, WtPt
->Y
, WtPt
->Z
);
55 printf("Lab=(%3.3f, %3.3f, %3.3f)\n", Lab
.L
, Lab
.a
, Lab
.b
);
56 printf("(x,y)=(%3.3f, %3.3f)\n", xyY
.x
, xyY
.y
);
57 printf("Hue=%3.2f, Chroma=%3.2f\n", LCh
.h
, LCh
.C
);
63 int main (int argc
, char *argv
[])
65 printf("Show media white of profiles, identifying black body locus. v2\n\n");
70 cmsHPROFILE hProfile
= cmsOpenProfileFromFile(argv
[1], "r");
72 printf("%s\n", cmsTakeProductName(hProfile
));
73 cmsTakeMediaWhitePoint(&WtPt
, hProfile
);
74 ShowWhitePoint(&WtPt
);
75 cmsCloseProfile(hProfile
);
81 printf("usage:\n\nIf no parameters are given, then this program will\n");
82 printf("ask for XYZ value of media white. If parameter given, it must be\n");
83 printf("the profile to inspect.\n\n");
85 printf("X? "); scanf("%lf", &xyz
.X
);
86 printf("Y? "); scanf("%lf", &xyz
.Y
);
87 printf("Z? "); scanf("%lf", &xyz
.Z
);