7 GL_CHROMIUM_copy_texture
11 Last Modifed Date: July 16, 2014
15 OpenGL ES 2.0 is required.
17 EXT_texture_format_BGRA8888 affects the definition of this extension.
18 ARB_texture_rg affects the definition of this extension.
19 CHROMIUM_ycbcr_422_image affects the definition of this extension.
23 This extension expands on the functionality provided by the
24 glCopyTexImage2D command. A new function is exported,
25 glCopyTextureCHROMIUM, that performs the same copy operation as
28 The extension also supports copying BGRA textures and copying
29 EXTERNAL_OES texture to BGRA texture, which is not explicitly
30 granted by EXT_texture_format_BGRA8888.
32 New Procedures and Functions
36 void glCopyTextureCHROMIUM (GLenum target, GLenum source_id,
38 GLint internal_format, GLenum dest_type,
39 GLboolean unpack_flip_y,
40 GLboolean unpack_premultiply_alpha,
41 GLboolean unpack_unmultiply_alpha)
43 Copies the contents of texture referred to by <source_id> to <dest_id>
44 texture. If <source_id> texture is not defined or has different dimension
45 to <dest_id> texture, define <source_id> texture same to <dest_id> texture.
47 Texture level 0 is copied from the source image to level 0 of the
50 The internal format of the destination texture is converted to that
51 specified by <internal_format>. Must be one of the following symbolic
52 constants: GL_RGB, GL_RGBA
53 The internal format of <source_id> texture must be one of the following
54 symbolic constants: GL_R8, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA,
55 GL_RGB, GL_RGBA, GL_BGRA_EXT, GL_RGB_YCBCR_422_CHROMIUM
56 When <source_id> texture doens't contain a superset of the component
57 required by <internal_format>, fill the components by following rules.
59 source format color components
60 =====================================================
63 GL_LUMINANCE (L, L, L, 1)
64 GL_LUMINANCE_ALPHA (L, L, L, A)
67 GL_BGRA_EXT (R, G, B, A)
68 GL_RGB_YCBCR_422_CHROMIUM (R, G, B, 1)
70 The format type of the destination texture is converted to that specified
73 <target> uses the same parameters as TexImage2D.
75 If <flip_y> is true, vertically flip texture image data.
77 If <unpack_premultiply_alpha> and <unpack_unmultiply_alpha> are true,
78 no alpha processing occurs. This is the equivalent of having neither flag
81 INVALID_OPERATION is generated if <internal_format> is not one of the valid formats
84 INVALID_OPERATION is generated if the internal format of <source_id> is not one of
85 formats from the table above.
87 INVALID_VALUE is generated if <target> is not GL_TEXTURE_2D.
89 INVALID_VALUE is generated if <source_id> or <dest_id> are not valid texture
92 INVALID_VALUE is generated if textures corresponding to <dest_id> have not
93 been bound as GL_TEXTURE_2D object.
95 INVALID_VALUE is generated if textures corresponding to <source_id> have not
96 been bound as GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_ARB or
97 GL_TEXTURE_EXTERNAL_OES objects.
99 INVALID_VALUE is generated if level 0 of the source texture is not defined.
103 void glCopySubTextureCHROMIUM (GLenum target, GLenum source_id,
105 GLint xoffset, GLint yoffset,
107 GLsizei width, GLsizei height,
108 GLboolean unpack_flip_y,
109 GLboolean unpack_premultiply_alpha,
110 GLboolean unpack_unmultiply_alpha)
112 Copies the sub contents of texture referred to by <source_id> to <dest_id>
113 texture without redefining <dest_id> texture.
115 See CopyTextureCHROMIUM for the interpretation of the <target>, <flip_y>,
116 <premultiply_alpha>, and <unmultiply_alpha> arguments.
118 <xoffset> and <yoffset> specify a texel offset in the x and y direction
119 respectively within the destination texture.
121 <x> and <y> specify specify a texel offset in the x and y direction
122 respectively within the source texture.
124 <width> specifies the width of the texture subimage.
126 <height> specifies the width of the texture subimage.
128 INVALID_OPERATION is generated if source internal_format and destination
129 internal_format are not one of the valid formats described above.
131 INVALID_VALUE is generated if <target> is not GL_TEXTURE_2D.
133 INVALID_OPERATION is generated if the destination texture has not been
136 INVALID_VALUE is generated if level 0 of the source texture or
137 the destination texture is not defined.
139 INVALID_VALUE is generated if <xoffset> < 0 , or <yoffset> < 0.
141 INVALID_VALUE is generated if (<xoffset> + <width>) > dest_width,
142 or (<yoffset> + <height>) > dest_height.
144 Dependencies on ARB_texture_rg
146 If ARB_texture_rg is not supported:
147 * delete any reference to the R8 format.
149 Dependencies on CHROMIUM_ycbcr_422_image
151 If CHROMIUM_ycbcr_422_image is not supported:
152 * delete any reference to the RGB_YCBCR_422_CHROMIUM format.
168 8/1/2011 Documented the extension
169 7/4/2013 Add a new parameter dest_type to glCopyTextureCHROMIUM()
170 16/7/2014 Add GL_TEXTURE_RECTANGLE_ARB as valid source_id target
171 19/6/2015 Add arguments unpack_flip_y, unpack_premultiply_alpha, and
172 unpack_unmultiply_alpha to both commands.