QOpenGLPixelTransferOptions Class
QOpenGLPixelTransferOptions 类描述了在纹理上传过程中影响像素解压缩的像素存储模式。更多
Header: | #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 互换。这一操作非常快速,从未出现过故障。
© 2025 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.