1Name 2 3 IMG_image_plane_attribs 4 5Name Strings 6 7 EGL_IMG_image_plane_attribs 8 9Contributors 10 11 Ben Bowman 12 Alistair Strachan 13 14Contacts 15 16 Tobias Hector, Imagination Technologies (tobias 'dot' hector 'at' 17 imgtec 'dot' com) 18 19Status 20 21 Complete 22 23Version 24 25 Version 0.4, October 18, 2015 26 27Number 28 29 EGL Extension #95 30 31Dependencies 32 33 EGL_KHR_image_base is required. 34 35 One of EGL_KHR_image, EGL_KHR_image_pixmap or 36 EGL_ANDROID_image_native_buffer is required. 37 38 This extension is written against the wording of the EGL 1.2 39 Specification as modified by EGL_KHR_image_base, 40 EGL_ANDROID_image_native_buffer and EGL_KHR_image_pixmap. 41 This extension interacts with GL_OES_EGL_image and GL_EXT_texture_rg. 42 43Overview 44 45 This extension allows creating an EGLImage from a single plane of a 46 multi-planar Android native image buffer (ANativeWindowBuffer) or 47 a native pixmap (EGLNativePixmap). 48 49New Types 50 51 None 52 53New Procedures and Functions 54 55 None 56 57New Tokens 58 59 Accepted by the <attrib_list> parameter of eglCreateImageKHR: 60 61 EGL_NATIVE_BUFFER_MULTIPLANE_SEPARATE_IMG 0x3105 62 EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG 0x3106 63 64Additions to Chapter 2 of the EGL 1.2 Specification (EGL Operation) 65 66 Add to section 2.5.1 "EGLImage Specification" (as defined by the 67 EGL_KHR_image_base specification), in the description of 68 eglCreateImageKHR: 69 70 Add the following to Table bbb (Legal attributes for eglCreateImageKHR 71 <attr_list> parameter), Section 2.5.1 (EGLImage Specification) 72 73 +-----------------------------+-------------------------+---------------------------+---------------+ 74 | Attribute | Description | Valid <target>s | Default Value | 75 +-----------------------------+-------------------------+---------------------------+---------------+ 76 | EGL_NATIVE_BUFFER_MULTI | Whether a multiplane | EGL_NATIVE_BUFFER_ANDROID | EGL_FALSE | 77 | PLANE_SEPARATE_IMG | native buffer should be | EGL_NATIVE_PIXMAP_KHR | | 78 | | treated as separate | | | 79 | | buffers | | | 80 | | | | | 81 | EGL_NATIVE_BUFFER_ | Which plane of a multi- | EGL_NATIVE_BUFFER_ANDROID | 0 | 82 | PLANE_OFFSET_IMG | plane native buffer is | EGL_NATIVE_PIXMAP_KHR | | 83 | | used as the EGLImage | | | 84 | | source | | | 85 +-----------------------------+-------------------------+---------------------------+---------------+ 86 Table bbb. Legal attributes for eglCreateImageKHR <attrib_list> parameter 87 88 ... 89 90 If <target> is EGL_NATIVE_BUFFER_ANDROID or EGL_NATIVE_PIXMAP_KHR, and 91 <buffer> is a handle to a valid multi-planar surface, such as a YUV420 2 or 92 3 planar video surface, an EGLImage will be created from only one of the 93 planes, as opposed to a single image representing all of the planes as is 94 normally the case. The intention of this extension is that a call to 95 glEGLImageTargetTexture2DOES or EGLImageTargetRenderbufferStorageOES with an 96 EGLImage created from a single plane of a multiplanar buffer will result in 97 a GL_RED or GL_RG texture or renderbuffer, depending on the format of the 98 multiplanar buffer. This allows an application to work directly in the YUV 99 colorspace, rather than forcing a conversion to the linear RGB colorspace, 100 potentially losing precision. 101 102 The size of each image will represent the actual size of the data buffer 103 for that plane which may mean that the size of an EGLImage created from 104 plane 0 of a multi-planar buffer may not be the same as that of one 105 created from plane 1, which is determined by the YUV's sampling ratio (e.g. 106 a 420 will have planes 1 and 2, if present, represented by an image of half 107 the width). 108 109 Add to the list of error conditions for eglCreateImageKHR: 110 111 "* If EGL_NATIVE_BUFFER_MULTIPLANE_SEPARATE_IMG is EGL_TRUE, and <target> 112 is not EGL_NATIVE_BUFFER_ANDROID or EGL_NATIVE_PIXMAP_KHR, the error 113 EGL_BAD_PARAMETER is generated. 114 115 * If EGL_NATIVE_BUFFER_MULTIPLANE_SEPARATE_IMG is EGL_TRUE, and 116 EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG is greater than or equal to the 117 number of planes in <buffer>, the error EGL_BAD_MATCH is generated. 118 119 * If EGL_NATIVE_BUFFER_MULTIPLANE_SEPARATE_IMG is EGL_FALSE, and 120 EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG is greater than 0, the error 121 EGL_BAD_PARAMETER is generated. 122 123 * If EGL_NATIVE_BUFFER_MULTIPLANE_SEPARATE_IMG is EGL_TRUE, and the 124 format of <buffer> is not supported by the implementation, 125 EGL_BAD_PARAMETER is generated." 126 127Dependencies on EGL_KHR_image_pixmap or EGL_KHR_image 128 129 If neither of these extensions are supported, remove all references to 130 native pixmaps and EGL_NATIVE_PIXMAP_KHR. 131 132Dependencies on EGL_ANDROID_image_native_buffer 133 134 If this extension is not supported, remove all references to 135 ANativeWindowBuffer and EGL_NATIVE_BUFFER_ANDROID. 136 137Issues 138 139 None 140 141Revision History 142 143#0.4 (Tobias Hector, October, 2015) 144 - Add interactions with EGL_KHR_image_pixmap/EGL_KHR_image 145 - Added error language for unsupported formats 146#0.3 (Jon Leech, June 13, 2013) 147 - Add a "Valid Targets" column to table bbb for new attributes, matching 148 proposed changes in EGL_KHR_image_base (Bug 10151). Note that this 149 change implies a new error will be generated when <target> is not 150 EGL_NATIVE_BUFFER_ANDROID and EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG is 151 specified in <attrib_list>; this falls out from the generic 152 target-attribute matching error added to EGL_KHR_image_base. 153#0.2 (Ben Bowman, May 30, 2012) 154 - Fixed some typos 155#0.1 (Ben Bowman, May 30, 2012) 156 - First draft of extension . 157