26#define WBMPFIXEDHEADER_SIZE 2
34 unsigned int count = 0;
41 if (!iodev->
getChar(
reinterpret_cast<char *
>(&
c)))
60 tmp = (tmp << 8) | (
c | 0x80);
112 int bpl = (
image.width() + 7) / 8;
114 for (
int l=0; l<
h; l++) {
115 if (iodev->
write(
reinterpret_cast<const char *
>(
image.constScanLine(l)), bpl) != bpl)
127 int bpl = (
image.width() + 7) / 8;
129 for (
int l = 0; l <
h; l++) {
130 if (iodev->
read(
reinterpret_cast<char *
>(
image.scanLine(l)), bpl) != bpl)
156 memset(&hdr, 0,
sizeof(hdr));
178 if (
image.colorTable().at(0) ==
image.colorTable().at(1)) {
183 image.invertPixels();
204 if (
device->isSequential())
246 bool bCanRead =
false;
255 qWarning(
"QWbmpHandler::canRead() called with no device");
265 bool bSuccess =
false;
IOBluetoothDevice * device
\inmodule QtCore \reentrant
virtual qint64 pos() const
For random-access devices, this function returns the position that data is written to or read from.
virtual bool isSequential() const
Returns true if this device is sequential; otherwise returns false.
bool putChar(char c)
Writes the character c to the device.
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
bool getChar(char *c)
Reads one character from the device and stores it in c.
virtual bool seek(qint64 pos)
For random-access devices, this function sets the current position to pos, returning true on success,...
qint64 read(char *data, qint64 maxlen)
Reads at most maxSize bytes from the device into data, and returns the number of bytes read.
ImageOption
This enum describes the different options supported by QImageIOHandler.
static bool allocateImage(QSize size, QImage::Format format, QImage *image)
QIODevice * device() const
Returns the device currently assigned to the QImageIOHandler.
void setFormat(const QByteArray &format)
Sets the format of the QImageIOHandler to format.
bool canRead() const override
Verifies if some values (magic bytes) are set as expected in the header of the file.
QVariant option(ImageOption option) const override
Only Size option is supported.
~QWbmpHandler()
Destructor for QWbmpHandler.
QWbmpHandler(QIODevice *device)
Constructs an instance of QWbmpHandler initialized to use device.
bool supportsOption(ImageOption option) const override
Returns true if the QImageIOHandler supports the option option; otherwise returns false.
bool write(const QImage &image) override
\reimp
bool read(QImage *image) override
\reimp
bool writeImage(QImage image)
WBMPReader(QIODevice *iodevice)
static bool canRead(QIODevice *iodevice)
Combined button and popup list for selecting options.
GLenum GLenum GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei imageSize
GLfloat GLfloat GLfloat GLfloat h
constexpr int qGray(int r, int g, int b)
unsigned long long quint64
static bool writeWBMPData(QIODevice *iodev, const QImage &image)
static bool writeWBMPHeader(QIODevice *iodev, const WBMPHeader &hdr)
static bool writeMultiByteInt(QIODevice *iodev, quint32 num)
#define WBMPFIXEDHEADER_SIZE
static bool readMultiByteInt(QIODevice *iodev, quint32 *num)
static bool readWBMPHeader(QIODevice *iodev, WBMPHeader *hdr)
static bool readWBMPData(QIODevice *iodev, QImage &image)