Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qicnshandler.cpp File Reference

(efd332516f510144927121fa749ce819b82ec633)

#include "qicnshandler_p.h"
#include <QtCore/qmath.h>
#include <QtCore/qendian.h>
#include <QtCore/qregularexpression.h>
#include <QtCore/qbuffer.h>
#include <QtGui/qimage.h>
Include dependency graph for qicnshandler.cpp:

Go to the source code of this file.

Functions

 Q_STATIC_ASSERT (sizeof(ICNSColorTableMono)/sizeof(ICNSColorTableMono[0])==(1<< ICNSEntry::DepthMono))
 Q_STATIC_ASSERT (sizeof(ICNSColorTable4bit)/sizeof(ICNSColorTable4bit[0])==(1<< ICNSEntry::Depth4bit))
 Q_STATIC_ASSERT (sizeof(ICNSColorTable8bit)/sizeof(ICNSColorTable8bit[0])==(1<< ICNSEntry::Depth8bit))
static QDataStreamoperator>> (QDataStream &in, ICNSBlockHeader &p)
static QDataStreamoperator<< (QDataStream &out, const ICNSBlockHeader &p)
static bool isPowOf2OrDividesBy16 (quint32 u, qreal r)
static bool isBlockHeaderValid (const ICNSBlockHeader &header, quint64 bound=0)
static bool isIconCompressed (const ICNSEntry &icon)
static bool isMaskSuitable (const ICNSEntry &mask, const ICNSEntry &icon, ICNSEntry::Depth target)
static QByteArray nameFromOSType (quint32 ostype)
static quint32 nameToOSType (const QByteArray &ostype)
static QByteArray nameForCompressedIcon (quint8 iconNumber)
static QList< QRgbgetColorTable (ICNSEntry::Depth depth)
static bool parseIconEntryData (ICNSEntry &icon, QIODevice *device)
static bool parseIconEntryInfo (ICNSEntry &icon)
static QImage readMask (const ICNSEntry &mask, QDataStream &stream)
template<ICNSEntry::Depth depth>
static QImage readLowDepthIcon (const ICNSEntry &icon, QDataStream &stream)
static QImage read32bitIcon (const ICNSEntry &icon, QDataStream &stream)

Variables

static QT_BEGIN_NAMESPACE const quint8 ICNSBlockHeaderSize = 8
static const QRgb ICNSColorTableMono []
static const QRgb ICNSColorTable4bit []
static const QRgb ICNSColorTable8bit []

Function Documentation

◆ getColorTable()

QList< QRgb > getColorTable ( ICNSEntry::Depth depth)
inlinestatic

◆ isBlockHeaderValid()

bool isBlockHeaderValid ( const ICNSBlockHeader & header,
quint64 bound = 0 )
inlinestatic

Definition at line 325 of file qicnshandler.cpp.

References ICNSBlockHeaderSize.

◆ isIconCompressed()

bool isIconCompressed ( const ICNSEntry & icon)
inlinestatic

Definition at line 334 of file qicnshandler.cpp.

References ICNSEntry::dataFormat, ICNSEntry::JP2, and ICNSEntry::PNG.

Referenced by parseIconEntryInfo().

Here is the caller graph for this function:

◆ isMaskSuitable()

bool isMaskSuitable ( const ICNSEntry & mask,
const ICNSEntry & icon,
ICNSEntry::Depth target )
inlinestatic

Definition at line 339 of file qicnshandler.cpp.

References ICNSEntry::depth.

◆ isPowOf2OrDividesBy16()

bool isPowOf2OrDividesBy16 ( quint32 u,
qreal r )
inlinestatic

Definition at line 320 of file qicnshandler.cpp.

◆ nameForCompressedIcon()

QByteArray nameForCompressedIcon ( quint8 iconNumber)
inlinestatic

Definition at line 358 of file qicnshandler.cpp.

◆ nameFromOSType()

QByteArray nameFromOSType ( quint32 ostype)
inlinestatic

Definition at line 345 of file qicnshandler.cpp.

◆ nameToOSType()

quint32 nameToOSType ( const QByteArray & ostype)
inlinestatic

Definition at line 351 of file qicnshandler.cpp.

◆ operator<<()

QDataStream & operator<< ( QDataStream & out,
const ICNSBlockHeader & p )
inlinestatic

Definition at line 313 of file qicnshandler.cpp.

◆ operator>>()

QDataStream & operator>> ( QDataStream & in,
ICNSBlockHeader & p )
inlinestatic

Definition at line 306 of file qicnshandler.cpp.

◆ parseIconEntryData()

bool parseIconEntryData ( ICNSEntry & icon,
QIODevice * device )
static

◆ parseIconEntryInfo()

bool parseIconEntryInfo ( ICNSEntry & icon)
static

◆ Q_STATIC_ASSERT() [1/3]

Q_STATIC_ASSERT ( sizeof(ICNSColorTable4bit)/sizeof(ICNSColorTable4bit[0]) = =(1<< ICNSEntry::Depth4bit))

◆ Q_STATIC_ASSERT() [2/3]

Q_STATIC_ASSERT ( sizeof(ICNSColorTable8bit)/sizeof(ICNSColorTable8bit[0]) = =(1<< ICNSEntry::Depth8bit))

◆ Q_STATIC_ASSERT() [3/3]

Q_STATIC_ASSERT ( sizeof(ICNSColorTableMono)/sizeof(ICNSColorTableMono[0]) = =(1<< ICNSEntry::DepthMono))

◆ read32bitIcon()

QImage read32bitIcon ( const ICNSEntry & icon,
QDataStream & stream )
static

Definition at line 575 of file qicnshandler.cpp.

References ICNSEntry::dataFormat, and ICNSEntry::RLE24.

◆ readLowDepthIcon()

template<ICNSEntry::Depth depth>
QImage readLowDepthIcon ( const ICNSEntry & icon,
QDataStream & stream )
static

Definition at line 534 of file qicnshandler.cpp.

References ICNSEntry::Depth4bit, ICNSEntry::Depth8bit, ICNSEntry::DepthMono, and Q_STATIC_ASSERT().

Here is the call graph for this function:

◆ readMask()

QImage readMask ( const ICNSEntry & mask,
QDataStream & stream )
static

Variable Documentation

◆ ICNSBlockHeaderSize

QT_BEGIN_NAMESPACE const quint8 ICNSBlockHeaderSize = 8
static

Definition at line 18 of file qicnshandler.cpp.

Referenced by isBlockHeaderValid().

◆ ICNSColorTable4bit

const QRgb ICNSColorTable4bit
static
Initial value:
= {
qRgb(0xFF, 0xFF, 0xFF),
qRgb(0xFC, 0xF3, 0x05),
qRgb(0xFF, 0x64, 0x02),
qRgb(0xDD, 0x08, 0x06),
qRgb(0xF2, 0x08, 0x84),
qRgb(0x46, 0x00, 0xA5),
qRgb(0x00, 0x00, 0xD4),
qRgb(0x02, 0xAB, 0xEA),
qRgb(0x1F, 0xB7, 0x14),
qRgb(0x00, 0x64, 0x11),
qRgb(0x56, 0x2C, 0x05),
qRgb(0x90, 0x71, 0x3A),
qRgb(0xC0, 0xC0, 0xC0),
qRgb(0x80, 0x80, 0x80),
qRgb(0x40, 0x40, 0x40),
qRgb(0x00, 0x00, 0x00)
}
constexpr QRgb qRgb(int r, int g, int b)
Definition qrgb.h:30

Definition at line 26 of file qicnshandler.cpp.

◆ ICNSColorTable8bit

const QRgb ICNSColorTable8bit
static

Definition at line 46 of file qicnshandler.cpp.

◆ ICNSColorTableMono

const QRgb ICNSColorTableMono
static
Initial value:
= {
qRgb(0xFF, 0xFF, 0xFF),
qRgb(0x00, 0x00, 0x00)
}

Definition at line 20 of file qicnshandler.cpp.