• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    SGIS_blended_overlay
4
5Name Strings
6
7    GLX_SGIS_blended_overlay
8
9Version
10
11    $Date: 1997/10/29 20:56:43 $ $Revision: 1.5 $
12
13Number
14
15    142
16
17Dependencies
18
19    EXT_visual_info is required
20    GLX_SGI_color_range affects the definition of this extension
21
22Overview
23
24    This extension augments the set of transparency types for GLX
25    visuals (defined by the EXT_visual_info GLX extension).  A new
26    transparency type designated BLENDED_RGBA_SGIS is defined for
27    overlay windows supporting an alpha color component.  Instead of
28    using a particular transparent pixel or color value to indicate
29    transparency, a window created with a BLENDED_RGBA_SGIS
30    transparency type visual blends with the lower frame buffer layers
31    based on the overlay window's per-pixel alpha component.
32
33    The overlay blend function is:
34
35      if ( Cu is color index pixel type ) then
36
37        if ( Ao > 0.0 ) then
38          Cd = Co    /* Non-zero overlay alpha simply uses overlay color */
39        else
40          Cd = Cu    /* Note: later CI cmap turns Cd index into true color */
41        endif
42
43      else    /* Cu is an RGBA, RGB, L, or LA pixel type */
44
45        /* blend overlay color with normal color based on overlay alpha */
46        Cd = Co * (Ao,Ao,Ao,Ao) + Cu * ( (1,1,1,1) - (Ao,Ao,Ao,Ao) )
47
48      endif
49
50    where Cd is the resulting displayed color.  Co is the RGBA
51    quadruplet for the overlay RGBA components of the overlay window
52    pixel.  Ao is the alpha component for the overlay alpha component
53    of the overlay window pixel.  Cu is the RGBA quadruplet for the
54    RGBA components of the displayed pixel if no overlay where present
55    in the overlay window's layer (or any higher level).  Think of Cu
56    as the displayable color "under" the BLENDED_RGBA_SGIS overlay
57    pixel.
58
59    In the case of extended range frame buffer formats, the overlay
60    blend function is applied post-clamping to the [0,1] range.
61
62    Here are some of the uses for blended RGBA overlays:
63
64      Render antialiased lines, points, and polygons in the overlays
65      with GL_LINE_SMOOTH, GL_POINT_SMOOTH, and GL_POLYGON_SMOOTH.
66
67      Alpha blended antiliasing could be used on the overlay boundaries
68      of overlay control panels and boat hulls.
69
70      Clean blending of overlaid mattes for live video.  Live video
71      stream could be overlaid by computer generated overlaid
72      graphics.
73
74      Swank user interface support for sweeping out irregular screen
75      regions by painiting the region in the overlay with a fractional
76      alpha to blend the sweeped region with some constant color in the
77      overlay.
78
79      Swank brush shapes for 3D painting that let you see the blended
80      pixels underneather the overlay brush shape.
81
82      Really smooth (ie, subpixel positioned), full-color, antialiased
83      cursors (application drawn into a blended RGBA overlay).
84
85IP Status
86
87    Silicon Graphics has filed for patent protection for some of the
88    techniques described in this extension document.
89
90Issues
91
92    *  Are any other blending functions interesting?  NO.
93
94    *  Rather unlikely but you could have multiple layers of blended
95       overlays and/or normal overlays.  If two layers of blended overlays
96       were present, the upper layer should be blended with the resulting
97       blend of the lower overlay with the normal plane.  YES.
98
99       (Warning, be careful about multiple blending using
100       non-premultiplied alpha.  See Porter & Duff SIGGRAPH paper.)
101
102    *  X does not all rendering in the alpha bitplanes.  X rendering
103       should be assumed to always draw an alpha of 1.0.  This means that
104       a BLENDED_RGBA_SGIS overlay will act as an overlay with no
105       transparent pixel when it comes to X rendering.  Blended overlays
106       overlays will only be usable for transparency via OpenGL
107       rendering.  The SEVER_OVERLAY_VISUALS (SOV) X convention will
108       therefore advertise the visual as having transparency type None (no
109       new transparency type will be added to SOV).  YES.
110
111    *  If the alpha component of the frame buffer is displayable (ie, sent
112       out with the video signal), what alpha value should be generated
113       when blended overlays are present?  Is the resulting blended alpha
114       what you would want?  Perhaps merely sending the normal plane alpha
115       is better.  Unresolved.
116
117    *  Should frame buffer layers that supporte extended precision (via
118       the GLX_SGI_color_range extension) be blended before clamping
119       the color components to [0,1]?  NO.
120
121       Both the overlay and normal layer must both be clamped to [0,1]
122       before the overlay blend function is performed.
123
124    *  Does the overlay's full alpha component precision need to be
125       used for the overlay blend function?  NO.
126
127       For example, if the overlay had 8 bits of alpha, the overlay
128       blend function might "get away with" only blending with the 4
129       most significant bits of the alpha component.  This might allow
130       cheaper multipliers for the bandwidth-intensive overlay blend
131       function.  There is no direct way to query what alpha precision
132       the overlay blend uses.  Obviously, implementations are
133       encouraged to use as much overlay precision as is available.
134
135    *  How does a blended overlay interact when it covers a color index
136       window?  If the overlay alpha is zero, use the color index
137       pixel.  A non-zero alpha simply uses the overlay color as is.
138
139    *  How does a blended overlay interact when it covers an X
140       DirectColor visual?  DirectColor has RGB components that are
141       then passed through (generally as part of video scan-out) a
142       per-component colormap (ie, look-up tables).  (The DirectColor
143       colormap is often implemented by overloading the gamma tables).
144
145       Arguably, the blending should use the post-DirectColor colormap
146       color values (same for color index, PseudoColor, etc), but in
147       practice, this is a colormap lookup that typically happens
148       within the video display subsystem so it is not reasonable to
149       expect the overlay blending be put off so long.
150
151       RESOLUTION: DirectColor visual color components should overlay
152       blended pre-DirectColor colormap conversion.  In practice, this
153       means that DirectColor will be treated no differently from
154       TrueColor visuals.
155
156    *  What is the relationship between blended overlays and channel
157       compositing?  None, they are independent and orthogonal
158       features.  Channel compositing happens well after blended
159       overlays.
160
161New Procedures and Functions
162
163    None
164
165New Tokens
166
167    Returned by glXGetConfig, and accepted by the <attrib_list>
168    parameter of glXChooseVisual (following the GLX_TRANSPARENT_TYPE_EXT
169    token):
170
171        GLX_BLENDED_RGBA_SGIS           0x8025
172
173    (EXT_visual_info previously defined GLX_NONE_EXT,
174    GLX_TRANSPARENT_RGB_EXT, and GLX_TRANSPARENT_INDEX_EXT.)
175
176Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
177
178    None
179
180Additions to Chapter 3 of the 1.0 Specification (Rasterization)
181
182    None
183
184Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations and
185the Framebuffer)
186
187
188Additions to Chapter 5 of the 1.0 Specification (Special Functions)
189
190    None
191
192Additions to Chapter 6 of the 1.0 Specification (State and State Requests)
193
194    None
195
196Additions to the GLX Specification
197
198    Changed beginning of the paragraph from the EXT_visual_info
199    specification:
200
201      The visual attribute GLX_TRANSPARENT_TYPE_EXT indicates whether
202      or not the visual supports transparency, and if it does support
203      transparency, what type of transparency is available. If the
204      attribute is set to GLX_NONE_EXT then windows created with the
205      visual will not have any transparent pixels. If the attribute is
206      GLX_TRANSPARENT_RGB_EXT, GLX_TRANSPARENT_INDEX_EXT, or
207      GLX_BLENDED_RGBA_SGIS then the visual supports transparency. ...
208
209    Add the following paragraph after the discussion of paragraph from
210    the EXT_visual_info specification addition beginning "The visual
211    attribute GLX_TRANSPARENT_TYPE_EXT indicates..."
212
213      GLX_BLENDED_RGBA_SGIS is applicable to TrueColor and DirectColor
214      visuals.  There is no particular transparent pixel value for this
215      visual.  Instead, the alpha component of pixels belonging to the
216      overlay window are used to blend the overlay color with the
217      displayable color of the frame buffer layers below the
218      GLX_BLENDED_RGBA_SGIS overlay pixels.
219
220      The GLX_BLENDED_RGBA_SGIS overlay blend function is:
221
222        if ( Cu is color index pixel type ) then
223
224          if ( Ao > 0.0 ) then
225            Cd = Co    /* Non-zero overlay alpha simply uses overlay color */
226          else
227            Cd = Cu    /* Note: later CI colormap turns Cd index into true color */
228          endif
229
230        else    /* Cu is an RGBA, RGB, L, or LA pixel type */
231
232          /* blend overlay color with normal color based on overlay alpha */
233          Cd = Co * (Ao,Ao,Ao,Ao) + Cu * ( (1,1,1,1) - (Ao,Ao,Ao,Ao) )
234
235        endif
236
237      where Cd is the resulting displayed color.  Co is the RGBA
238      quadruplet for the overlay RGBA components of the overlay window
239      pixel.  Ao is the alpha component for the overlay alpha component
240      of the overlay window pixel.  Cu is the RGBA quadruplet for the
241      RGBA components of the displayed pixel if no overlay where present
242      in the overlay window's layer (or any higher level).  Think of Cu
243      as the displayable color "under" the BLENDED_RGBA_SGIS overlay
244      pixel.
245
246      In the case of extended range frame buffer formats (from the
247      GLX_SGI_color_range spec), the overlay blend function is applied
248      post-clamping to the [0,1] range during display scan out.
249
250    Changed paragraph from the EXT_visual_info specification:
251
252      If GLX_TRANSPARENT_TYPE_EXT is GLX_NONE_EXT,
253      GLX_TRANSPARENT_RGB_EXT, or GLX_BLENDED_RGBA_SGIS, then the value
254      returned for GLX_TRANSPARENT_INDEX_VALUE_EXT is undefined.  If
255      GLX_TRANSPARENT_TYPE_EXT is GLX_NONE_EXT,
256      GLX_TRANSPARENT_INDEX_EXT, or GLX_BLENDED_RGBA_SGIS, then the
257      values returned for GLX_TRANSPARENT_RED_VALUE_EXT,
258      GLX_TRANSPARENT_GREEN_VALUE_EXT, and
259      GLX_TRANSPARENT_BLUE_VALUE_EXT are undefined.
260
261    Change line in Table 1 to the following:
262
263        Attribute                 Type      Notes
264        ---------                 ----      -----
265        GLX_TRANSPARENT_TYPE_EXT enum       None, TRANSPARENT_RGB_EXT, TRANSPARENT_INDEX_EXT,
266                                            or BLENDED_RGBA_SGIS
267
268        Table 1: Configuration attributes
269
270GLX Protocol
271
272    One property type/property value pair is augmented with a new
273    proprty value.  The augmented property type/property value pair is
274    now encoded as
275
276    4           ENUM                    property type
277                0x23                    GLX_TRANSPARENT_TYPE_EXT
278    4           ENUM                    property value
279                0x8000                  GLX_NONE_EXT
280                0x8008                  GLX_TRANSPARENT_RGB_EXT
281                0x8009                  GLX_TRANSPARENT_INDEX_EXT
282                0x8025                  GLX_BLENDED_RGBA_SGIS
283
284Errors
285
286    None
287
288New State
289
290    None
291
292New Implementation Dependent State
293
294    None.
295
296