| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<extension href="EXT_sRGB/"> |
| 3 |
<name>EXT_sRGB</name> |
| 4 |
|
| 5 |
<contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL |
| 6 |
working group</a> (public_webgl 'at' khronos.org) </contact> |
| 7 |
|
| 8 |
<contributors> |
| 9 |
<contributor>Florian Boesch (pyalot 'at' gmail.com)</contributor> |
| 10 |
<contributor>Members of the WebGL working group</contributor> |
| 11 |
</contributors> |
| 12 |
|
| 13 |
<number>17</number> |
| 14 |
|
| 15 |
<depends> |
| 16 |
<api version="1.0"/> |
| 17 |
<core version="2.0"> |
| 18 |
<addendum>Additional format restrictions apply for CopyTexImage2D</addendum> |
| 19 |
</core> |
| 20 |
</depends> |
| 21 |
|
| 22 |
<overview> |
| 23 |
<mirrors href="http://www.khronos.org/registry/gles/extensions/EXT/EXT_sRGB.txt" |
| 24 |
name="EXT_sRGB"> |
| 25 |
</mirrors> |
| 26 |
|
| 27 |
<features> |
| 28 |
<feature> |
| 29 |
Adds the sRGB support to textures and framebuffer objects. |
| 30 |
</feature> |
| 31 |
</features> |
| 32 |
</overview> |
| 33 |
|
| 34 |
<idl xml:space="preserve"> |
| 35 |
[NoInterfaceObject] |
| 36 |
interface EXT_sRGB { |
| 37 |
const GLenum SRGB_EXT = 0x8C40; |
| 38 |
const GLenum SRGB_ALPHA_EXT = 0x8C42; |
| 39 |
const GLenum SRGB8_ALPHA8_EXT = 0x8C43; |
| 40 |
const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 0x8210; |
| 41 |
}; |
| 42 |
</idl> |
| 43 |
|
| 44 |
<newtok> |
| 45 |
<function name="texImage2D"> |
| 46 |
<param name="format" type="GLenum"/> |
| 47 |
<param name="internalformat" type="GLenum"/> |
| 48 |
Accepted by the <code>format</code> and <code>internalformat</code> parameters: <code>SRGB_EXT</code> and <code>SRGB_ALPHA_EXT</code> |
| 49 |
</function> |
| 50 |
<function name="texSubImage2D"> |
| 51 |
<param name="format" type="GLenum"/> |
| 52 |
Accepted by the <code>format</code> parameter: <code>SRGB_EXT</code> and <code>SRGB_ALPHA_EXT</code> |
| 53 |
</function> |
| 54 |
<function name="renderbufferStorage"> |
| 55 |
<param name="internalformat" type="GLenum"/> |
| 56 |
Accepted by the <code>internalformat</code> parameter: <code>SRGB_ALPHA8_EXT</code> |
| 57 |
</function> |
| 58 |
<function name="getFramebufferAttachmentParameter"> |
| 59 |
<param name="pname" type="GLenum"/> |
| 60 |
Accepted by the <code>pname</code> parameter: FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT |
| 61 |
</function> |
| 62 |
</newtok> |
| 63 |
|
| 64 |
<samplecode xml:space="preserve"> |
| 65 |
<pre> |
| 66 |
var ext = gl.getExtension('EXT_sRGB'); |
| 67 |
var texture = gl.createTexture(); |
| 68 |
gl.bindTexture(gl.TEXTURE_2D, texture); |
| 69 |
texImage2D(gl.TEXTURE_2D, 0, ext.SRGB_EXT, 256, 256, 0, ext.SRGB_EXT, gl.UNSIGNED_BYTE, data); |
| 70 |
</pre> |
| 71 |
</samplecode> |
| 72 |
|
| 73 |
<history> |
| 74 |
<revision date="2012/12/16"> |
| 75 |
<change>Initial revision.</change> |
| 76 |
</revision> |
| 77 |
<revision date="2013/01/26"> |
| 78 |
<change>Moved from proposal to draft</change> |
| 79 |
</revision> |
| 80 |
<revision date="2014/05/13"> |
| 81 |
<change>Moved from draft to community approved</change> |
| 82 |
</revision> |
| 83 |
<revision date="2014/07/15"> |
| 84 |
<change>Added NoInterfaceObject extended attribute.</change> |
| 85 |
</revision> |
| 86 |
</history> |
| 87 |
</extension> |