File indexing completed on 2025-01-18 10:14:32
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #ifndef _X11_XCMS_H_
0030 #define _X11_XCMS_H_
0031
0032 #include <X11/Xlib.h>
0033
0034
0035
0036
0037 #ifdef __clang__
0038 #pragma clang diagnostic push
0039 #pragma clang diagnostic ignored "-Wpadded"
0040 #endif
0041
0042
0043
0044
0045 #define XcmsFailure 0
0046 #define XcmsSuccess 1
0047 #define XcmsSuccessWithCompression 2
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061 #define XcmsUndefinedFormat (XcmsColorFormat)0x00000000
0062 #define XcmsCIEXYZFormat (XcmsColorFormat)0x00000001
0063 #define XcmsCIEuvYFormat (XcmsColorFormat)0x00000002
0064 #define XcmsCIExyYFormat (XcmsColorFormat)0x00000003
0065 #define XcmsCIELabFormat (XcmsColorFormat)0x00000004
0066 #define XcmsCIELuvFormat (XcmsColorFormat)0x00000005
0067 #define XcmsTekHVCFormat (XcmsColorFormat)0x00000006
0068 #define XcmsRGBFormat (XcmsColorFormat)0x80000000
0069 #define XcmsRGBiFormat (XcmsColorFormat)0x80000001
0070
0071
0072
0073
0074 #define XcmsInitNone 0x00
0075 #define XcmsInitSuccess 0x01
0076 #define XcmsInitFailure 0xff
0077
0078 #define DisplayOfCCC(ccc) ((ccc)->dpy)
0079 #define ScreenNumberOfCCC(ccc) ((ccc)->screenNumber)
0080 #define VisualOfCCC(ccc) ((ccc)->visual)
0081 #define ClientWhitePointOfCCC(ccc) (&(ccc)->clientWhitePt)
0082 #define ScreenWhitePointOfCCC(ccc) (&(ccc)->pPerScrnInfo->screenWhitePt)
0083 #define FunctionSetOfCCC(ccc) ((ccc)->pPerScrnInfo->functionSet)
0084
0085 typedef unsigned long XcmsColorFormat;
0086
0087 typedef double XcmsFloat;
0088
0089
0090
0091
0092 typedef struct {
0093 unsigned short red;
0094 unsigned short green;
0095 unsigned short blue;
0096 } XcmsRGB;
0097
0098
0099
0100
0101 typedef struct {
0102 XcmsFloat red;
0103 XcmsFloat green;
0104 XcmsFloat blue;
0105 } XcmsRGBi;
0106
0107
0108
0109
0110 typedef struct {
0111 XcmsFloat X;
0112 XcmsFloat Y;
0113 XcmsFloat Z;
0114 } XcmsCIEXYZ;
0115
0116
0117
0118
0119 typedef struct {
0120 XcmsFloat u_prime;
0121 XcmsFloat v_prime;
0122 XcmsFloat Y;
0123 } XcmsCIEuvY;
0124
0125
0126
0127
0128 typedef struct {
0129 XcmsFloat x;
0130 XcmsFloat y;
0131 XcmsFloat Y;
0132 } XcmsCIExyY;
0133
0134
0135
0136
0137 typedef struct {
0138 XcmsFloat L_star;
0139 XcmsFloat a_star;
0140 XcmsFloat b_star;
0141 } XcmsCIELab;
0142
0143
0144
0145
0146 typedef struct {
0147 XcmsFloat L_star;
0148 XcmsFloat u_star;
0149 XcmsFloat v_star;
0150 } XcmsCIELuv;
0151
0152
0153
0154
0155 typedef struct {
0156 XcmsFloat H;
0157 XcmsFloat V;
0158 XcmsFloat C;
0159 } XcmsTekHVC;
0160
0161
0162
0163
0164 typedef struct {
0165 XcmsFloat pad0;
0166 XcmsFloat pad1;
0167 XcmsFloat pad2;
0168 XcmsFloat pad3;
0169 } XcmsPad;
0170
0171
0172
0173
0174
0175 typedef struct {
0176 union {
0177 XcmsRGB RGB;
0178 XcmsRGBi RGBi;
0179 XcmsCIEXYZ CIEXYZ;
0180 XcmsCIEuvY CIEuvY;
0181 XcmsCIExyY CIExyY;
0182 XcmsCIELab CIELab;
0183 XcmsCIELuv CIELuv;
0184 XcmsTekHVC TekHVC;
0185 XcmsPad Pad;
0186 } spec;
0187 unsigned long pixel;
0188 XcmsColorFormat format;
0189 } XcmsColor;
0190
0191
0192
0193
0194
0195
0196 typedef struct _XcmsPerScrnInfo {
0197 XcmsColor screenWhitePt;
0198 XPointer functionSet;
0199
0200 XPointer screenData;
0201
0202 unsigned char state;
0203 char pad[3];
0204 } XcmsPerScrnInfo;
0205
0206 typedef struct _XcmsCCC *XcmsCCC;
0207
0208 typedef Status (*XcmsCompressionProc)(
0209 XcmsCCC ,
0210 XcmsColor* ,
0211 unsigned int ,
0212 unsigned int ,
0213 Bool*
0214 );
0215
0216 typedef Status (*XcmsWhiteAdjustProc)(
0217 XcmsCCC ,
0218 XcmsColor* ,
0219 XcmsColor* ,
0220 XcmsColorFormat ,
0221 XcmsColor* ,
0222 unsigned int ,
0223 Bool*
0224 );
0225
0226
0227
0228
0229 typedef struct _XcmsCCC {
0230 Display *dpy;
0231 int screenNumber;
0232 Visual *visual;
0233 XcmsColor clientWhitePt;
0234 XcmsCompressionProc gamutCompProc;
0235 XPointer gamutCompClientData;
0236 XcmsWhiteAdjustProc whitePtAdjProc;
0237 XPointer whitePtAdjClientData;
0238 XcmsPerScrnInfo *pPerScrnInfo;
0239
0240
0241 } XcmsCCCRec;
0242
0243 typedef Status (*XcmsScreenInitProc)(
0244 Display* ,
0245 int ,
0246 XcmsPerScrnInfo*
0247 );
0248
0249 typedef void (*XcmsScreenFreeProc)(
0250 XPointer
0251 );
0252
0253
0254
0255
0256
0257
0258
0259
0260
0261
0262
0263
0264
0265
0266
0267
0268
0269
0270
0271
0272 typedef Status (*XcmsDDConversionProc)(
0273 XcmsCCC ,
0274 XcmsColor* ,
0275 unsigned int ,
0276 Bool*
0277 );
0278
0279 typedef Status (*XcmsDIConversionProc)(
0280 XcmsCCC ,
0281 XcmsColor* ,
0282 XcmsColor* ,
0283 unsigned int
0284 );
0285
0286 typedef XcmsDIConversionProc XcmsConversionProc;
0287 typedef XcmsConversionProc *XcmsFuncListPtr;
0288
0289 typedef int (*XcmsParseStringProc)(
0290 char* ,
0291 XcmsColor*
0292 );
0293
0294
0295
0296
0297
0298 typedef struct _XcmsColorSpace {
0299 const char *prefix;
0300 XcmsColorFormat id;
0301 XcmsParseStringProc parseString;
0302
0303 XcmsFuncListPtr to_CIEXYZ;
0304
0305
0306
0307
0308
0309 XcmsFuncListPtr from_CIEXYZ;
0310
0311
0312
0313
0314
0315 int inverse_flag;
0316
0317
0318
0319
0320
0321
0322 } XcmsColorSpace;
0323
0324
0325
0326
0327
0328 typedef struct _XcmsFunctionSet {
0329 XcmsColorSpace **DDColorSpaces;
0330
0331
0332
0333 XcmsScreenInitProc screenInitProc;
0334
0335
0336
0337
0338 XcmsScreenFreeProc screenFreeProc;
0339
0340
0341 } XcmsFunctionSet;
0342
0343 _XFUNCPROTOBEGIN
0344
0345 extern Status XcmsAddColorSpace (
0346 XcmsColorSpace*
0347 );
0348
0349 extern Status XcmsAddFunctionSet (
0350 XcmsFunctionSet*
0351 );
0352
0353 extern Status XcmsAllocColor (
0354 Display* ,
0355 Colormap ,
0356 XcmsColor* ,
0357 XcmsColorFormat
0358 );
0359
0360 extern Status XcmsAllocNamedColor (
0361 Display* ,
0362 Colormap ,
0363 _Xconst char* ,
0364 XcmsColor* ,
0365 XcmsColor* ,
0366 XcmsColorFormat
0367 );
0368
0369 extern XcmsCCC XcmsCCCOfColormap (
0370 Display* ,
0371 Colormap
0372 );
0373
0374 extern Status XcmsCIELabClipab(
0375 XcmsCCC ,
0376 XcmsColor* ,
0377 unsigned int ,
0378 unsigned int ,
0379 Bool*
0380 );
0381
0382 extern Status XcmsCIELabClipL(
0383 XcmsCCC ,
0384 XcmsColor* ,
0385 unsigned int ,
0386 unsigned int ,
0387 Bool*
0388 );
0389
0390 extern Status XcmsCIELabClipLab(
0391 XcmsCCC ,
0392 XcmsColor* ,
0393 unsigned int ,
0394 unsigned int ,
0395 Bool*
0396 );
0397
0398 extern Status XcmsCIELabQueryMaxC (
0399 XcmsCCC ,
0400 XcmsFloat ,
0401 XcmsFloat ,
0402 XcmsColor*
0403 );
0404
0405 extern Status XcmsCIELabQueryMaxL (
0406 XcmsCCC ,
0407 XcmsFloat ,
0408 XcmsFloat ,
0409 XcmsColor*
0410 );
0411
0412 extern Status XcmsCIELabQueryMaxLC (
0413 XcmsCCC ,
0414 XcmsFloat ,
0415 XcmsColor*
0416 );
0417
0418 extern Status XcmsCIELabQueryMinL (
0419 XcmsCCC ,
0420 XcmsFloat ,
0421 XcmsFloat ,
0422 XcmsColor*
0423 );
0424
0425 extern Status XcmsCIELabToCIEXYZ (
0426 XcmsCCC ,
0427 XcmsColor* ,
0428 XcmsColor* ,
0429 unsigned int
0430 );
0431
0432 extern Status XcmsCIELabWhiteShiftColors(
0433 XcmsCCC ,
0434 XcmsColor* ,
0435 XcmsColor* ,
0436 XcmsColorFormat ,
0437 XcmsColor* ,
0438 unsigned int ,
0439 Bool*
0440 );
0441
0442 extern Status XcmsCIELuvClipL(
0443 XcmsCCC ,
0444 XcmsColor* ,
0445 unsigned int ,
0446 unsigned int ,
0447 Bool*
0448 );
0449
0450 extern Status XcmsCIELuvClipLuv(
0451 XcmsCCC ,
0452 XcmsColor* ,
0453 unsigned int ,
0454 unsigned int ,
0455 Bool*
0456 );
0457
0458 extern Status XcmsCIELuvClipuv(
0459 XcmsCCC ,
0460 XcmsColor* ,
0461 unsigned int ,
0462 unsigned int ,
0463 Bool*
0464 );
0465
0466 extern Status XcmsCIELuvQueryMaxC (
0467 XcmsCCC ,
0468 XcmsFloat ,
0469 XcmsFloat ,
0470 XcmsColor*
0471 );
0472
0473 extern Status XcmsCIELuvQueryMaxL (
0474 XcmsCCC ,
0475 XcmsFloat ,
0476 XcmsFloat ,
0477 XcmsColor*
0478 );
0479
0480 extern Status XcmsCIELuvQueryMaxLC (
0481 XcmsCCC ,
0482 XcmsFloat ,
0483 XcmsColor*
0484 );
0485
0486 extern Status XcmsCIELuvQueryMinL (
0487 XcmsCCC ,
0488 XcmsFloat ,
0489 XcmsFloat ,
0490 XcmsColor*
0491 );
0492
0493 extern Status XcmsCIELuvToCIEuvY (
0494 XcmsCCC ,
0495 XcmsColor* ,
0496 XcmsColor* ,
0497 unsigned int
0498 );
0499
0500 extern Status XcmsCIELuvWhiteShiftColors(
0501 XcmsCCC ,
0502 XcmsColor* ,
0503 XcmsColor* ,
0504 XcmsColorFormat ,
0505 XcmsColor* ,
0506 unsigned int ,
0507 Bool*
0508 );
0509
0510 extern Status XcmsCIEXYZToCIELab (
0511 XcmsCCC ,
0512 XcmsColor* ,
0513 XcmsColor* ,
0514 unsigned int
0515 );
0516
0517 extern Status XcmsCIEXYZToCIEuvY (
0518 XcmsCCC ,
0519 XcmsColor* ,
0520 XcmsColor* ,
0521 unsigned int
0522 );
0523
0524 extern Status XcmsCIEXYZToCIExyY (
0525 XcmsCCC ,
0526 XcmsColor* ,
0527 XcmsColor* ,
0528 unsigned int
0529 );
0530
0531 extern Status XcmsCIEXYZToRGBi (
0532 XcmsCCC ,
0533 XcmsColor* ,
0534 unsigned int ,
0535 Bool*
0536 );
0537
0538 extern Status XcmsCIEuvYToCIELuv (
0539 XcmsCCC ,
0540 XcmsColor* ,
0541 XcmsColor* ,
0542 unsigned int
0543 );
0544
0545 extern Status XcmsCIEuvYToCIEXYZ (
0546 XcmsCCC ,
0547 XcmsColor* ,
0548 XcmsColor* ,
0549 unsigned int
0550 );
0551
0552 extern Status XcmsCIEuvYToTekHVC (
0553 XcmsCCC ,
0554 XcmsColor* ,
0555 XcmsColor* ,
0556 unsigned int
0557 );
0558
0559 extern Status XcmsCIExyYToCIEXYZ (
0560 XcmsCCC ,
0561 XcmsColor* ,
0562 XcmsColor* ,
0563 unsigned int
0564 );
0565
0566 extern XcmsColor *XcmsClientWhitePointOfCCC (
0567 XcmsCCC
0568 );
0569
0570 extern Status XcmsConvertColors (
0571 XcmsCCC ,
0572 XcmsColor* ,
0573 unsigned int ,
0574 XcmsColorFormat ,
0575 Bool*
0576 );
0577
0578 extern XcmsCCC XcmsCreateCCC (
0579 Display* ,
0580 int ,
0581 Visual* ,
0582 XcmsColor* ,
0583 XcmsCompressionProc ,
0584 XPointer ,
0585 XcmsWhiteAdjustProc ,
0586 XPointer
0587 );
0588
0589 extern XcmsCCC XcmsDefaultCCC (
0590 Display* ,
0591 int
0592 );
0593
0594 extern Display *XcmsDisplayOfCCC (
0595 XcmsCCC
0596 );
0597
0598 extern XcmsColorFormat XcmsFormatOfPrefix (
0599 char*
0600 );
0601
0602 extern void XcmsFreeCCC (
0603 XcmsCCC
0604 );
0605
0606 extern Status XcmsLookupColor (
0607 Display* ,
0608 Colormap ,
0609 _Xconst char* ,
0610 XcmsColor* ,
0611 XcmsColor* ,
0612 XcmsColorFormat
0613 );
0614
0615 extern char *XcmsPrefixOfFormat (
0616 XcmsColorFormat
0617 );
0618
0619 extern Status XcmsQueryBlack (
0620 XcmsCCC ,
0621 XcmsColorFormat ,
0622 XcmsColor*
0623 );
0624
0625 extern Status XcmsQueryBlue (
0626 XcmsCCC ,
0627 XcmsColorFormat ,
0628 XcmsColor*
0629 );
0630
0631 extern Status XcmsQueryColor (
0632 Display* ,
0633 Colormap ,
0634 XcmsColor* ,
0635 XcmsColorFormat
0636 );
0637
0638 extern Status XcmsQueryColors (
0639 Display* ,
0640 Colormap ,
0641 XcmsColor* ,
0642 unsigned int ,
0643 XcmsColorFormat
0644 );
0645
0646 extern Status XcmsQueryGreen (
0647 XcmsCCC ,
0648 XcmsColorFormat ,
0649 XcmsColor*
0650 );
0651
0652 extern Status XcmsQueryRed (
0653 XcmsCCC ,
0654 XcmsColorFormat ,
0655 XcmsColor*
0656 );
0657
0658 extern Status XcmsQueryWhite (
0659 XcmsCCC ,
0660 XcmsColorFormat ,
0661 XcmsColor*
0662 );
0663
0664 extern Status XcmsRGBiToCIEXYZ (
0665 XcmsCCC ,
0666 XcmsColor* ,
0667 unsigned int ,
0668 Bool*
0669 );
0670
0671 extern Status XcmsRGBiToRGB (
0672 XcmsCCC ,
0673 XcmsColor* ,
0674 unsigned int ,
0675 Bool*
0676 );
0677
0678 extern Status XcmsRGBToRGBi (
0679 XcmsCCC ,
0680 XcmsColor* ,
0681 unsigned int ,
0682 Bool*
0683 );
0684
0685 extern int XcmsScreenNumberOfCCC (
0686 XcmsCCC
0687 );
0688
0689 extern XcmsColor *XcmsScreenWhitePointOfCCC (
0690 XcmsCCC
0691 );
0692
0693 extern XcmsCCC XcmsSetCCCOfColormap(
0694 Display* ,
0695 Colormap ,
0696 XcmsCCC
0697 );
0698
0699 extern XcmsCompressionProc XcmsSetCompressionProc (
0700 XcmsCCC ,
0701 XcmsCompressionProc ,
0702 XPointer
0703 );
0704
0705 extern XcmsWhiteAdjustProc XcmsSetWhiteAdjustProc (
0706 XcmsCCC ,
0707 XcmsWhiteAdjustProc ,
0708 XPointer
0709 );
0710
0711 extern Status XcmsSetWhitePoint (
0712 XcmsCCC ,
0713 XcmsColor*
0714 );
0715
0716 extern Status XcmsStoreColor (
0717 Display* ,
0718 Colormap ,
0719 XcmsColor*
0720 );
0721
0722 extern Status XcmsStoreColors (
0723 Display* ,
0724 Colormap ,
0725 XcmsColor* ,
0726 unsigned int ,
0727 Bool*
0728 );
0729
0730 extern Status XcmsTekHVCClipC(
0731 XcmsCCC ,
0732 XcmsColor* ,
0733 unsigned int ,
0734 unsigned int ,
0735 Bool*
0736 );
0737
0738 extern Status XcmsTekHVCClipV(
0739 XcmsCCC ,
0740 XcmsColor* ,
0741 unsigned int ,
0742 unsigned int ,
0743 Bool*
0744 );
0745
0746 extern Status XcmsTekHVCClipVC(
0747 XcmsCCC ,
0748 XcmsColor* ,
0749 unsigned int ,
0750 unsigned int ,
0751 Bool*
0752 );
0753
0754 extern Status XcmsTekHVCQueryMaxC (
0755 XcmsCCC ,
0756 XcmsFloat ,
0757 XcmsFloat ,
0758 XcmsColor*
0759 );
0760
0761 extern Status XcmsTekHVCQueryMaxV (
0762 XcmsCCC ,
0763 XcmsFloat ,
0764 XcmsFloat ,
0765 XcmsColor*
0766 );
0767
0768 extern Status XcmsTekHVCQueryMaxVC (
0769 XcmsCCC ,
0770 XcmsFloat ,
0771 XcmsColor*
0772 );
0773
0774 extern Status XcmsTekHVCQueryMaxVSamples (
0775 XcmsCCC ,
0776 XcmsFloat ,
0777 XcmsColor* ,
0778 unsigned int
0779 );
0780
0781 extern Status XcmsTekHVCQueryMinV (
0782 XcmsCCC ,
0783 XcmsFloat ,
0784 XcmsFloat ,
0785 XcmsColor*
0786 );
0787
0788 extern Status XcmsTekHVCToCIEuvY (
0789 XcmsCCC ,
0790 XcmsColor* ,
0791 XcmsColor* ,
0792 unsigned int
0793 );
0794
0795 extern Status XcmsTekHVCWhiteShiftColors(
0796 XcmsCCC ,
0797 XcmsColor* ,
0798 XcmsColor* ,
0799 XcmsColorFormat ,
0800 XcmsColor* ,
0801 unsigned int ,
0802 Bool*
0803 );
0804
0805 extern Visual *XcmsVisualOfCCC (
0806 XcmsCCC
0807 );
0808
0809 #ifdef __clang__
0810 #pragma clang diagnostic pop
0811 #endif
0812
0813 _XFUNCPROTOEND
0814
0815 #endif