Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qddshandler.cpp File Reference

(8a62fb36a8c456fb4e1229cca8bfca88f6e57890)

#include "qddshandler.h"
#include <QtCore/qdebug.h>
#include <QtGui/qimage.h>
#include <cmath>
#include "ddsheader.h"
+ Include dependency graph for qddshandler.cpp:

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
}
 

Functions

static int maskToShift (quint32 mask)
 
static int maskLength (quint32 mask)
 
static quint32 readValue (QDataStream &s, quint32 size)
 
static bool hasAlpha (const DDSHeader &dds)
 
static bool isCubeMap (const DDSHeader &dds)
 
static QRgb yuv2rgb (quint8 Y, quint8 U, quint8 V)
 
static Format getFormat (const DDSHeader &dds)
 
static quint8 getNormalZ (quint8 nx, quint8 ny)
 
static void decodeColor (quint16 color, quint8 &red, quint8 &green, quint8 &blue)
 
static quint8 calcC2 (quint8 c0, quint8 c1)
 
static quint8 calcC2a (quint8 c0, quint8 c1)
 
static quint8 calcC3 (quint8 c0, quint8 c1)
 
static void DXTFillColors (QRgb *result, quint16 c0, quint16 c1, quint32 table, bool dxt1a=false)
 
template<DXTVersions version>
void setAlphaDXT32Helper (QRgb *rgbArr, quint64 alphas)
 
template<DXTVersions version>
void setAlphaDXT45Helper (QRgb *rgbArr, quint64 alphas)
 
template<DXTVersions version>
void setAlphaDXT (QRgb *rgbArr, quint64 alphas)
 
template<>
void setAlphaDXT< Two > (QRgb *rgbArr, quint64 alphas)
 
template<>
void setAlphaDXT< Three > (QRgb *rgbArr, quint64 alphas)
 
template<>
void setAlphaDXT< Four > (QRgb *rgbArr, quint64 alphas)
 
template<>
void setAlphaDXT< Five > (QRgb *rgbArr, quint64 alphas)
 
template<>
void setAlphaDXT< RXGB > (QRgb *rgbArr, quint64 alphas)
 
static QRgb invertRXGBColors (QRgb pixel)
 
template<DXTVersions version>
static QImage readDXT (QDataStream &s, quint32 width, quint32 height)
 
static QImage readDXT1 (QDataStream &s, quint32 width, quint32 height)
 
static QImage readDXT2 (QDataStream &s, quint32 width, quint32 height)
 
static QImage readDXT3 (QDataStream &s, quint32 width, quint32 height)
 
static QImage readDXT4 (QDataStream &s, quint32 width, quint32 height)
 
static QImage readDXT5 (QDataStream &s, quint32 width, quint32 height)
 
static QImage readRXGB (QDataStream &s, quint32 width, quint32 height)
 
static QImage readATI2 (QDataStream &s, quint32 width, quint32 height)
 
static QImage readUnsignedImage (QDataStream &s, const DDSHeader &dds, quint32 width, quint32 height, bool hasAlpha)
 
static double readFloat16 (QDataStream &s)
 
static float readFloat32 (QDataStream &s)
 
static QImage readR16F (QDataStream &s, const quint32 width, const quint32 height)
 
static QImage readRG16F (QDataStream &s, const quint32 width, const quint32 height)
 
static QImage readARGB16F (QDataStream &s, const quint32 width, const quint32 height)
 
static QImage readR32F (QDataStream &s, const quint32 width, const quint32 height)
 
static QImage readRG32F (QDataStream &s, const quint32 width, const quint32 height)
 
static QImage readARGB32F (QDataStream &s, const quint32 width, const quint32 height)
 
static QImage readQ16W16V16U16 (QDataStream &s, const quint32 width, const quint32 height)
 
static QImage readCxV8U8 (QDataStream &s, const quint32 width, const quint32 height)
 
static QImage readPalette8Image (QDataStream &s, quint32 width, quint32 height)
 
static QImage readPalette4Image (QDataStream &s, quint32 width, quint32 height)
 
