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
qbmphandler.cpp File Reference

(a5e27d022def188328dcc767e25485d37dcd6a9a)

#include "private/qbmphandler_p.h"
#include <qimage.h>
#include <qlist.h>
#include <qvariant.h>
+ Include dependency graph for qbmphandler.cpp:

Go to the source code of this file.

Functions

static QT_BEGIN_NAMESPACE void swapPixel01 (QImage *image)
 
static QDataStreamoperator>> (QDataStream &s, BMP_FILEHDR &bf)
 
static QDataStreamoperator<< (QDataStream &s, const BMP_FILEHDR &bf)
 
static QDataStreamoperator>> (QDataStream &s, BMP_INFOHDR &bi)
 
static QDataStreamoperator<< (QDataStream &s, const BMP_INFOHDR &bi)
 
static uint calc_shift (uint mask)
 
static uint calc_scale (uint low_mask)
 
static uint apply_scale (uint value, uint scale)
 
static bool read_dib_fileheader (QDataStream &s, BMP_FILEHDR &bf)
 
static bool read_dib_infoheader (QDataStream &s, BMP_INFOHDR &bi)
 
static bool read_dib_body (QDataStream &s, const BMP_INFOHDR &bi, qint64 datapos, qint64 startpos, QImage &image)
 
bool qt_write_dib (QDataStream &s, const QImage &image, int bpl, int bpl_bmp, int nbits)
 

Variables

const int BMP_FILEHDR_SIZE = 14
 
const int BMP_OLD = 12
 
const int BMP_WIN = 40
 
const int BMP_OS2 = 64
 
const int BMP_WIN4 = 108
 
const int BMP_WIN5 = 124
 
const int BMP_RGB = 0
 
const int BMP_RLE8 = 1
 
const int BMP_RLE4 = 2
 
const int BMP_BITFIELDS = 3
 
const int BMP_ALPHABITFIELDS = 4
 

Function Documentation

◆ apply_scale()

static uint apply_scale ( uint value,
uint scale )
inlinestatic

Definition at line 158 of file qbmphandler.cpp.

Referenced by read_dib_body().

+ Here is the caller graph for this function:

◆ calc_scale()

static uint calc_scale ( uint low_mask)
static

Definition at line 148 of file qbmphandler.cpp.

Referenced by read_dib_body().

+ Here is the caller graph for this function:

◆ calc_shift()

static uint calc_shift ( uint mask)
static

Definition at line 138 of file qbmphandler.cpp.

Referenced by read_dib_body().

+ Here is the caller graph for this function:

◆ operator<<() [1/2]

static QDataStream & operator<< ( QDataStream & s,
const BMP_FILEHDR & bf )
static

Definition at line 53 of file qbmphandler.cpp.

◆ operator<<() [2/2]

static QDataStream & operator<< ( QDataStream & s,
const BMP_INFOHDR & bi )
static

Definition at line 105 of file qbmphandler.cpp.

References BMP_WIN4, BMP_WIN5, and i.

◆ operator>>() [1/2]

static QDataStream & operator>> ( QDataStream & s,
BMP_FILEHDR & bf )
static

Definition at line 46 of file qbmphandler.cpp.

◆ operator>>() [2/2]

static QDataStream & operator>> ( QDataStream & s,
BMP_INFOHDR & bi )
static

Definition at line 74 of file qbmphandler.cpp.

References BMP_OS2, BMP_RGB, BMP_WIN, BMP_WIN4, BMP_WIN5, and i.

◆ qt_write_dib()

bool qt_write_dib ( QDataStream & s,
const QImage & image,
int bpl,
int bpl_bmp,
int nbits )

Definition at line 585 of file qbmphandler.cpp.

References BMP_INFOHDR::biSize, BMP_RGB, BMP_WIN, d, i, qBlue(), qGreen(), qRed(), QRgb, and rgb.

Referenced by QBmpHandler::write().

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

◆ read_dib_body()

static bool read_dib_body ( QDataStream & s,
const BMP_INFOHDR & bi,
qint64 datapos,
qint64 startpos,
QImage & image )
static

Definition at line 210 of file qbmphandler.cpp.

References QImageIOHandler::allocateImage(), apply_scale(), BMP_ALPHABITFIELDS, BMP_BITFIELDS, BMP_OLD, BMP_RGB, BMP_RLE4, BMP_RLE8, BMP_WIN4, calc_scale(), calc_shift(), d, QImage::Format_ARGB32, QImage::Format_Indexed8, QImage::Format_Mono, QImage::Format_RGB32, i, qDebug, qGray(), QRgb, qRgb(), qRgba(), rgb, and swapPixel01().

Referenced by QBmpHandler::read().

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

◆ read_dib_fileheader()

static bool read_dib_fileheader ( QDataStream & s,
BMP_FILEHDR & bf )
static

Definition at line 174 of file qbmphandler.cpp.

References qstrncmp().

+ Here is the call graph for this function:

◆ read_dib_infoheader()

static bool read_dib_infoheader ( QDataStream & s,
BMP_INFOHDR & bi )
static

Definition at line 188 of file qbmphandler.cpp.

References BMP_BITFIELDS, BMP_RGB, BMP_RLE4, BMP_RLE8, and qAbs().

+ Here is the call graph for this function:

◆ swapPixel01()

static QT_BEGIN_NAMESPACE void swapPixel01 ( QImage * image)
static

Definition at line 14 of file qbmphandler.cpp.

References i, p2, and QRgb.

Referenced by read_dib_body().

+ Here is the caller graph for this function:

Variable Documentation

◆ BMP_ALPHABITFIELDS

const int BMP_ALPHABITFIELDS = 4

Definition at line 71 of file qbmphandler.cpp.

Referenced by QBmpHandler::option(), QBmpHandler::read(), and read_dib_body().

◆ BMP_BITFIELDS

const int BMP_BITFIELDS = 3

◆ BMP_FILEHDR_SIZE

const int BMP_FILEHDR_SIZE = 14

Definition at line 44 of file qbmphandler.cpp.

Referenced by QBmpHandler::read(), and QBmpHandler::write().

◆ BMP_OLD

const int BMP_OLD = 12

Definition at line 61 of file qbmphandler.cpp.

Referenced by read_dib_body().

◆ BMP_OS2

const int BMP_OS2 = 64

Definition at line 63 of file qbmphandler.cpp.

Referenced by operator>>().

◆ BMP_RGB

const int BMP_RGB = 0

Definition at line 67 of file qbmphandler.cpp.

Referenced by operator>>(), qt_write_dib(), read_dib_body(), and read_dib_infoheader().

◆ BMP_RLE4

const int BMP_RLE4 = 2

Definition at line 69 of file qbmphandler.cpp.

Referenced by read_dib_body(), and read_dib_infoheader().

◆ BMP_RLE8

const int BMP_RLE8 = 1

Definition at line 68 of file qbmphandler.cpp.

Referenced by read_dib_body(), and read_dib_infoheader().

◆ BMP_WIN

const int BMP_WIN = 40

Definition at line 62 of file qbmphandler.cpp.

Referenced by operator>>(), qt_write_dib(), and QBmpHandler::write().

◆ BMP_WIN4

const int BMP_WIN4 = 108

Definition at line 64 of file qbmphandler.cpp.

Referenced by operator<<(), operator>>(), QBmpHandler::option(), and read_dib_body().

◆ BMP_WIN5

const int BMP_WIN5 = 124

Definition at line 65 of file qbmphandler.cpp.

Referenced by operator<<(), and operator>>().