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
ICOReader Class Reference
+ Collaboration diagram for ICOReader:

Public Member Functions

 ICOReader (QIODevice *iodevice)
 
int count ()
 
QImage iconAt (int index)
 
bool readIconEntry (int index, ICONDIRENTRY *iconEntry)
 

Static Public Member Functions

static bool canRead (QIODevice *iodev)
 
static QList< QImageread (QIODevice *device)
 Reads all the icons from the given device, and returns them as a list of QImage objects.
 
static bool write (QIODevice *device, const QList< QImage > &images)
 Writes all the QImages in the images list to the given device.
 

Detailed Description

Definition at line 69 of file qicohandler.cpp.

Constructor & Destructor Documentation

◆ ICOReader()

ICOReader::ICOReader ( QIODevice * iodevice)

Definition at line 156 of file qicohandler.cpp.

Member Function Documentation

◆ canRead()

bool ICOReader::canRead ( QIODevice * iodev)
static

Definition at line 171 of file qicohandler.cpp.

References QIODevice::isSequential(), QIODevice::pos(), readIconDir(), readIconDirEntry(), QIODevice::seek(), and QIODevice::ungetChar().

Referenced by QtIcoHandler::canRead(), and QtIcoHandler::canRead().

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

◆ count()

int ICOReader::count ( )

Definition at line 164 of file qicohandler.cpp.

Referenced by iconAt(), and QtIcoHandler::imageCount().

+ Here is the caller graph for this function:

◆ iconAt()

QImage ICOReader::iconAt ( int index)

Definition at line 426 of file qicohandler.cpp.

References QImageIOHandler::allocateImage(), QIODevice::bytesAvailable(), count(), QImage::Format_ARGB32, QImage::Format_ARGB32_Premultiplied, QImage::Format_Indexed8, QImage::Format_Mono, QImage::Format_RGB32, QImage::fromData(), QByteArray::fromRawData(), header(), icoOrigDepthKey, QString::number(), qRgba(), QIODevice::read(), readIconEntry(), and QIODevice::seek().

Referenced by QtIcoHandler::read().

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

◆ read()

QList< QImage > ICOReader::read ( QIODevice * device)
static

Reads all the icons from the given device, and returns them as a list of QImage objects.

Each image has an alpha channel that represents the mask from the corresponding icon.

See also
write()

Definition at line 538 of file qicohandler.cpp.

References device, i, images, and QList< T >::reserve().

+ Here is the call graph for this function:

◆ readIconEntry()

bool ICOReader::readIconEntry ( int index,
ICONDIRENTRY * iconEntry )

Definition at line 254 of file qicohandler.cpp.

References ICONDIR_SIZE, ICONDIRENTRY_SIZE, readIconDirEntry(), and QIODevice::seek().

Referenced by iconAt(), and QtIcoHandler::option().

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

◆ write()

bool ICOReader::write ( QIODevice * device,
const QList< QImage > & images )
static

Writes all the QImages in the images list to the given device.

Returns true if the images are written successfully; otherwise returns false.

The first image in the list is stored as the first icon in the device, and is therefore used as the default icon by applications. The alpha channel of each image is converted to a mask for each corresponding icon.

See also
read()

Definition at line 564 of file qicohandler.cpp.

References BMP_INFOHDR_SIZE, Qt::color1, device, QImage::Format_ARGB32, QImage::Format_Mono, i, ICONDIR_SIZE, ICONDIRENTRY_SIZE, imageData, images, Qt::KeepAspectRatio, qAlpha(), qBlue(), qGreen(), qRed(), QRgb, QList< T >::size(), Qt::SmoothTransformation, writeBMPInfoHeader(), writeIconDir(), writeIconDirEntry(), and QIODeviceBase::WriteOnly.

Referenced by QtIcoHandler::write().

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

The documentation for this class was generated from the following file: