aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/extras/ogl-sample/main/doc/man/mangl/standard/pixelmap.gl
blob: 9b3ddca84addcee4df0bd26a464247c78701257c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
_C_ License Applicability. Except to the extent portions of this file are
_C_ made subject to an alternative license as permitted in the SGI Free
_C_ Software License B, Version 1.1 (the "License"), the contents of this
_C_ file are subject only to the provisions of the License. You may not use
_C_ this file except in compliance with the License. You may obtain a copy
_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
_C_ 
_C_ http://oss.sgi.com/projects/FreeB
_C_ 
_C_ Note that, as provided in the License, the Software is distributed on an
_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
_C_ 
_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
_C_ Copyright in any portions created by third parties is as indicated
_C_ elsewhere herein. All Rights Reserved.
_C_ 
_C_ Additional Notice Provisions: The application programming interfaces
_C_ established by SGI in conjunction with the Original Code are The
_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
_C_ published by SGI, but has not been independently verified as being
_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
_C_
_C_ The first character in this file must be an '_'!
_C_ Anything on a line after _C_ is ignored
_define(_filters,tbl|eqn)_C_
_C_      eqn is automatically replaced with neqn for nroff
_header(PixelMap,set up pixel transfer maps)
_names(PixelMap,u*[fis]v)
.EQ
delim $$
.EN
.SH PARAMETERS
_phead(_param1)
.na
Specifies a symbolic map name.
Must be one of the following:
_const(PIXEL_MAP_I_TO_I),
_const(PIXEL_MAP_S_TO_S),
_const(PIXEL_MAP_I_TO_R),
_const(PIXEL_MAP_I_TO_G),
_const(PIXEL_MAP_I_TO_B),
_const(PIXEL_MAP_I_TO_A),
_const(PIXEL_MAP_R_TO_R),
_const(PIXEL_MAP_G_TO_G),
_const(PIXEL_MAP_B_TO_B), or
_const(PIXEL_MAP_A_TO_A).
_phead(_param2)
Specifies the size of the map being defined.
_phead(_param3)
Specifies an array of _param2 values.
.SH DESCRIPTION
_cmnd sets up translation tables,
or \f2maps\fP,
used by
_cmnd(CopyPixels),
_cmnd(CopyTexImage1D),
_cmnd(CopyTexImage2D),
_cmnd(CopyTexSubImage1D),
_cmnd(CopyTexSubImage2D),
_cmnd(CopyTexSubImage3D),
_cmnd(DrawPixels),
_cmnd(ReadPixels),
_cmnd(TexImage1D),
_cmnd(TexImage2D),
_cmnd(TexImage3D),
_cmnd(TexSubImage1D),
_cmnd(TexSubImage2D), and
_cmnd(TexSubImage3D).
Additionally, if the _arbstring(imaging) subset is supported, the
routines
_cmnd(ColorTable),
_cmnd(ColorSubTable),
_cmnd(ConvolutionFilter1D),
_cmnd(ConvolutionFilter2D),
_cmnd(Histogram),
_cmnd(Minmax), and
_cmnd(SeparableFilter2D).
Use of these maps is described completely in the
_cmnd(PixelTransfer) reference page,
and partly in the reference pages for the pixel and texture image commands.
Only the specification of the maps is described in this reference page.
.P
_param1 is a symbolic map name,
indicating one of ten maps to set.
_param2 specifies the number of entries in the map,
and _param3 is a pointer to an array of _param2 map values.
.P
The ten maps are as follows:
.TP 30
_const(PIXEL_MAP_I_TO_I)
Maps color indices to color indices.
.TP
_const(PIXEL_MAP_S_TO_S)
Maps stencil indices to stencil indices.
.TP
_const(PIXEL_MAP_I_TO_R)
Maps color indices to red components.
.TP
_const(PIXEL_MAP_I_TO_G)
Maps color indices to green components.
.TP
_const(PIXEL_MAP_I_TO_B)
Maps color indices to blue components.
.TP
_const(PIXEL_MAP_I_TO_A)
Maps color indices to alpha components.
.TP
_const(PIXEL_MAP_R_TO_R)
Maps red components to red components.
.TP
_const(PIXEL_MAP_G_TO_G)
Maps green components to green components.
.TP
_const(PIXEL_MAP_B_TO_B)
Maps blue components to blue components.
.TP
_const(PIXEL_MAP_A_TO_A)
Maps alpha components to alpha components.
.P
The entries in a map can be specified as single-precision
floating-point numbers,
unsigned short integers,
or unsigned long integers.
Maps that store color component values
(all but _const(PIXEL_MAP_I_TO_I) and _const(PIXEL_MAP_S_TO_S))
retain their values in floating-point format,
with unspecified mantissa and exponent sizes.
Floating-point values specified by _cmnd(PixelMapfv) are converted directly
to the internal floating-point format of these maps,
then clamped to the range [0,1].
Unsigned integer values specified by _cmnd(PixelMapusv) and
_cmnd(PixelMapuiv) are converted linearly such that
the largest representable integer maps to 1.0,
and 0 maps to 0.0.
.P
Maps that store indices,
_const(PIXEL_MAP_I_TO_I) and _const(PIXEL_MAP_S_TO_S),
retain their values in fixed-point format,
with an unspecified number of bits to the right of the binary point.
Floating-point values specified by _cmnd(PixelMapfv) are converted directly
to the internal fixed-point format of these maps.
Unsigned integer values specified by _cmnd(PixelMapusv) and
_cmnd(PixelMapuiv) specify integer values,
with all 0's to the right of the binary point.
.P
The following table shows the initial sizes and values for each of the maps.
Maps that are indexed by either color or stencil indices must have
_param2 = $2 sup n$ for some $n$ or the results are undefined.
The maximum allowable size for each map depends on the implementation 
and can be determined by calling _cmnd(Get) with argument
_const(MAX_PIXEL_MAP_TABLE).
The single maximum applies to all maps; it is at
least 32.
.bp
.TS
center tab(:) delim($$) ;
lb cb cb cb cb
l c c c c.
_
_param1:Lookup Index:Lookup Value:Initial Size:Initial Value
_
_const(PIXEL_MAP_I_TO_I):color index:color index:1:0
_const(PIXEL_MAP_S_TO_S):stencil index :stencil index :1:0
_const(PIXEL_MAP_I_TO_R):color index :R:1:0
_const(PIXEL_MAP_I_TO_G):color index :G:1:0
_const(PIXEL_MAP_I_TO_B):color index:B:1:0
_const(PIXEL_MAP_I_TO_A):color index:A:1:0
_const(PIXEL_MAP_R_TO_R):R:R:1:0
_const(PIXEL_MAP_G_TO_G):G:G:1:0
_const(PIXEL_MAP_B_TO_B):B:B:1:0
_const(PIXEL_MAP_A_TO_A):A:A:1:0
_
.TE