static QImage readARGB16 (QDataStream &s, quint32 width, quint32 height)
 
static QImage readV8U8 (QDataStream &s, quint32 width, quint32 height)
 
static QImage readL6V5U5 (QDataStream &s, quint32 width, quint32 height)
 
static QImage readX8L8V8U8 (QDataStream &s, quint32 width, quint32 height)
 
static QImage readQ8W8V8U8 (QDataStream &s, quint32 width, quint32 height)
 
static QImage readV16U16 (QDataStream &s, quint32 width, quint32 height)
 
static QImage readA2W10V10U10 (QDataStream &s, quint32 width, quint32 height)
 
static QImage readUYVY (QDataStream &s, quint32 width, quint32 height)
 
static QImage readR8G8B8G8 (QDataStream &s, quint32 width, quint32 height)
 
static QImage readYUY2 (QDataStream &s, quint32 width, quint32 height)
 
static QImage readG8R8G8B8 (QDataStream &s, quint32 width, quint32 height)
 
static QImage readA2R10G10B10 (QDataStream &s, const DDSHeader &dds, quint32 width, quint32 height)
 
static QImage readLayer (QDataStream &s, const DDSHeader &dds, const int format, quint32 width, quint32 height)
 
static QImage readTexture (QDataStream &s, const DDSHeader &dds, const int format, const int mipmapLevel)
 
static qint64 mipmapSize (const DDSHeader &dds, const int format, const int level)
 
static qint64 mipmapOffset (const DDSHeader &dds, const int format, const int level)
 
static QImage readCubeMap (QDataStream &s, const DDSHeader &dds, const int fmt)
 
static QByteArray formatName (int format)
 
static int formatByName (const QByteArray &name)
 

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)
 

Enumeration Type Documentation

◆ Colors

enum Colors
Enumerator
Red 
Green 
Blue 
Alpha 
ColorCount 

Definition at line 20 of file qddshandler.cpp.

◆ DXTVersions

Enumerator
One 
Two 
Three 
Four 
Five 
RXGB 

Definition at line 28 of file qddshandler.cpp.

Function Documentation

◆ calcC2()

static quint8 calcC2 ( quint8 c0,
quint8 c1 )
inlinestatic

Definition at line 324 of file qddshandler.cpp.

Referenced by DXTFillColors().

+ Here is the caller graph for this function:

◆ calcC2a()

static quint8 calcC2a ( quint8 c0,
quint8 c1 )
inlinestatic

Definition at line 329 of file qddshandler.cpp.

Referenced by DXTFillColors().

+ Here is the caller graph for this function:

◆ calcC3()

static quint8 calcC3 ( quint8 c0,
quint8 c1 )
inlinestatic

Definition at line 334 of file qddshandler.cpp.

Referenced by DXTFillColors().

+ Here is the caller graph for this function:

◆ decodeColor()

static void decodeColor ( quint16 color,
quint8 & red,
quint8 & green,
quint8 & blue )
inlinestatic

Definition at line 317 of file qddshandler.cpp.

References red.

Referenced by DXTFillColors().

+ Here is the caller graph for this function:

◆ DXTFillColors()

static void DXTFillColors ( QRgb * result,
quint16 c0,
quint16 c1,
quint32 table,
bool dxt1a = false )
static

Definition at line 339 of file qddshandler.cpp.

References calcC2(), calcC2a(), calcC3(), decodeColor(), and qRgba().

Referenced by readDXT().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ formatByName()

static int formatByName ( const QByteArray & name)
static

Definition at line 1329 of file qddshandler.cpp.

References formatNames, formatNamesSize, FormatUnknown, i, QByteArray(), and QByteArray::toLower().

Referenced by QDDSHandler::setOption().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ formatName()

static QByteArray formatName ( int format)
static

Definition at line 1319 of file qddshandler.cpp.

References formatNames, formatNamesSize, and i.

Referenced by QDDSHandler::option(), and QDDSHandler::write().

+ Here is the caller graph for this function:

◆ getFormat()

◆ getNormalZ()

static quint8 getNormalZ ( quint8 nx,
quint8 ny )
inlinestatic

