![]() |
Qt 6.x
The Qt SDK
|
#include "qddshandler.h"
#include <QtCore/qdebug.h>
#include <QtGui/qimage.h>
#include <cmath>
#include "ddsheader.h"
Go to the source code of this file.
Classes | |
struct | FaceOffset |
struct | FormatInfo |
struct | FormatName |
Enumerations | |
enum | Colors { Red = 0 , Green , Blue , Alpha , ColorCount } |
enum | DXTVersions { One = 1 , Two = 2 , Three = 3 , Four = 4 , Five = 5 , RXGB = 6 } |
Variables | |
static const quint32 | ddsMagic = 0x20534444 |
static const quint32 | dx10Magic = 0x30315844 |
static const qint64 | headerSize = 128 |
static const quint32 | ddsSize = 124 |
static const quint32 | pixelFormatSize = 32 |
static const FaceOffset | faceOffsets [6] = { {2, 1}, {0, 1}, {1, 0}, {1, 2}, {1, 1}, {3, 1} } |
static int | faceFlags [6] |
static const FormatInfo | formatInfos [] |
static const size_t | formatInfosSize = sizeof(formatInfos)/sizeof(FormatInfo) |
static const Format | knownFourCCs [] |
static const size_t | knownFourCCsSize = sizeof(knownFourCCs)/sizeof(Format) |
static const FormatName | formatNames [] |
static const size_t | formatNamesSize = sizeof(formatNames)/sizeof(FormatName) |
enum Colors |
Enumerator | |
---|---|
Red | |
Green | |
Blue | |
Alpha | |
ColorCount |
Definition at line 20 of file qddshandler.cpp.
enum DXTVersions |
Enumerator | |
---|---|
One | |
Two | |
Three | |
Four | |
Five | |
RXGB |
Definition at line 28 of file qddshandler.cpp.
Definition at line 324 of file qddshandler.cpp.
Referenced by DXTFillColors().
Definition at line 329 of file qddshandler.cpp.
Referenced by DXTFillColors().
Definition at line 334 of file qddshandler.cpp.
Referenced by DXTFillColors().
Definition at line 317 of file qddshandler.cpp.
References red.
Referenced by DXTFillColors().
|
static |
Definition at line 339 of file qddshandler.cpp.
References calcC2(), calcC2a(), calcC3(), decodeColor(), and qRgba().
Referenced by readDXT().
|
static |
Definition at line 1329 of file qddshandler.cpp.
References FormatName::format, formatNames, formatNamesSize, FormatUnknown, i, and QByteArray::toLower().
Referenced by QDDSHandler::setOption().
|
static |
Definition at line 1319 of file qddshandler.cpp.
References formatNames, formatNamesSize, i, and FormatName::name.
Referenced by QDDSHandler::option(), and QDDSHandler::write().
Definition at line 280 of file qddshandler.cpp.
References DDSPixelFormat::FlagFourCC, DDSPixelFormat::FlagPaletteIndexed4, DDSPixelFormat::FlagPaletteIndexed8, formatInfos, formatInfosSize, FormatP4, FormatP8, FormatUnknown, DDSPixelFormat::fourCC, i, info, knownFourCCs, knownFourCCsSize, and DDSHeader::pixelFormat.
Definition at line 309 of file qddshandler.cpp.
Referenced by readATI2(), and readCxV8U8().
|
inlinestatic |
Definition at line 263 of file qddshandler.cpp.
References DDSPixelFormat::FlagAlpha, DDSPixelFormat::FlagAlphaPixels, DDSPixelFormat::flags, and DDSHeader::pixelFormat.
Referenced by readCubeMap(), and readUnsignedImage().
|
inlinestatic |
Definition at line 268 of file qddshandler.cpp.
References DDSHeader::caps2, and DDSHeader::Caps2CubeMap.
Referenced by QRhiGles2::enqueueSubresUpload(), and QDDSHandler::read().
|
inlinestatic |
Definition at line 239 of file qddshandler.cpp.
Referenced by readUnsignedImage().
|
inlinestatic |
Definition at line 228 of file qddshandler.cpp.
Referenced by readUnsignedImage().
Definition at line 1283 of file qddshandler.cpp.
References i, and mipmapSize().
Referenced by QDDSHandler::read().
Definition at line 1187 of file qddshandler.cpp.
References FormatA1, FormatA16B16G16R16, FormatA16B16G16R16F, FormatA1R5G5B5, FormatA2B10G10R10, FormatA2B10G10R10_XR_BIAS, FormatA2R10G10B10, FormatA2W10V10U10, FormatA32B32G32R32F, FormatA4L4, FormatA4R4G4B4, FormatA8, FormatA8B8G8R8, FormatA8L8, FormatA8P8, FormatA8R3G3B2, FormatA8R8G8B8, FormatBinaryBuffer, FormatCxV8U8, FormatD15S1, FormatD16, FormatD16Lockable, FormatD24FS8, FormatD24S8, FormatD24X4S4, FormatD24X8, FormatD32, FormatD32FLockable, FormatD32Lockable, FormatDXT1, FormatDXT2, FormatDXT3, FormatDXT4, FormatDXT5, FormatG16R16, FormatG16R16F, FormatG32R32F, FormatG8R8G8B8, FormatIndex16, FormatIndex32, FormatL16, FormatL6V5U5, FormatL8, FormatLast, FormatMulti2ARGB8, FormatP8, FormatQ16W16V16U16, FormatQ8W8V8U8, FormatR16F, FormatR32F, FormatR5G6B5, FormatR8G8B8, FormatR8G8B8G8, FormatS8Lockable, FormatUYVY, FormatV16U16, FormatV8U8, FormatVertexData, FormatX1R5G5B5, FormatX4R4G4B4, FormatX8B8G8R8, FormatX8L8V8U8, FormatX8R8G8B8, FormatYUY2, DDSHeader::height, DDSHeader::pixelFormat, DDSPixelFormat::rgbBitCount, and DDSHeader::width.
Referenced by mipmapOffset().
|
static |
Definition at line 1053 of file qddshandler.cpp.
References line, qAlpha(), qBlue(), qGreen(), qRed(), QRgb, qRgba(), and readUnsignedImage().
Referenced by readLayer().
|
static |
Definition at line 949 of file qddshandler.cpp.
References QImage::Format_ARGB32, line, qint8, QRgb, and qRgba().
Referenced by readLayer().
|
static |
Definition at line 840 of file qddshandler.cpp.
References Alpha, Blue, ColorCount, colors, QImage::Format_ARGB32, Green, i, line, QRgb, qRgba(), and Red.
Referenced by readLayer().
|
static |
Definition at line 688 of file qddshandler.cpp.
References Alpha, Blue, ColorCount, colors, QImage::Format_ARGB32, Green, line, QRgb, qRgba(), readFloat16(), and Red.
Referenced by readLayer().
|
static |
Definition at line 737 of file qddshandler.cpp.
References Alpha, Blue, ColorCount, colors, QImage::Format_ARGB32, Green, line, QRgb, qRgba(), readFloat32(), and Red.
Referenced by readLayer().
|
static |
Definition at line 536 of file qddshandler.cpp.
References QImage::Format_RGB32, getNormalZ(), i, j, line, qAlpha(), qBlue(), QRgb, qRgb(), qRgba(), and setAlphaDXT< Five >().
Referenced by readLayer().
|
static |
Definition at line 1291 of file qddshandler.cpp.
References DDSHeader::caps2, faceFlags, faceOffsets, fmt, QImage::Format_ARGB32, QImage::Format_RGB32, hasAlpha(), DDSHeader::height, i, QRgb, readLayer(), DDSHeader::width, FaceOffset::x, and FaceOffset::y.
Referenced by QDDSHandler::read().
|
static |
Definition at line 774 of file qddshandler.cpp.
References QImage::Format_RGB32, getNormalZ(), line, qint8, QRgb, and qRgb().
Referenced by readLayer().
|
static |
Definition at line 466 of file qddshandler.cpp.
References DXTFillColors(), QImage::Format_ARGB32, QImage::Format_ARGB32_Premultiplied, Four, i, invertRXGBColors(), j, line, One, QRgb, RXGB, and Two.
|
inlinestatic |
Definition at line 506 of file qddshandler.cpp.
Referenced by readLayer().
|
inlinestatic |
Definition at line 511 of file qddshandler.cpp.
Referenced by readLayer().
|
inlinestatic |
Definition at line 516 of file qddshandler.cpp.
Referenced by readLayer().
|
inlinestatic |
Definition at line 521 of file qddshandler.cpp.
Referenced by readLayer().
|
inlinestatic |
Definition at line 526 of file qddshandler.cpp.
Referenced by readLayer().
|
static |
Definition at line 630 of file qddshandler.cpp.
Referenced by readARGB16F(), readR16F(), and readRG16F().
|
inlinestatic |
Definition at line 645 of file qddshandler.cpp.
References Q_ASSERT, and QDataStream::SinglePrecision.
Referenced by readARGB32F(), readR32F(), and readRG32F().
|
static |
Definition at line 1033 of file qddshandler.cpp.
References QImage::Format_RGB32, line, QRgb, and qRgb().
Referenced by readLayer().
|
static |
Definition at line 876 of file qddshandler.cpp.
References QImage::Format_ARGB32, line, qint8, QRgb, and qRgba().
Referenced by readLayer().
|
static |
Definition at line 1066 of file qddshandler.cpp.
References FormatA1, FormatA16B16G16R16, FormatA16B16G16R16F, FormatA1R5G5B5, FormatA2B10G10R10, FormatA2B10G10R10_XR_BIAS, FormatA2R10G10B10, FormatA2W10V10U10, FormatA32B32G32R32F, FormatA4L4, FormatA4P4, FormatA4R4G4B4, FormatA8, FormatA8B8G8R8, FormatA8L8, FormatA8P8, FormatA8R3G3B2, FormatA8R8G8B8, FormatATI2, FormatBinaryBuffer, FormatCxV8U8, FormatD15S1, FormatD16, FormatD16Lockable, FormatD24FS8, FormatD24S8, FormatD24X4S4, FormatD24X8, FormatD32, FormatD32FLockable, FormatD32Lockable, FormatDXT1, FormatDXT2, FormatDXT3, FormatDXT4, FormatDXT5, FormatG16R16, FormatG16R16F, FormatG32R32F, FormatG8R8G8B8, FormatIndex16, FormatIndex32, FormatL16, FormatL6V5U5, FormatL8, FormatLast, FormatMulti2ARGB8, FormatP4, FormatP8, FormatQ16W16V16U16, FormatQ8W8V8U8, FormatR16F, FormatR32F, FormatR3G3B2, FormatR5G6B5, FormatR8G8B8, FormatR8G8B8G8, FormatRXGB, FormatS8Lockable, FormatUYVY, FormatV16U16, FormatV8U8, FormatVertexData, FormatX1R5G5B5, FormatX4R4G4B4, FormatX8B8G8R8, FormatX8L8V8U8, FormatX8R8G8B8, FormatYUY2, readA2R10G10B10(), readA2W10V10U10(), readARGB16(), readARGB16F(), readARGB32F(), readATI2(), readCxV8U8(), readDXT1(), readDXT2(), readDXT3(), readDXT4(), readDXT5(), readG8R8G8B8(), readL6V5U5(), readPalette4Image(), readPalette8Image(), readQ16W16V16U16(), readQ8W8V8U8(), readR16F(), readR32F(), readR8G8B8G8(), readRG16F(), readRG32F(), readRXGB(), readUnsignedImage(), readUYVY(), readV16U16(), readV8U8(), readX8L8V8U8(), and readYUY2().
Referenced by readCubeMap(), and readTexture().
|
static |
Definition at line 815 of file qddshandler.cpp.
References QImage::Format_Indexed8, i, and qRgba().
Referenced by readLayer().
|
static |
Definition at line 795 of file qddshandler.cpp.
References QImage::Format_Indexed8, i, and qRgba().
Referenced by readLayer().
|
static |
Definition at line 754 of file qddshandler.cpp.
References Alpha, Blue, ColorCount, colors, QImage::Format_ARGB32, Green, i, line, QRgb, qRgba(), and Red.
Referenced by readLayer().
|
static |
Definition at line 911 of file qddshandler.cpp.
References Alpha, Blue, ColorCount, colors, QImage::Format_ARGB32, Green, i, line, qint8, QRgb, qRgba(), and Red.
Referenced by readLayer().
|
static |
Definition at line 657 of file qddshandler.cpp.
References QImage::Format_RGB32, line, QRgb, qRgba(), and readFloat16().
Referenced by readLayer().
|
static |
Definition at line 706 of file qddshandler.cpp.
References QImage::Format_RGB32, line, QRgb, qRgba(), and readFloat32().
Referenced by readLayer().
|
static |
Definition at line 992 of file qddshandler.cpp.
References QImage::Format_RGB32, line, QRgb, and qRgb().
Referenced by readLayer().
|
static |
Definition at line 672 of file qddshandler.cpp.
References QImage::Format_RGB32, line, QRgb, qRgba(), and readFloat16().
Referenced by readLayer().
|
static |
Definition at line 721 of file qddshandler.cpp.
References QImage::Format_RGB32, line, QRgb, qRgba(), and readFloat32().
Referenced by readLayer().
|
inlinestatic |
Definition at line 531 of file qddshandler.cpp.
Referenced by readLayer().
|
inlinestatic |
Definition at line 1180 of file qddshandler.cpp.
References DDSHeader::height, readLayer(), and DDSHeader::width.
Referenced by QDDSHandler::read().
|
static |
Definition at line 573 of file qddshandler.cpp.
References DDSPixelFormat::aBitMask, Alpha, DDSPixelFormat::bBitMask, Blue, ColorCount, colors, DDSPixelFormat::FlagLuminance, DDSPixelFormat::flags, DDSPixelFormat::FlagYUV, QImage::Format_ARGB32, QImage::Format_RGB32, DDSPixelFormat::gBitMask, Green, hasAlpha(), i, line, maskLength(), maskToShift(), DDSHeader::pixelFormat, QRgb, qRgba(), DDSPixelFormat::rBitMask, readValue(), Red, DDSPixelFormat::rgbBitCount, and yuv2rgb().
Referenced by readA2R10G10B10(), and readLayer().
|
static |
Definition at line 971 of file qddshandler.cpp.
References QImage::Format_RGB32, line, QRgb, and yuv2rgb().
Referenced by readLayer().
|
static |
Definition at line 931 of file qddshandler.cpp.
References QImage::Format_RGB32, line, QRgb, and qRgb().
Referenced by readLayer().
|
static |
Definition at line 860 of file qddshandler.cpp.
References QImage::Format_RGB32, line, qint8, QRgb, and qRgb().
Referenced by readLayer().
|
inlinestatic |
Definition at line 250 of file qddshandler.cpp.
References Q_ASSERT.
Referenced by readUnsignedImage().
|
static |
Definition at line 894 of file qddshandler.cpp.
References QImage::Format_ARGB32, line, qint8, QRgb, and qRgba().
Referenced by readLayer().
|
static |
Definition at line 1012 of file qddshandler.cpp.
References QImage::Format_RGB32, line, QRgb, and yuv2rgb().
Referenced by readLayer().
|
inline |
Definition at line 424 of file qddshandler.cpp.
References Q_UNUSED.
|
inline |
|
inline |
|
inline |
Definition at line 449 of file qddshandler.cpp.
Referenced by readATI2().
|
inline |
Definition at line 443 of file qddshandler.cpp.
|
inline |
Definition at line 455 of file qddshandler.cpp.
|
inline |
Definition at line 437 of file qddshandler.cpp.
|
inline |
Definition at line 431 of file qddshandler.cpp.
Definition at line 273 of file qddshandler.cpp.
References qRgb().
Referenced by readUnsignedImage(), readUYVY(), and readYUY2().
|
static |
Definition at line 39 of file qddshandler.cpp.
Referenced by QDDSHandler::write().
|
static |
Definition at line 43 of file qddshandler.cpp.
|
static |
Definition at line 40 of file qddshandler.cpp.
|
static |
|
static |
Definition at line 51 of file qddshandler.cpp.
Referenced by readCubeMap().
|
static |
Definition at line 73 of file qddshandler.cpp.
Referenced by getFormat().
|
static |
Definition at line 106 of file qddshandler.cpp.
Referenced by getFormat().
|
static |
Definition at line 138 of file qddshandler.cpp.
Referenced by formatByName(), and formatName().
|
static |
Definition at line 226 of file qddshandler.cpp.
Referenced by formatByName(), and formatName().
|
static |
Definition at line 42 of file qddshandler.cpp.
Referenced by QArrayData::allocate(), calculateBlockSize(), QQuick3DFileInstancing::loadFromBinaryFile(), QCalendarWidget::minimumSizeHint(), QRhiMetal::pipelineCacheData(), QRhiVulkan::pipelineCacheData(), qCalculateBlockSize(), qCalculateGrowingBlockSize(), QDDSHandler::read(), QArrayData::reallocateUnaligned(), QOpenGLProgramBinaryCache::save(), QHttpProtocolHandler::sendRequest(), QRhiD3D11::setPipelineCacheData(), QRhiGles2::setPipelineCacheData(), QRhiMetal::setPipelineCacheData(), QRhiVulkan::setPipelineCacheData(), and QTlsPrivate::TlsCryptographSchannel::transmit().
|
static |
|
static |
Definition at line 131 of file qddshandler.cpp.
Referenced by getFormat().
|
static |
Definition at line 44 of file qddshandler.cpp.