SCCDFile.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /* $Xorg: SCCDFile.h,v 1.3 2000/08/17 19:54:13 cpqbld Exp $ */
  2. /*
  3. * (c) Copyright 1990 Tektronix Inc.
  4. * All Rights Reserved
  5. *
  6. * Permission to use, copy, modify, and distribute this software and its
  7. * documentation for any purpose and without fee is hereby granted,
  8. * provided that the above copyright notice appear in all copies and that
  9. * both that copyright notice and this permission notice appear in
  10. * supporting documentation, and that the name of Tektronix not be used
  11. * in advertising or publicity pertaining to distribution of the software
  12. * without specific, written prior permission.
  13. *
  14. * Tektronix disclaims all warranties with regard to this software, including
  15. * all implied warranties of merchantability and fitness, in no event shall
  16. * Tektronix be liable for any special, indirect or consequential damages or
  17. * any damages whatsoever resulting from loss of use, data or profits,
  18. * whether in an action of contract, negligence or other tortious action,
  19. * arising out of or in connection with the use or performance of this
  20. * software.
  21. *
  22. *
  23. * NAME
  24. * SCCDFile.h
  25. *
  26. * DESCRIPTION
  27. * Include file for TekCMS Color Extension when using the
  28. * X Device Color Characterization Convention (XDCCC).
  29. *
  30. */
  31. /* $XFree86: xc/programs/xcmsdb/SCCDFile.h,v 1.3 1999/03/02 11:49:36 dawes Exp $ */
  32. #ifndef SCCDFILE_H
  33. #define SCCDFILE_H
  34. #include <X11/Xutil.h>
  35. #include <X11/Xcms.h>
  36. /*
  37. * DEFINES
  38. */
  39. #define XDCCC_NUMBER 0x8000000L /* 2**27 per ICCCM */
  40. #define XDCCC_MATRIX_ATOM_NAME "XDCCC_LINEAR_RGB_MATRICES"
  41. #define XDCCC_CORRECT_ATOM_NAME "XDCCC_LINEAR_RGB_CORRECTION"
  42. #define READABLE_SD_SUFFIX ".txt"
  43. #define TXT_FORMAT_VERSION "1.1"
  44. #define DATA_DELIMS " \t\n" /* space, tab, newline */
  45. #define SC_BEGIN_KEYWORD "SCREENDATA_BEGIN"
  46. #define SC_END_KEYWORD "SCREENDATA_END"
  47. #define COMMENT_KEYWORD "COMMENT"
  48. #define NAME_KEYWORD "NAME"
  49. #define MODEL_KEYWORD "MODEL"
  50. #define PART_NUMBER_KEYWORD "PART_NUMBER"
  51. #define SERIAL_NUMBER_KEYWORD "SERIAL_NUMBER"
  52. #define REVISION_KEYWORD "REVISION"
  53. #define SCREEN_CLASS_KEYWORD "SCREEN_CLASS"
  54. #define COLORIMETRIC_BEGIN_KEYWORD "COLORIMETRIC_BEGIN"
  55. #define COLORIMETRIC_END_KEYWORD "COLORIMETRIC_END"
  56. #define XYZTORGBMAT_BEGIN_KEYWORD "XYZtoRGB_MATRIX_BEGIN"
  57. #define XYZTORGBMAT_END_KEYWORD "XYZtoRGB_MATRIX_END"
  58. #define RGBTOXYZMAT_BEGIN_KEYWORD "RGBtoXYZ_MATRIX_BEGIN"
  59. #define RGBTOXYZMAT_END_KEYWORD "RGBtoXYZ_MATRIX_END"
  60. #define IPROFILE_BEGIN_KEYWORD "INTENSITY_PROFILE_BEGIN"
  61. #define IPROFILE_END_KEYWORD "INTENSITY_PROFILE_END"
  62. #define ITBL_BEGIN_KEYWORD "INTENSITY_TBL_BEGIN"
  63. #define ITBL_END_KEYWORD "INTENSITY_TBL_END"
  64. #define WHITEPT_XYZ_BEGIN_KEYWORD "WHITEPT_XYZ_BEGIN"
  65. #define WHITEPT_XYZ_END_KEYWORD "WHITEPT_XYZ_END"
  66. #define VIDEO_RGB_KEYWORD "VIDEO_RGB"
  67. #ifdef GRAY
  68. #define VIDEO_GRAY_KEYWORD "VIDEO_GRAY"
  69. #endif
  70. #define DATA -1
  71. #define SC_BEGIN 1
  72. #define SC_END 2
  73. #define COMMENT 3
  74. #define NAME 4
  75. #define MODEL 5
  76. #define PART_NUMBER 6
  77. #define SERIAL_NUMBER 7
  78. #define REVISION 8
  79. #define SCREEN_CLASS 9
  80. #define COLORIMETRIC_BEGIN 10
  81. #define COLORIMETRIC_END 11
  82. #define XYZTORGBMAT_BEGIN 12
  83. #define XYZTORGBMAT_END 13
  84. #define RGBTOXYZMAT_BEGIN 14
  85. #define RGBTOXYZMAT_END 15
  86. #define IPROFILE_BEGIN 16
  87. #define IPROFILE_END 17
  88. #define ITBL_BEGIN 18
  89. #define ITBL_END 19
  90. #define WHITEPT_XYZ_BEGIN 20
  91. #define WHITEPT_XYZ_END 21
  92. #define CORR_TYPE_NONE -1
  93. #define CORR_TYPE_0 0
  94. #define CORR_TYPE_1 1
  95. #define VIDEO_RGB 0
  96. #ifdef GRAY
  97. #define VIDEO_GRAY 1
  98. #endif
  99. /*
  100. * Intensity Record (i.e., value / intensity tuple)
  101. */
  102. typedef struct _IntensityRec {
  103. unsigned short value;
  104. XcmsFloat intensity;
  105. } IntensityRec;
  106. /*
  107. * Intensity Table
  108. */
  109. typedef struct _IntensityTbl {
  110. IntensityRec *pBase;
  111. unsigned int nEntries;
  112. } IntensityTbl;
  113. typedef struct _XDCCC_Matrix {
  114. XcmsFloat XYZtoRGBmatrix[3][3];
  115. XcmsFloat RGBtoXYZmatrix[3][3];
  116. } XDCCC_Matrix;
  117. typedef struct _XDCCC_Correction {
  118. XVisualInfo visual_info;
  119. long visual_info_mask;
  120. int tableType;
  121. int nTables;
  122. IntensityTbl* pRedTbl;
  123. IntensityTbl* pGreenTbl;
  124. IntensityTbl* pBlueTbl;
  125. struct _XDCCC_Correction* next;
  126. } XDCCC_Correction;
  127. extern int LoadSCCData(Display *pDpy, int screenNumber, const char *filename,
  128. int targetFormat);
  129. #endif /* SCCDFILE_H */