Definition at line 309 of file qddshandler.cpp.

Referenced by readATI2(), and readCxV8U8().

+ Here is the caller graph for this function:

◆ hasAlpha()

static bool hasAlpha ( const DDSHeader & dds)
inlinestatic

Definition at line 263 of file qddshandler.cpp.

References DDSPixelFormat::FlagAlpha, and DDSPixelFormat::FlagAlphaPixels.

Referenced by readCubeMap(), and readUnsignedImage().

+ Here is the caller graph for this function:

◆ invertRXGBColors()

static QRgb invertRXGBColors ( QRgb pixel)
inlinestatic

Definition at line 460 of file qddshandler.cpp.

References qAlpha(), qBlue(), qGreen(), and qRgb().

Referenced by readDXT().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isCubeMap()

static bool isCubeMap ( const DDSHeader & dds)
inlinestatic

Definition at line 268 of file qddshandler.cpp.

References DDSHeader::Caps2CubeMap.

Referenced by QRhiGles2::enqueueSubresUpload(), and QDDSHandler::read().

+ Here is the caller graph for this function:

◆ maskLength()

static int maskLength ( quint32 mask)
inlinestatic

Definition at line 239 of file qddshandler.cpp.

Referenced by readUnsignedImage().

+ Here is the caller graph for this function:

◆ maskToShift()

static int maskToShift ( quint32 mask)
inlinestatic

Definition at line 228 of file qddshandler.cpp.

Referenced by readUnsignedImage().

+ Here is the caller graph for this function:

◆ mipmapOffset()

static qint64 mipmapOffset ( const DDSHeader & dds,
const int format,
const int level )
static

Definition at line 1283 of file qddshandler.cpp.

References i, and mipmapSize().

Referenced by QDDSHandler::read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mipmapSize()

◆ readA2R10G10B10()

static QImage readA2R10G10B10 ( QDataStream & s,
const DDSHeader & dds,
quint32 width,
quint32 height )
static

Definition at line 1053 of file qddshandler.cpp.

References line, qAlpha(), qBlue(), qGreen(), qRed(), QRgb, qRgba(), and readUnsignedImage().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readA2W10V10U10()

static QImage readA2W10V10U10 ( QDataStream & s,
quint32 width,
quint32 height )
static

Definition at line 949 of file qddshandler.cpp.

References QImage::Format_ARGB32, line, qint8, QRgb, and qRgba().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readARGB16()

static QImage readARGB16 ( QDataStream & s,
quint32 width,
quint32 height )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readARGB16F()

static QImage readARGB16F ( QDataStream & s,
const quint32 width,
const quint32 height )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readARGB32F()

static QImage readARGB32F ( QDataStream & s,
const quint32 width,
const quint32 height )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readATI2()

static QImage readATI2 ( QDataStream & s,
quint32 width,
quint32 height )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readCubeMap()

static QImage readCubeMap ( QDataStream & s,
const DDSHeader & dds,
const int fmt )
static

Definition at line 1291 of file qddshandler.cpp.

References faceFlags, faceOffsets, fmt, QImage::Format_ARGB32, QImage::Format_RGB32, hasAlpha(), i, QRgb, and readLayer().

Referenced by QDDSHandler::read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readCxV8U8()

static QImage readCxV8U8 ( QDataStream & s,
const quint32 width,
const quint32 height )
static

Definition at line 774 of file qddshandler.cpp.

References QImage::Format_RGB32, getNormalZ(), line, qint8, QRgb, and qRgb().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readDXT()

template<DXTVersions version>
static QImage readDXT ( QDataStream & s,
quint32 width,
quint32 height )
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.

+ Here is the call graph for this function:

◆ readDXT1()

static QImage readDXT1 ( QDataStream & s,
quint32 width,
quint32 height )
inlinestatic

Definition at line 506 of file qddshandler.cpp.

Referenced by readLayer().

+ Here is the caller graph for this function:

◆ readDXT2()

static QImage readDXT2 ( QDataStream & s,
quint32 width,
quint32 height )
inlinestatic

Definition at line 511 of file qddshandler.cpp.

