15bd8deadSopenharmony_ciXXX - Not complete.
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ciName
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ci    SGIX_subsample
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ciName Strings
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ci    GL_SGIX_subsample
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ciVersion
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ci    Last Modified Date: 07/27/1999
145bd8deadSopenharmony_ci    Author Revision: $Header: //depot/main/doc/registry/extensions/SGI/subsample.spec#10 $
155bd8deadSopenharmony_ci
165bd8deadSopenharmony_ciNumber
175bd8deadSopenharmony_ci
185bd8deadSopenharmony_ci    202
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ciDependencies
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ci	Full support of SGI_ycrcb can be accomplished by using
235bd8deadSopenharmony_ci	SGIX_subsample and GL_COLOR_MATRIX.  In addition, some 
245bd8deadSopenharmony_ci        applications may also choose to invoke GL_CONVOLUTION 
255bd8deadSopenharmony_ci        and GL_COLOR_TABLE to better improve the quality of both 
265bd8deadSopenharmony_ci	the resampling and color conversion.  Note however, that
275bd8deadSopenharmony_ci	this extension, combined with the ycrcbformat.spec
285bd8deadSopenharmony_ci	(SGIX_ycrcba) extension obsoletes the current ycrcb.spec
295bd8deadSopenharmony_ci	(SGIX_ycrcb) extension. 
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ci	EXT_texture3D affects the definition of this extension
325bd8deadSopenharmony_ci	EXT_subtexture affects the definition of this extension
335bd8deadSopenharmony_ci	EXT_histogram affects the definition of this extension
345bd8deadSopenharmony_ci	EXT_convolution affects the definition of this extension
355bd8deadSopenharmony_ci	SGI_color_table affects the definition of this extension
365bd8deadSopenharmony_ci 	SGI_resample affects the definition of this extension
375bd8deadSopenharmony_ci 	SGI_subsample_4224 affects the definition of this extension
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ciOverview
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci	Many video image formats and compression techniques utilize
425bd8deadSopenharmony_ci	various component subsamplings, so it is necessary to provide a
435bd8deadSopenharmony_ci	mechanism to specify the up- and down-sampling of components as
445bd8deadSopenharmony_ci	pixel data is drawn from and read back to the client. Though
455bd8deadSopenharmony_ci	subsampled components are normally associated with the video
465bd8deadSopenharmony_ci	color space, YCrCb, use of subsampling in OpenGL does not imply
475bd8deadSopenharmony_ci	a specific color space.
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci	This extension defines new pixel storage modes that are used in
505bd8deadSopenharmony_ci	the conversion of image data to and from component subsampled
515bd8deadSopenharmony_ci	formats on the client side. The extension defines a new pixel
525bd8deadSopenharmony_ci	storage mode to specify these sampling patterns, there are
535bd8deadSopenharmony_ci	three legal values (PIXEL_SUBSAMPLE_4444_SGIX, 
545bd8deadSopenharmony_ci	PIXEL_SUBSAMPLE_4242_SGIX, and 
555bd8deadSopenharmony_ci        PIXEL_SUBSAMPLE_2424_SGIX).
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci	When pixel data is received from the client and an unpacking
585bd8deadSopenharmony_ci	upsampling mode other than PIXEL_SUBSAMPLE_4444_SGIX is 
595bd8deadSopenharmony_ci        specified, the upsampling is performed via replication, 
605bd8deadSopenharmony_ci        unless otherwise specified by RESAMPLE_SGIX.
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ci	Similarly, when pixel data is read back to the client and a
635bd8deadSopenharmony_ci	packing downsampling mode other than 
645bd8deadSopenharmony_ci        PIXEL_SUBSAMPLE_4444_SGIX is specified, downsampling is 
655bd8deadSopenharmony_ci        performed via simple component decimation (point sampling), 
665bd8deadSopenharmony_ci        unless otherwise specified by RESAMPLE_SGIX.
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ciIssues
695bd8deadSopenharmony_ci	* If we revive the ycrcbformat.spec then support for the old
705bd8deadSopenharmony_ci	  (SGIX_ycrcb) extension can be accomplished using the the 
715bd8deadSopenharmony_ci          SGIX_subsample and SGIX_ycrcba.
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci	* the enums with names like PIXEL_SUBSAMPLE_4242_SGIX and 
745bd8deadSopenharmony_ci	  PIXEL_SUBSAMPLE_2424_SGIX gives an impression that there 
755bd8deadSopenharmony_ci          are 4 components in the subsampling.  Can there be an 
765bd8deadSopenharmony_ci          alternative name?
775bd8deadSopenharmony_ci	 (Angela suggests: PIXEL_SUBSAMPLE_422_CbYCrY_SGIX and 
785bd8deadSopenharmony_ci          PIXEL_SUBSAMPLE_422_YCbYCr_SGIX.  This is clear, but involves 
795bd8deadSopenharmony_ci          naming the components YCrCb.  However, the term 4:2:2 basically 
805bd8deadSopenharmony_ci          refers to the subcarrier frequency for the YCrCb transmission 
815bd8deadSopenharmony_ci          in video signals, so 4:2:2 in a way already implies 4:2:2)
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ciNew Procedures and Functions
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ci	None.
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ciNew Tokens
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci	Accepted by the <pname> parameter of PixelStoref, PixelStorei,
905bd8deadSopenharmony_ci	GetBooleanv, GetIntegerv, GetFloatv and GetDoublev:
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ci		PACK_SUBSAMPLE_RATE_SGIX	0x85A0
935bd8deadSopenharmony_ci		UNPACK_SUBSAMPLE_RATE_SGIX	0x85A1
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci	Accepted by the <param> parameter of PixelStoref and
965bd8deadSopenharmony_ci	PixelStorei when the <pname> parameter is PACK_SUBSAMPLE_RATE_SGIX or
975bd8deadSopenharmony_ci	UNPACK_SUBSAMPLE_RATE_SGIX:
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci		PIXEL_SUBSAMPLE_4444_SGIX	0x85A2
1005bd8deadSopenharmony_ci		PIXEL_SUBSAMPLE_2424_SGIX	0x85A3
1015bd8deadSopenharmony_ci		PIXEL_SUBSAMPLE_4242_SGIX	0x85A4
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.1 Specification (OpenGL Operation)
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ci	None.
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.1 Specification (Rasterization)
1085bd8deadSopenharmony_ci
1095bd8deadSopenharmony_ci	3.6.1 Pixel Storage Modes
1105bd8deadSopenharmony_ci	
1115bd8deadSopenharmony_ci	The following is added to Table 3.1:
1125bd8deadSopenharmony_ci	
1135bd8deadSopenharmony_ci	Parameter Name               Type     Initial Value                   Valid Range
1145bd8deadSopenharmony_ci	--------------               ----     -------------                   -----------
1155bd8deadSopenharmony_ci	UNPACK_SUBSAMPLE_RATE_SGIX   integer  PIXEL_SUBSAMPLE_4444_SGIX  PIXEL_SUBSAMPLE_4444_SGIX
1165bd8deadSopenharmony_ci									      PIXEL_SUBSAMPLE_4242_SGIX
1175bd8deadSopenharmony_ci									      PIXEL_SUBSAMPLE_2424_SGIX
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ci	PACK_SUBSAMPLE_RATE_SGIX     integer  PIXEL_SUBSAMPLE_4444_SGIX  PIXEL_SUBSAMPLE_4444_SGIX
1205bd8deadSopenharmony_ci									      PIXEL_SUBSAMPLE_4242_SGIX
1215bd8deadSopenharmony_ci									      PIXEL_SUBSAMPLE_2424_SGIX
1225bd8deadSopenharmony_ci
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci	3.6.3 Rasterization of Pixel Rectangles
1255bd8deadSopenharmony_ci
1265bd8deadSopenharmony_ci	<at the end of the paragraph before the Unpacking section>
1275bd8deadSopenharmony_ci	
1285bd8deadSopenharmony_ci	If the PixelStore parameter UNPACK_SUBSAMPLE_RATE_SGIX is set to
1295bd8deadSopenharmony_ci	PIXEL_SUBSAMPLE_4242_SGIX or PIXEL_SUBSAMPLE_2424_SGIX, then the 
1305bd8deadSopenharmony_ci	<format> needs to be set to a corresponding 3- or 4- component 
1315bd8deadSopenharmony_ci	pixel format or the error INVALID_OPERATION occurs.  If a
1325bd8deadSopenharmony_ci	4-component pixel format is used, the alpha is assumed to be
1335bd8deadSopenharmony_ci	of constant value 1.0)
1345bd8deadSopenharmony_ci
1355bd8deadSopenharmony_ci	If the PixelStore parameter UNPACK_SUBSAMPLE_RATE_SGIX is set to
1365bd8deadSopenharmony_ci	PIXEL_SUBSAMPLE_4242_SGIX or PIXEL_SUBSAMPLE_2424_SGIX, then the 
1375bd8deadSopenharmony_ci	<width> needs to be set to a multiple of 2 pixels or the error 
1385bd8deadSopenharmony_ci	INVALID_OPERATION occurs.
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci	<following "to form groups." at the end of the first paragraph
1415bd8deadSopenharmony_ci	in the Unpacking section>
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ci	If the PixelStore parameter UNPACK_SUBSAMPLE_RATE_SGIX is set to
1445bd8deadSopenharmony_ci	something other than PIXEL_SUBSAMPLE_4444_SGIX then these elements
1455bd8deadSopenharmony_ci	are grouped into sets of one, two, three or four values,
1465bd8deadSopenharmony_ci	depending on the value of UNPACK_SUBSAMPLE_RATE_SGIX, to form
1475bd8deadSopenharmony_ci	groups.
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci	<at the and of the paragraph>
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci	Table 3.5.1 summarizes the layout of groups obtained from
1525bd8deadSopenharmony_ci	memory depending on the value of UNPACK_SUBSAMPLE_RATE_SGIX.
1535bd8deadSopenharmony_ci
1545bd8deadSopenharmony_ci	Table 3.5.1:
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci	Value of                   Number of     Number of     Order of
1575bd8deadSopenharmony_ci	UNPACK_SUBSAMPLE    	   Components    Values/Group  components
1585bd8deadSopenharmony_ci	_RATE_SGIX					       in a seq of
1595bd8deadSopenharmony_ci							       groups in memory
1605bd8deadSopenharmony_ci	--------------------       ----------    -------       ----------
1615bd8deadSopenharmony_ci	PIXEL_SUBSAMPLE_4444_SGIX  n             n
1625bd8deadSopenharmony_ci	PIXEL_SUBSAMPLE_4242_SGIX  3 CbYCr(rgb)  2             YCb,YCr,YCb,YCr
1635bd8deadSopenharmony_ci	PIXEL_SUBSAMPLE_2424_SGIX  3 CbYCr(rgb)  2             CbY,CrY,CbY,CrY
1645bd8deadSopenharmony_ci
1655bd8deadSopenharmony_ci	note: Cb, Y, and Cr are used to illustrate the in-memory
1665bd8deadSopenharmony_ci	packing of pixels in the YCrCb color space. Normally, 2,3, and
1675bd8deadSopenharmony_ci	4 component groups are labeled LA, RGB, RGBA.
1685bd8deadSopenharmony_ci
1695bd8deadSopenharmony_ci	<A new section is inserted before "Conversion to RGB">
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci	Conversion to UNIFORM Sampling
1725bd8deadSopenharmony_ci	------------------------------
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ci	This step is applied only if the PixelStore parameter
1755bd8deadSopenharmony_ci	UNPACK_SUBSAMPLE_RATE_SGIX is set to something other than
1765bd8deadSopenharmony_ci	PIXEL_SUBSAMPLE_4444_SGIX. If UNPACK_SUBSAMPLE_RATE_SGIX 
1775bd8deadSopenharmony_ci        is set to PIXEL_SUBSAMPLE_4242_SGIX or 
1785bd8deadSopenharmony_ci        PIXEL_SUBSAMPLE_2424_SGIX then the number 
1795bd8deadSopenharmony_ci	of components per pixel is increased from two to three.  
1805bd8deadSopenharmony_ci	After upsampling, the data is treated as though it were RGB.
1815bd8deadSopenharmony_ci
1825bd8deadSopenharmony_ci	2424:
1835bd8deadSopenharmony_ci
1845bd8deadSopenharmony_ci	< R0,G0>     < B1,G1>     < R2,G2>    < B3, G3>
1855bd8deadSopenharmony_ci	<Cb0,Y0>     <Cr0,Y1>     <Cb2,Y2>    <Cr2, Y3>
1865bd8deadSopenharmony_ci	  |  |        |   |        |   |        |   |
1875bd8deadSopenharmony_ci	  |  |  o-----o---+--o     |   |  o-----o---+--o
1885bd8deadSopenharmony_ci	  |  |  |         |  |     |   |  |         |  |
1895bd8deadSopenharmony_ci	  o--+--+-----o   |  |     o---+--+-----o   |  |
1905bd8deadSopenharmony_ci	  |  |  |     |   |  |     |   |  |     |   |  |
1915bd8deadSopenharmony_ci	  V  V  V     V   V  V     V   V  V     V   V  V
1925bd8deadSopenharmony_ci	<Cb0,Y0,Cr0> <Cb0,Y1,Cr0> <Cb2,Y2,Cr2> <Cb2,Y3,Cr2>
1935bd8deadSopenharmony_ci	< R0,G0,B1 > < R0,G1,B1 > < R2,G2,B3 > < R2,G3,B3 >
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ci	
1965bd8deadSopenharmony_ci	4242:
1975bd8deadSopenharmony_ci	< G0,R0>      <G1,B1 >     <G2,R2 >    < G3,B3 >
1985bd8deadSopenharmony_ci	<Y0,Cb0>      <Y1,Cr0>     <Y2,Cb2>     <Y3,Cr2>
1995bd8deadSopenharmony_ci	  |  |         |   |        |   |        |   |
2005bd8deadSopenharmony_ci          \ / \_____ __\__/ \       \ / \_____ __\__/ \
2015bd8deadSopenharmony_ci           X     ___X   \    |       X     ___X   \    |
2025bd8deadSopenharmony_ci          / \   /    \   \   |      / \   /    \   \   |
2035bd8deadSopenharmony_ci	  |  |  |     |   |  |      |  |  |     |   |  |
2045bd8deadSopenharmony_ci	  V  V  V     V   V  V      V  V  V     V   V  V
2055bd8deadSopenharmony_ci	<Cb0,Y0,Cr0> <Cb0,Y1,Cr0> <Cb2,Y2,Cr2> <Cb2,Y3,Cr2>
2065bd8deadSopenharmony_ci	< R0,G0,B1 > < R0,G1,B1 > < R2,G2,B3 > < R2,G3,B3 >
2075bd8deadSopenharmony_ci
2085bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.1 Specification (Per-Fragment
2095bd8deadSopenharmony_ciOperations and the Frame Buffer)
2105bd8deadSopenharmony_ci
2115bd8deadSopenharmony_ci	4.3.2 Reading Pixels
2125bd8deadSopenharmony_ci		
2135bd8deadSopenharmony_ci	The following is added to Table 4.5:
2145bd8deadSopenharmony_ci	
2155bd8deadSopenharmony_ci	Parameter Name            Type     Initial Value		Valid Range
2165bd8deadSopenharmony_ci	--------------            ----     -------------		-----------
2175bd8deadSopenharmony_ci	PACK_SUBSAMPLE_RATE_SGIX  integer  PIXEL_SUBSAMPLE_4444_SGIX	PIXEL_SUBSAMPLE_4444_SGIX
2185bd8deadSopenharmony_ci									PIXEL_SUBSAMPLE_4242_SGIX
2195bd8deadSopenharmony_ci									PIXEL_SUBSAMPLE_2424_SGIX
2205bd8deadSopenharmony_ci	
2215bd8deadSopenharmony_ci	<A new section is inserted before "Final Conversion">
2225bd8deadSopenharmony_ci
2235bd8deadSopenharmony_ci	Conversion to Subsampled Form
2245bd8deadSopenharmony_ci	------------------------------
2255bd8deadSopenharmony_ci
2265bd8deadSopenharmony_ci	This step is applied only if the PixelStore parameter
2275bd8deadSopenharmony_ci	PACK_SUBSAMPLE_RATE_SGIX is set to something other than
2285bd8deadSopenharmony_ci	PIXEL_SUBSAMPLE_4444_SGIX. If this step is carried out its
2295bd8deadSopenharmony_ci	operation is controlled by the values of PACK_SUBSAMPE_RATE_SGIX.
2305bd8deadSopenharmony_ci
2315bd8deadSopenharmony_ci	If a filter operation is specified by RESAMPLE_SGIX, the
2325bd8deadSopenharmony_ci	resampling filter is applied prior to the subsampling step.
2335bd8deadSopenharmony_ci
2345bd8deadSopenharmony_ci	The pack mode involves dropping chroma samples. For users who
2355bd8deadSopenharmony_ci	like to perform arbitrary filtering other than those specifiable
2365bd8deadSopenharmony_ci	using RESAMPLE_SGIX, it could also be done prior to packing with 
2375bd8deadSopenharmony_ci	user calls to convolution function.
2385bd8deadSopenharmony_ci
2395bd8deadSopenharmony_ci	If PACK_SUBSAMPLE_RATE_SGIX is set to PIXEL_SUBSAMPLE_4242_SGIX or 
2405bd8deadSopenharmony_ci	PIXEL_SUBSAMPLE_2424_SGIX then the resulting pixels has an average
2415bd8deadSopenharmony_ci	of 2 component values per pixel.  Each pixel pair are constructed 
2425bd8deadSopenharmony_ci	as follows:
2435bd8deadSopenharmony_ci	The first destination pixel of a pair is made up of the 
2445bd8deadSopenharmony_ci	first and second component of the first source pixel.
2455bd8deadSopenharmony_ci	The second destination pixel of a pair is made up of the 
2465bd8deadSopenharmony_ci	third component	of the first source pixel, and the second 
2475bd8deadSopenharmony_ci	component of the second source pixel.
2485bd8deadSopenharmony_ci
2495bd8deadSopenharmony_ci	2424:
2505bd8deadSopenharmony_ci
2515bd8deadSopenharmony_ci	<R0,G0,B0,A0> <R1,G1,B1,A1> <R2,G2,B2,A2> <R3,G3,B3,A3>
2525bd8deadSopenharmony_ci          |  |  |  |   |  |  |  |    |  |  |  |    |  |  |  |
2535bd8deadSopenharmony_ci          |  |  |  *   *  |  *  *    |  |  |  *    *  |  *  *
2545bd8deadSopenharmony_ci          |  |  |         |          |  |  |          |
2555bd8deadSopenharmony_ci          V  V  V         V          V  V  V          V
2565bd8deadSopenharmony_ci	<R0,G0><B0        G1>       <R2,G2><B2,       G3>
2575bd8deadSopenharmony_ci	<--- pixel pair ---->       <--- pixel pair ---->
2585bd8deadSopenharmony_ci
2595bd8deadSopenharmony_ci	4242:
2605bd8deadSopenharmony_ci
2615bd8deadSopenharmony_ci	<R0,G0,B0,A0> <R1,G1,B1,A1> <R2,G2,B2,A2> <R3,G3,B3,A3>
2625bd8deadSopenharmony_ci          |  |  |  *   *  |  *  *     |  |  |  *   *  |  *  *    
2635bd8deadSopenharmony_ci          \ /   |____ ____|           \ /   |____ ____|          
2645bd8deadSopenharmony_ci           X     ____X____             X     ____X____
2655bd8deadSopenharmony_ci          / \   |         |           |  |  |         |
2665bd8deadSopenharmony_ci          V  V  V         V           V  V  V         V
2675bd8deadSopenharmony_ci	<G0,R0><G1        B0>       <G2,R2><G3,       B2>
2685bd8deadSopenharmony_ci	<--- pixel pair ---->       <--- pixel pair ---->
2695bd8deadSopenharmony_ci
2705bd8deadSopenharmony_ci	<toward the end of the paragraph "Placement in Client Memory">
2715bd8deadSopenharmony_ci
2725bd8deadSopenharmony_ci	If the PixelStore parameter PACK_SUBSAMPLE_RATE_SGIX is set to
2735bd8deadSopenharmony_ci	PIXEL_SUBSAMPLE_RATE_4242_SGIX or PIXEL_SUBSAMPLE_RATE_2424_SGIX
2745bd8deadSopenharmony_ci	then only the corresponding two elements are written.  That is,
2755bd8deadSopenharmony_ci	only the first two components of each group are written to memory.
2765bd8deadSopenharmony_ci
2775bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.1 Specification (Special Functions)
2785bd8deadSopenharmony_ci
2795bd8deadSopenharmony_ci	None.
2805bd8deadSopenharmony_ci
2815bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.1 Specification (State and State Requests)
2825bd8deadSopenharmony_ci
2835bd8deadSopenharmony_ci	XXX
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ciAdditions to the GLX Specification
2865bd8deadSopenharmony_ci
2875bd8deadSopenharmony_ci
2885bd8deadSopenharmony_ciErrors
2895bd8deadSopenharmony_ci
2905bd8deadSopenharmony_ci	XXX
2915bd8deadSopenharmony_ci	
2925bd8deadSopenharmony_ci
2935bd8deadSopenharmony_ciNew State
2945bd8deadSopenharmony_ci
2955bd8deadSopenharmony_ci    Get Value			Get Command	Type	Initial Value			Attribute
2965bd8deadSopenharmony_ci    ---------			-----------	----	-------------			---------
2975bd8deadSopenharmony_ci    UNPACK_SUBSAMPLE_RATE_SGIX	GetIntegerv	Z4	PIXEL_SUBSAMPLE_4444_SGIX	client
2985bd8deadSopenharmony_ci    PACK_SUBSAMPLE_RATE_SGIX	GetIntegerv	Z4	PIXEL_SUBSAMPLE_4444_SGIX	client	
2995bd8deadSopenharmony_ci
3005bd8deadSopenharmony_ciNew Implementation Dependent State
3015bd8deadSopenharmony_ci
3025bd8deadSopenharmony_ci	None.
303