.RE
.SH ERRORS
_const(INVALID_ENUM) is generated if _param1 is not an accepted value.
.P
_const(INVALID_VALUE) is generated if _param2 is less than one
or larger than _const(MAX_PIXEL_MAP_TABLE).
.P
_const(INVALID_VALUE) is generated if _param1 is
_const(PIXEL_MAP_I_TO_I),
_const(PIXEL_MAP_S_TO_S),
_const(PIXEL_MAP_I_TO_R),
_const(PIXEL_MAP_I_TO_G),
_const(PIXEL_MAP_I_TO_B), or
_const(PIXEL_MAP_I_TO_A),
and _param2 is not a power of two.
.P
_const(INVALID_OPERATION) is generated if _cmnd
is executed between the execution of _cmnd(Begin)
and the corresponding execution of _cmnd(End).
.SH ASSOCIATED GETS
_cmnd(GetPixelMap)
.br
_cmnd(Get) with argument _const(PIXEL_MAP_I_TO_I_SIZE)
.br
_cmnd(Get) with argument _const(PIXEL_MAP_S_TO_S_SIZE)
.br
_cmnd(Get) with argument _const(PIXEL_MAP_I_TO_R_SIZE)
.br
_cmnd(Get) with argument _const(PIXEL_MAP_I_TO_G_SIZE)
.br
_cmnd(Get) with argument _const(PIXEL_MAP_I_TO_B_SIZE)
.br
_cmnd(Get) with argument _const(PIXEL_MAP_I_TO_A_SIZE)
.br
_cmnd(Get) with argument _const(PIXEL_MAP_R_TO_R_SIZE)
.br
_cmnd(Get) with argument _const(PIXEL_MAP_G_TO_G_SIZE)
.br
_cmnd(Get) with argument _const(PIXEL_MAP_B_TO_B_SIZE)
.br
_cmnd(Get) with argument _const(PIXEL_MAP_A_TO_A_SIZE)
.br
_cmnd(Get) with argument _const(MAX_PIXEL_MAP_TABLE)
.SH SEE ALSO
_cmnd(ColorTable),
_cmnd(ColorSubTable),
_cmnd(ConvolutionFilter1D),
_cmnd(ConvolutionFilter2D),
_cmnd(CopyPixels),
_cmnd(CopyTexImage1D),
_cmnd(CopyTexImage2D),
_cmnd(CopyTexSubImage1D),
_cmnd(CopyTexSubImage2D),
_cmnd(DrawPixels),
_cmnd(Histogram),
_cmnd(Minmax),
_cmnd(PixelStore),
_cmnd(PixelTransfer),
_cmnd(ReadPixels),
_cmnd(SeparableFilter2D),
_cmnd(TexImage1D),
_cmnd(TexImage2D),
_cmnd(TexImage3D),
_cmnd(TexSubImage1D),
_cmnd(TexSubImage2D),
_cmnd(TexSubImage3D)