GLCOPYTEXSUBIMAGE1D(3G)

okay so bestie, welcome to GLCOPYTEXSUBIMAGE1D(3G) β€” the manual page for copying a one-dimensional texture subimage. it’s giving OpenGL copy-paste but make it texels πŸ’…βœ¨

✨ NAME ✨

glCopyTexSubImage1D, glCopyTextureSubImage1D β€” copy a one-dimensional texture subimage.

πŸ’» C SPECIFICATION πŸ’»

void glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset,
                         GLint x, GLint y, GLsizei width);

void glCopyTextureSubImage1D(GLuint texture, GLint level, GLint xoffset,
                             GLint x, GLint y, GLsizei width);

πŸŽ€ PARAMETERS πŸŽ€

  • target β€” specifies the target to which the texture object is bound for the glCopyTexSubImage1D function. Must be GL_TEXTURE_1D.
  • texture β€” specifies the texture object name for the glCopyTextureSubImage1D function.
  • level β€” specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
  • xoffset β€” specifies the texel offset within the texture array.
  • x, y β€” specify the window coordinates of the left corner of the row of pixels to be copied.
  • width β€” specifies the width of the texture subimage.

πŸ¦‹ DESCRIPTION πŸ¦‹

so glCopyTexSubImage1D and glCopyTextureSubImage1D replace a portion of a one-dimensional texture image with pixels from the current GL_READ_BUFFER β€” and yes, bestie, that’s instead of main memory, unlike what happens with glTexSubImage1D(). For glCopyTexSubImage1D, the texture object bound to target is the one used for the process. For glCopyTextureSubImage1D, texture tells you which texture object should be used for the call.

picture the screen-aligned pixel row whose left corner is at (x, y) and whose length is width; that row replaces the portion of the texture array with x indices xoffset through xoffset + width - 1, inclusive. and the destination in the texture array may not include any texels outside the texture array as it was originally specified. no cap.

the pixels in that row are processed exactly as if glReadPixels() had been called, but the process stops just before final conversion. At that point, all pixel component values are clamped to the range 0 to 1 and then converted to the texture’s internal format for storage in the texel array.

it is not an error to specify a subtexture with zero width, but such a specification has no effect β€” it just does absolutely nothing, bestie. If any of the pixels within the specified row of the current GL_READ_BUFFER are outside the read window associated with the current rendering context, then the values obtained for those pixels are undefined 😭.

no change is made to the internalformat or width parameters of the specified texture array or to texel values outside the specified subregion. iconic, no notes.

πŸ“ NOTES πŸ“

the glPixelStore() mode affects texture images. periodt.

πŸ’€ ERRORS πŸ’€

  • GL_INVALID_ENUM is generated by glCopyTexSubImage1D if target is not GL_TEXTURE_1D.
  • GL_INVALID_FRAMEBUFFER_OPERATION is generated if the object bound to GL_READ_FRAMEBUFFER_BINDING is not framebuffer complete.
  • GL_INVALID_OPERATION is generated by glCopyTextureSubImage1D if texture is not the name of an existing texture object, or if the effective target of texture is not GL_TEXTURE_1D.
  • GL_INVALID_OPERATION is generated if the texture array has not been defined by a previous glTexImage1D(), glCopyTexImage1D(), or glTexStorage1D() operation.
  • GL_INVALID_VALUE is generated if level is less than 0.
  • GL_INVALID_VALUE may be generated if level > log 2 ⁑ max, where max is the returned value of GL_MAX_TEXTURE_SIZE.
  • GL_INVALID_VALUE is generated if xoffset < 0, or xoffset + width > w, where w is the GL_TEXTURE_WIDTH of the texture image being modified.
  • GL_INVALID_OPERATION is generated if:
    • the read buffer is GL_NONE, or
    • the value of GL_READ_FRAMEBUFFER_BINDING is non-zero, and:
      • the read buffer selects an attachment that has no image attached, or
      • the effective value of GL_SAMPLE_BUFFERS for the read framebuffer is one.

πŸ” ASSOCIATED GETS πŸ”

glGetTexImage() β€” that’s the associated get, bestie.

🌈 VERSION SUPPORT 🌈

the version support table is headed Function / Feature Name across OpenGL Version, with version columns 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5. here’s the tea without the table:

  • glCopyTexSubImage1D β€” βœ… in every listed version: 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5.
  • glCopyTextureSubImage1D β€” βœ… only in 4.5; every earlier listed version is -: 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4.

πŸ‘€ SEE ALSO πŸ‘€

glCopyTexImage1D(), glCopyTexImage2D(), glCopyTexSubImage2D(), glCopyTexSubImage3D(), glPixelStore(), glReadBuffer(), glTexImage1D(), glTexImage2D(), glTexImage3D(), glTexParameter(), glTexSubImage1D(), glTexSubImage2D(), glTexSubImage3D()

Copyright Β© 1991-2006 Silicon Graphics, Inc. Copyright Β© 2012-2014 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.

Copyright Β© 2014 Khronos Group


okay that’s the whole page, bestie 🫢 source/version tag says [FIXME: source], and it’s dated 08/09/2021 β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from