Referenced by readLayer().

+ Here is the caller graph for this function:

◆ readDXT3()

static QImage readDXT3 ( QDataStream & s,
quint32 width,
quint32 height )
inlinestatic

Definition at line 516 of file qddshandler.cpp.

Referenced by readLayer().

+ Here is the caller graph for this function:

◆ readDXT4()

static QImage readDXT4 ( QDataStream & s,
quint32 width,
quint32 height )
inlinestatic

Definition at line 521 of file qddshandler.cpp.

Referenced by readLayer().

+ Here is the caller graph for this function:

◆ readDXT5()

static QImage readDXT5 ( QDataStream & s,
quint32 width,
quint32 height )
inlinestatic

Definition at line 526 of file qddshandler.cpp.

Referenced by readLayer().

+ Here is the caller graph for this function:

◆ readFloat16()

static double readFloat16 ( QDataStream & s)
static

Definition at line 630 of file qddshandler.cpp.

References qint8, and sign().

Referenced by readARGB16F(), readR16F(), and readRG16F().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readFloat32()

static float readFloat32 ( QDataStream & s)
inlinestatic

Definition at line 645 of file qddshandler.cpp.

References Q_ASSERT.

Referenced by readARGB32F(), readR32F(), and readRG32F().

+ Here is the caller graph for this function:

◆ readG8R8G8B8()

static QImage readG8R8G8B8 ( QDataStream & s,
quint32 width,
quint32 height )
static

Definition at line 1033 of file qddshandler.cpp.

References QImage::Format_RGB32, line, QRgb, and qRgb().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readL6V5U5()

static QImage readL6V5U5 ( QDataStream & s,
quint32 width,
quint32 height )
static

Definition at line 876 of file qddshandler.cpp.

References QImage::Format_ARGB32, line, qint8, QRgb, and qRgba().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readLayer()

static QImage readLayer ( QDataStream & s,
const DDSHeader & dds,
const int format,
quint32 width,
quint32 height )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readPalette4Image()

static QImage readPalette4Image ( QDataStream & s,
quint32 width,
quint32 height )
static

Definition at line 815 of file qddshandler.cpp.

References QImage::Format_Indexed8, i, and qRgba().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readPalette8Image()

static QImage readPalette8Image ( QDataStream & s,
quint32 width,
quint32 height )
static

Definition at line 795 of file qddshandler.cpp.

References QImage::Format_Indexed8, i, and qRgba().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readQ16W16V16U16()

static QImage readQ16W16V16U16 ( QDataStream & s,
const quint32 width,
const quint32 height )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readQ8W8V8U8()

static QImage readQ8W8V8U8 ( QDataStream & s,
quint32 width,
quint32 height )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readR16F()

static QImage readR16F ( QDataStream & s,
const quint32 width,
const quint32 height )
static

Definition at line 657 of file qddshandler.cpp.

References QImage::Format_RGB32, line, QRgb, qRgba(), and readFloat16().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readR32F()

static QImage readR32F ( QDataStream & s,
const quint32 width,
const quint32 height )
static

Definition at line 706 of file qddshandler.cpp.

References QImage::Format_RGB32, line, QRgb, qRgba(), and readFloat32().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readR8G8B8G8()

static QImage readR8G8B8G8 ( QDataStream & s,
quint32 width,
quint32 height )
static

Definition at line 992 of file qddshandler.cpp.

References QImage::Format_RGB32, line, QRgb, and qRgb().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readRG16F()

static QImage readRG16F ( QDataStream & s,
const quint32 width,
const quint32 height )
static

Definition at line 672 of file qddshandler.cpp.

References QImage::Format_RGB32, line, QRgb, qRgba(), and readFloat16().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readRG32F()

static QImage readRG32F ( QDataStream & s,
const quint32 width,
const quint32 height )
static

Definition at line 721 of file qddshandler.cpp.

References QImage::Format_RGB32, line, QRgb, qRgba(), and readFloat32().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readRXGB()

static QImage readRXGB ( QDataStream & s,
quint32 width,
quint32 height )
inlinestatic

