Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qbmphandler.cpp File Reference
#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.

References BMP_FILEHDR::bfOffBits, BMP_FILEHDR::bfReserved1, BMP_FILEHDR::bfReserved2, BMP_FILEHDR::bfSize, BMP_FILEHDR::bfType, and QDataStream::writeRawData().

+ Here is the call graph for this function:

◆ operator<<() [2/2]

◆ operator>>() [1/2]

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

Definition at line 46 of file qbmphandler.cpp.

References BMP_FILEHDR::bfOffBits, BMP_FILEHDR::bfReserved1, BMP_FILEHDR::bfReserved2, BMP_FILEHDR::bfSize, BMP_FILEHDR::bfType, and QDataStream::readRawData().

+ Here is the call graph for this function:

◆ operator>>() [2/2]

◆ 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::biBitCount, BMP_INFOHDR::biClrImportant, BMP_INFOHDR::biClrUsed, BMP_INFOHDR::biCompression, BMP_INFOHDR::biHeight, BMP_INFOHDR::biPlanes, BMP_INFOHDR::biSize, BMP_INFOHDR::biSizeImage, BMP_INFOHDR::biWidth, BMP_INFOHDR::biXPelsPerMeter, BMP_INFOHDR::biYPelsPerMeter, BMP_RGB, BMP_WIN, d, i, QDataStream::Ok, 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

◆ read_dib_fileheader()

static bool read_dib_fileheader ( QDataStream s,
BMP_FILEHDR bf 
)
static

Definition at line 174 of file qbmphandler.cpp.

References BMP_FILEHDR::bfType, QDataStream::Ok, and 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_INFOHDR::biBitCount, BMP_INFOHDR::biCompression, BMP_INFOHDR::biHeight, BMP_INFOHDR::biPlanes, BMP_INFOHDR::biWidth, BMP_BITFIELDS, BMP_RGB, BMP_RLE4, BMP_RLE8, QDataStream::Ok, 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>>().