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 
35 #include <X11/Xutil.h>
36 #include <X11/Xcms.h>
37 
38 /*
39  *	DEFINES
40  */
41 
42 #define XDCCC_NUMBER			0x8000000L	/* 2**27 per ICCCM */
43 #define XDCCC_MATRIX_ATOM_NAME		"XDCCC_LINEAR_RGB_MATRICES"
44 #define XDCCC_CORRECT_ATOM_NAME		"XDCCC_LINEAR_RGB_CORRECTION"
45 #define	READABLE_SD_SUFFIX		".txt"
46 #define TXT_FORMAT_VERSION		"1.1"
47 
48 #define	DATA_DELIMS			" \t\n"	/* space, tab, newline */
49 
50 #define SC_BEGIN_KEYWORD		"SCREENDATA_BEGIN"
51 #define SC_END_KEYWORD			"SCREENDATA_END"
52 #define COMMENT_KEYWORD			"COMMENT"
53 #define NAME_KEYWORD			"NAME"
54 #define MODEL_KEYWORD			"MODEL"
55 #define PART_NUMBER_KEYWORD		"PART_NUMBER"
56 #define SERIAL_NUMBER_KEYWORD		"SERIAL_NUMBER"
57 #define REVISION_KEYWORD		"REVISION"
58 #define SCREEN_CLASS_KEYWORD		"SCREEN_CLASS"
59 #define COLORIMETRIC_BEGIN_KEYWORD	"COLORIMETRIC_BEGIN"
60 #define COLORIMETRIC_END_KEYWORD	"COLORIMETRIC_END"
61 #define XYZTORGBMAT_BEGIN_KEYWORD	"XYZtoRGB_MATRIX_BEGIN"
62 #define XYZTORGBMAT_END_KEYWORD		"XYZtoRGB_MATRIX_END"
63 #define RGBTOXYZMAT_BEGIN_KEYWORD	"RGBtoXYZ_MATRIX_BEGIN"
64 #define RGBTOXYZMAT_END_KEYWORD		"RGBtoXYZ_MATRIX_END"
65 #define IPROFILE_BEGIN_KEYWORD		"INTENSITY_PROFILE_BEGIN"
66 #define IPROFILE_END_KEYWORD		"INTENSITY_PROFILE_END"
67 #define ITBL_BEGIN_KEYWORD		"INTENSITY_TBL_BEGIN"
68 #define ITBL_END_KEYWORD		"INTENSITY_TBL_END"
69 
70 #define WHITEPT_XYZ_BEGIN_KEYWORD	"WHITEPT_XYZ_BEGIN"
71 #define WHITEPT_XYZ_END_KEYWORD		"WHITEPT_XYZ_END"
72 
73 #define VIDEO_RGB_KEYWORD		"VIDEO_RGB"
74 #ifdef GRAY
75 #define VIDEO_GRAY_KEYWORD		"VIDEO_GRAY"
76 #endif
77 
78 #define DATA				-1
79 #define SC_BEGIN			1
80 #define SC_END				2
81 #define COMMENT				3
82 #define NAME				4
83 #define MODEL				5
84 #define PART_NUMBER			6
85 #define SERIAL_NUMBER			7
86 #define REVISION			8
87 #define SCREEN_CLASS			9
88 #define COLORIMETRIC_BEGIN		10
89 #define COLORIMETRIC_END		11
90 #define XYZTORGBMAT_BEGIN		12
91 #define XYZTORGBMAT_END			13
92 #define RGBTOXYZMAT_BEGIN		14
93 #define RGBTOXYZMAT_END			15
94 #define IPROFILE_BEGIN			16
95 #define IPROFILE_END			17
96 #define ITBL_BEGIN			18
97 #define ITBL_END			19
98 #define WHITEPT_XYZ_BEGIN		20
99 #define WHITEPT_XYZ_END			21
100 
101 #define CORR_TYPE_NONE  -1
102 #define CORR_TYPE_0	0
103 #define CORR_TYPE_1	1
104 
105 #define VIDEO_RGB	0
106 #ifdef GRAY
107 #define VIDEO_GRAY	1
108 #endif
109 
110     /*
111      * Intensity Record (i.e., value / intensity tuple)
112      */
113 typedef struct _IntensityRec {
114     unsigned short value;
115     XcmsFloat intensity;
116 } IntensityRec;
117 
118     /*
119      * Intensity Table
120      */
121 typedef struct _IntensityTbl {
122     IntensityRec *pBase;
123     unsigned int nEntries;
124 } IntensityTbl;
125 
126 typedef struct _XDCCC_Matrix {
127     XcmsFloat XYZtoRGBmatrix[3][3];
128     XcmsFloat RGBtoXYZmatrix[3][3];
129 } XDCCC_Matrix;
130 
131 typedef struct _XDCCC_Correction {
132     XVisualInfo		visual_info;
133     long		visual_info_mask;
134     int			tableType;
135     int			nTables;
136     IntensityTbl*	pRedTbl;
137     IntensityTbl*	pGreenTbl;
138     IntensityTbl*	pBlueTbl;
139     struct _XDCCC_Correction*	next;
140 } XDCCC_Correction;
141 
142 extern int LoadSCCData(Display *pDpy, int screenNumber, const char *filename,
143 		       int targetFormat);
144 
145 #endif /* SCCDFILE_H */
146