Definition at line 531 of file qddshandler.cpp.

Referenced by readLayer().

+ Here is the caller graph for this function:

◆ readTexture()

static QImage readTexture ( QDataStream & s,
const DDSHeader & dds,
const int format,
const int mipmapLevel )
inlinestatic

Definition at line 1180 of file qddshandler.cpp.

References readLayer().

Referenced by QDDSHandler::read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readUnsignedImage()

static QImage readUnsignedImage ( QDataStream & s,
const DDSHeader & dds,
quint32 width,
quint32 height,
bool hasAlpha )
static

Definition at line 573 of file qddshandler.cpp.

References Alpha, Blue, ColorCount, colors, DDSPixelFormat::FlagLuminance, DDSPixelFormat::FlagYUV, QImage::Format_ARGB32, QImage::Format_RGB32, Green, hasAlpha(), i, line, maskLength(), maskToShift(), QRgb, qRgba(), readValue(), Red, and yuv2rgb().

Referenced by readA2R10G10B10(), and readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readUYVY()

static QImage readUYVY ( QDataStream & s,
quint32 width,
quint32 height )
static

Definition at line 971 of file qddshandler.cpp.

References QImage::Format_RGB32, line, QRgb, and yuv2rgb().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readV16U16()

static QImage readV16U16 ( QDataStream & s,
quint32 width,
quint32 height )
static

Definition at line 931 of file qddshandler.cpp.

References QImage::Format_RGB32, line, QRgb, and qRgb().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readV8U8()

static QImage readV8U8 ( QDataStream & s,
quint32 width,
quint32 height )
static

Definition at line 860 of file qddshandler.cpp.

References QImage::Format_RGB32, line, qint8, QRgb, and qRgb().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readValue()

static quint32 readValue ( QDataStream & s,
quint32 size )
inlinestatic

Definition at line 250 of file qddshandler.cpp.

References Q_ASSERT.

Referenced by readUnsignedImage().

+ Here is the caller graph for this function:

◆ readX8L8V8U8()

static QImage readX8L8V8U8 ( QDataStream & s,
quint32 width,
quint32 height )
static

Definition at line 894 of file qddshandler.cpp.

References QImage::Format_ARGB32, line, qint8, QRgb, and qRgba().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readYUY2()

static QImage readYUY2 ( QDataStream & s,
quint32 width,
quint32 height )
static

Definition at line 1012 of file qddshandler.cpp.

References QImage::Format_RGB32, line, QRgb, and yuv2rgb().

Referenced by readLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAlphaDXT()

template<DXTVersions version>
void setAlphaDXT ( QRgb * rgbArr,
quint64 alphas )
inline

Definition at line 424 of file qddshandler.cpp.

References Q_UNUSED.

◆ setAlphaDXT32Helper()

template<DXTVersions version>
void setAlphaDXT32Helper ( QRgb * rgbArr,
quint64 alphas )
inline

Definition at line 374 of file qddshandler.cpp.

References i, Q_STATIC_ASSERT, qBlue(), qGreen(), qRed(), QRgb, qRgba(), rgb, Three, and Two.

+ Here is the call graph for this function:

◆ setAlphaDXT45Helper()

template<DXTVersions version>
void setAlphaDXT45Helper ( QRgb * rgbArr,
quint64 alphas )
inline

Definition at line 389 of file qddshandler.cpp.

References Five, Four, i, Q_STATIC_ASSERT, qBlue(), qGreen(), qRed(), QRgb, qRgba(), and rgb.

+ Here is the call graph for this function:

◆ setAlphaDXT< Five >()

template<>
void setAlphaDXT< Five > ( QRgb * rgbArr,
quint64 alphas )
inline

Definition at line 449 of file qddshandler.cpp.

Referenced by readATI2().

+ Here is the caller graph for this function:

◆ setAlphaDXT< Four >()

template<>
void setAlphaDXT< Four > ( QRgb * rgbArr,
quint64 alphas )
inline

Definition at line 443 of file qddshandler.cpp.

◆ setAlphaDXT< RXGB >()

