1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/angle/extensions/ANGLE_pack_reverse_row_order.txt Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,168 @@ 1.4 +Name 1.5 + 1.6 + ANGLE_pack_reverse_row_order 1.7 + 1.8 +Name Strings 1.9 + 1.10 + GL_ANGLE_pack_reverse_row_order 1.11 + 1.12 +Contact 1.13 + 1.14 + Daniel Koch, TransGaming (daniel 'at' transgaming.com) 1.15 + 1.16 +Contributors 1.17 + 1.18 + Brian Salomon 1.19 + Daniel Koch 1.20 + 1.21 +Status 1.22 + 1.23 + Implemented in ANGLE ES2 1.24 + 1.25 +Version 1.26 + 1.27 + Last Modified Date: February 22, 2011 1.28 + Author Revision: 22 1.29 + 1.30 +Number 1.31 + 1.32 + OpenGL ES Extension #110 1.33 + 1.34 +Dependencies 1.35 + 1.36 + OpenGL 1.5 or OpenGL ES 1.0 are required. 1.37 + 1.38 + Some of the functionality of this extension is not supported 1.39 + when implemented against OpenGL ES. 1.40 + 1.41 + EXT_texture_rg interacts with this extension. 1.42 + 1.43 + The extension is written against the OpenGL 3.2 Specification 1.44 + (Core Profile). 1.45 + 1.46 +Overview 1.47 + 1.48 + This extension introduces a mechanism to allow reversing the order 1.49 + in which image rows are written into a pack destination. This 1.50 + effectively allows an application to flip the results of a ReadPixels 1.51 + in the y direction operation without having to render upside down. 1.52 + 1.53 + The coordinate system of OpenGL is vertically reversed in comparison to a 1.54 + number of other graphics systems such as native windowing APIs. Applications 1.55 + that perform ReadPixels may have to either render to an intermediate color 1.56 + buffer before calling ReadPixels or perform a flip in software after 1.57 + ReadPixels. In some systems the GL can perform the row reversal during 1.58 + ReadPixels without incurring additional cost. 1.59 + 1.60 +IP Status 1.61 + 1.62 + No known IP claims. 1.63 + 1.64 +New Procedures and Functions 1.65 + 1.66 + None 1.67 + 1.68 +New Types 1.69 + 1.70 + None 1.71 + 1.72 +New Tokens 1.73 + 1.74 + Accepted by the <pname> parameter of PixelStore{if}, GetIntegerv(), 1.75 + GetBooleanv(), and GetFloatv(): 1.76 + 1.77 + PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 1.78 + 1.79 +Additions to Chapter 3 of the OpenGL 3.2 Specification (Rasterization) 1.80 + 1.81 + In Section 4.3.1 (Reading Pixels) add a row to table 4.7: 1.82 + 1.83 + +------------------------------+---------+---------------+-------------+ 1.84 + | Parameter Name | Type | Initial Value | Valid Range | 1.85 + +------------------------------+---------+---------------+-------------+ 1.86 + | PACK_REVERSE_ROW_ORDER_ANGLE | boolean | FALSE | TRUE/FALSE | 1.87 + +------------------------------+---------+---------------+-------------+ 1.88 + 1.89 + In Section 4.3.1 (Reading Pixels) modify the second paragraph of subsection 1.90 + "Placement in Pixel Pack Buffer or Client Memory" to read: 1.91 + 1.92 + When PACK_REVERSE_ROW_ORDER_ANGLE is FALSE groups of elements are placed 1.93 + in memory just as they are taken from memory when transferring pixel 1.94 + rectangles to the GL. That is, the ith group of the jth row 1.95 + (corresponding to the ith pixel in the jth row) is placed in memory just 1.96 + where the ith group of the jth row would be taken from when transferring 1.97 + pixels. See Unpacking under section 3.7.2. The only difference is that 1.98 + the storage mode parameters whose names begin with PACK_ are used 1.99 + instead of those whose names begin with UNPACK_. If the format is RED, 1.100 + GREEN, BLUE, or ALPHA, only the corresponding single element is written. 1.101 + Likewise if the format is RG, RGB, or BGR, only the corresponding two or 1.102 + three elements are written. Otherwise all the elements of each group are 1.103 + written. When PACK_REVERSE_ROW_ORDER_ANGLE is TRUE the order of the rows 1.104 + of elements is reversed before the data is packed. That is, the element 1.105 + corresponding to pixel (x, y + height - 1) becomes the first element 1.106 + packed, followed by (x + 1, y + height - 1), etc. Otherwise, pixel data 1.107 + is packed in the same manner as when PACK_REVERSE_ROW_ORDER_ANGLE is 1.108 + FALSE. 1.109 + 1.110 +Additions to Chapter 6 of the OpenGL 3.2 Specification (State and State Requests) 1.111 + 1.112 + In Section 6.1.4 add the following sentence to the fifth paragraph 1.113 + (beginning with "For three-dimensional and two-dimensional array 1.114 + textures..."): 1.115 + When PACK_REVERSE_ROW_ORDER_ANGLE is TRUE the order of rows within 1.116 + each image are reversed without reordering the images themselves. 1.117 + 1.118 +Dependencies on OpenGL ES 1.119 + 1.120 + If implemented for OpenGL ES, this extension behaves as specified, except: 1.121 + 1.122 + -Delete all references to formats RED, GREEN, BLUE, RG, and BGR. 1.123 + 1.124 + -The language about image order in Section 6.1.4 does not apply as OpenGL ES 1.125 + does not have GetTexImage. 1.126 + 1.127 +Dependencies on EXT_texture_rg 1.128 + 1.129 + If EXT_texture_rg is present reinsert language about formats RED and RG 1.130 + into the OpenGL ES 2.0 specification. 1.131 + 1.132 +Errors 1.133 + 1.134 + None 1.135 + 1.136 +New State 1.137 + Initial 1.138 + Get Value Type Get Command Value Description Sec. 1.139 + --------- ---- ----------- ------- ----------- ---- 1.140 + PACK_REVERSE_ROW_ORDER_ANGLE B GetIntegerv FALSE Pixel pack row order reversal 4.3.1 1.141 + 1.142 +New Implementation Dependent State 1.143 + 1.144 + None 1.145 + 1.146 +Issues 1.147 + 1.148 + None 1.149 + 1.150 +Sample Code 1.151 + 1.152 + /* Allocate space to hold the pixel data */ 1.153 + const GLvoid* pixels = malloc(width * height * 4); 1.154 + 1.155 + /* Bind the framebuffer object to be read */ 1.156 + glBindFramebuffer(GL_READ_FRAMEBUFFER, framebuffer); 1.157 + 1.158 + /* Enable row order reversal */ 1.159 + glPixelStore(GL_PACK_REVERSE_ROW_ORDER_ANGLE, TRUE); 1.160 + 1.161 + /* The pixel data stored in pixels will be in top-down order, ready for 1.162 + * use with a windowing system API that expects this order. 1.163 + */ 1.164 + glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels); 1.165 + 1.166 +Revision History 1.167 + 1.168 + Revision 1, 2011/11/22 (Brian Salomon) 1.169 + - First version 1.170 + Revision 2, 2012/02/22 (dgkoch) 1.171 + - prepare for publishing