QOpenGLPixelTransferOptions Class
QOpenGLPixelTransferOptions 类描述了在纹理上传过程中影响像素解包的像素存储模式。更多内容...
| 头文件: | #include <QOpenGLPixelTransferOptions> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS OpenGL) target_link_libraries(mytarget PRIVATE Qt6::OpenGL) |
| qmake: | QT += opengl |
公共函数
| QOpenGLPixelTransferOptions() | |
| ~QOpenGLPixelTransferOptions() | |
| int | alignment() const |
| int | imageHeight() const |
| bool | isLeastSignificantBitFirst() const |
| bool | isSwapBytesEnabled() const |
| int | rowLength() const |
| void | setAlignment(int alignment) |
| void | setImageHeight(int imageHeight) |
| void | setLeastSignificantByteFirst(bool lsbFirst) |
| void | setRowLength(int rowLength) |
| void | setSkipImages(int skipImages) |
| void | setSkipPixels(int skipPixels) |
| void | setSkipRows(int skipRows) |
| void | setSwapBytesEnabled(bool swapBytes) |
| int | skipImages() const |
| int | skipPixels() const |
| int | skipRows() const |
| void | swap(QOpenGLPixelTransferOptions &other) |
成员函数文档
QOpenGLPixelTransferOptions::QOpenGLPixelTransferOptions()
使用默认设置构建一个新的 QOpenGLPixelTransferOptions 实例。
[noexcept] QOpenGLPixelTransferOptions::~QOpenGLPixelTransferOptions()
析构函数。
int QOpenGLPixelTransferOptions::alignment() const
返回每行像素的当前对齐要求。
另请参阅 setAlignment()。
int QOpenGLPixelTransferOptions::imageHeight() const
返回当前设置的图像高度。
另请参阅 ` setImageHeight()`。
bool QOpenGLPixelTransferOptions::isLeastSignificantBitFirst() const
如果字节内的位按从低位到高位的顺序排列,则返回true 。
bool QOpenGLPixelTransferOptions::isSwapBytesEnabled() const
如果多字节组件的字节顺序被颠倒,则返回true 。
int QOpenGLPixelTransferOptions::rowLength() const
返回当前设置的行长度。
另请参阅 ` setRowLength()`。
void QOpenGLPixelTransferOptions::setAlignment(int alignment)
设置每行像素的alignment 要求。对应于GL_UNPACK_ALIGNMENT 。默认值为4,与OpenGL的规定一致。
另请参阅 alignment()。
void QOpenGLPixelTransferOptions::setImageHeight(int imageHeight)
将 3D 纹理的图像高度设置为imageHeight 。这相当于GL_UNPACK_IMAGE_HEIGHT 。默认值为 0。
另请参阅 imageHeight()。
void QOpenGLPixelTransferOptions::setLeastSignificantByteFirst(bool lsbFirst)
lsbFirst 指定字节内的位是否按从小到大的顺序排列。默认值为false ,这意味着每个字节中的第一个位是最高有效位。这仅对位图数据具有重要意义。对应于GL_UNPACK_LSB_FIRST 。
void QOpenGLPixelTransferOptions::setRowLength(int rowLength)
将一行中的像素数设置为rowLength 。这相当于GL_UNPACK_ROW_LENGTH 。默认值为0。
另请参阅 rowLength()。
void QOpenGLPixelTransferOptions::setSkipImages(int skipImages)
将跳过的图像数量设置为skipImages 。对应于GL_UNPACK_SKIP_IMAGES 。等同于将传递给QOpenGLTexture::setData()的指针递增。默认值为0。
另请参阅 skipImages()。
void QOpenGLPixelTransferOptions::setSkipPixels(int skipPixels)
将跳过的像素数设置为skipPixels 。对应于GL_UNPACK_SKIP_PIXELS 。等同于将传递给QOpenGLTexture::setData()的指针递增。默认值为0。
另请参阅 skipPixels()。
void QOpenGLPixelTransferOptions::setSkipRows(int skipRows)
将跳过的行数设置为skipRows 。对应于GL_UNPACK_SKIP_ROWS 。等同于将传递给QOpenGLTexture::setData()的指针递增。默认值为0。
另请参阅 skipRows()。
void QOpenGLPixelTransferOptions::setSwapBytesEnabled(bool swapBytes)
swapBytes 指定多字节组件的字节顺序是否被反转。默认值为false 。对应于GL_UNPACK_SWAP_BYTES 。
另请参阅 isSwapBytesEnabled()。
int QOpenGLPixelTransferOptions::skipImages() const
返回被跳过的图片数量。
另请参阅 setSkipImages()。
int QOpenGLPixelTransferOptions::skipPixels() const
返回被跳过的像素数量。
另请参阅 ` setSkipPixels()`。
int QOpenGLPixelTransferOptions::skipRows() const
返回被跳过的行数。
另请参阅 setSkipRows()。
[noexcept] void QOpenGLPixelTransferOptions::swap(QOpenGLPixelTransferOptions &other)
使用other 来交换这些选项。此操作速度极快,且绝不会失败。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.