template<>
void setAlphaDXT< RXGB > ( QRgb * rgbArr,
quint64 alphas )
inline

Definition at line 455 of file qddshandler.cpp.

◆ setAlphaDXT< Three >()

template<>
void setAlphaDXT< Three > ( QRgb * rgbArr,
quint64 alphas )
inline

Definition at line 437 of file qddshandler.cpp.

◆ setAlphaDXT< Two >()

template<>
void setAlphaDXT< Two > ( QRgb * rgbArr,
quint64 alphas )
inline

Definition at line 431 of file qddshandler.cpp.

◆ yuv2rgb()

static QRgb yuv2rgb ( quint8 Y,
quint8 U,
quint8 V )
inlinestatic

Definition at line 273 of file qddshandler.cpp.

References qRgb().

Referenced by readUnsignedImage(), readUYVY(), and readYUY2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ ddsMagic

const quint32 ddsMagic = 0x20534444
static

Definition at line 39 of file qddshandler.cpp.

Referenced by QDDSHandler::write().

◆ ddsSize

const quint32 ddsSize = 124
static

Definition at line 43 of file qddshandler.cpp.

◆ dx10Magic

const quint32 dx10Magic = 0x30315844
static

Definition at line 40 of file qddshandler.cpp.

◆ faceFlags

◆ faceOffsets

const FaceOffset faceOffsets[6] = { {2, 1}, {0, 1}, {1, 0}, {1, 2}, {1, 1}, {3, 1} }
static

Definition at line 51 of file qddshandler.cpp.

Referenced by readCubeMap().

◆ formatInfos

const FormatInfo formatInfos[]
static

Definition at line 73 of file qddshandler.cpp.

Referenced by getFormat().

◆ formatInfosSize

const size_t formatInfosSize = sizeof(formatInfos)/sizeof(FormatInfo)
static

Definition at line 106 of file qddshandler.cpp.

Referenced by getFormat().

◆ formatNames

const FormatName formatNames[]
static

Definition at line 138 of file qddshandler.cpp.

Referenced by formatByName(), and formatName().

◆ formatNamesSize

const size_t formatNamesSize = sizeof(formatNames)/sizeof(FormatName)
static

Definition at line 226 of file qddshandler.cpp.

Referenced by formatByName(), and formatName().

◆ headerSize

◆ knownFourCCs

const Format knownFourCCs[]
static
Initial value:
= {
}
@ FormatA32B32G32R32F
Definition ddsheader.h:91
@ FormatUYVY
Definition ddsheader.h:49
@ FormatRXGB
Definition ddsheader.h:58
@ FormatR8G8B8G8
Definition ddsheader.h:50
@ FormatCxV8U8
Definition ddsheader.h:93
@ FormatDXT4
Definition ddsheader.h:56
@ FormatDXT5
Definition ddsheader.h:57
@ FormatV8U8
Definition ddsheader.h:42
@ FormatG16R16F
Definition ddsheader.h:86
@ FormatDXT3
Definition ddsheader.h:55
@ FormatA16B16G16R16
Definition ddsheader.h:33
@ FormatDXT2
Definition ddsheader.h:54
@ FormatR32F
Definition ddsheader.h:89
@ FormatQ16W16V16U16
Definition ddsheader.h:81
@ FormatA16B16G16R16F
Definition ddsheader.h:87
@ FormatATI2
Definition ddsheader.h:59
@ FormatG8R8G8B8
Definition ddsheader.h:52
@ FormatG32R32F
Definition ddsheader.h:90
@ FormatYUY2
Definition ddsheader.h:51
@ FormatR16F
Definition ddsheader.h:85
@ FormatDXT1
Definition ddsheader.h:53

Definition at line 108 of file qddshandler.cpp.

Referenced by getFormat().

◆ knownFourCCsSize

const size_t knownFourCCsSize = sizeof(knownFourCCs)/sizeof(Format)
static

Definition at line 131 of file qddshandler.cpp.

Referenced by getFormat().

◆ pixelFormatSize

const quint32 pixelFormatSize = 32
static

Definition at line 44 of file qddshandler.cpp.