68 mng_bool
readData(mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pRead);
69 mng_bool
writeData(mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pWritten);
70 mng_bool
processHeader(mng_uint32 iWidth, mng_uint32 iHeight);
88 mng_chunkid iChunkname,
94 qWarning(
"MNG error %d: %s; chunk %c%c%c%c; subcode %d:%d",
95 iErrorcode,zErrortext,
96 (iChunkname>>24)&0xff,
97 (iChunkname>>16)&0xff,
106 #if defined(Q_OS_WINCE) 107 mng_ptr
ptr = malloc(iSize);
108 memset(ptr, 0, iSize);
111 return (mng_ptr)
calloc(1, iSize);
115 static void myfree(mng_ptr pPtr, mng_size_t )
138 return pMydata->
readData(pBuf, iSize, pRead);
144 mng_uint32p pWritten)
147 return pMydata->
writeData(pBuf, iSize, pWritten);
190 mng_uint8 iTermaction,
196 if (iTermaction == 3)
206 qDebug(
"mng trace: iFuncnr: %d iFuncseq: %d zFuncname: %s", iFuncnr, iFuncseq, zFuncname);
214 iStyle = (QSysInfo::ByteOrder == QSysInfo::LittleEndian) ? MNG_CANVAS_BGRA8 : MNG_CANVAS_ARGB8;
230 mng_set_doprogressive(
hMNG, MNG_FALSE);
231 mng_set_suspensionmode(
hMNG, MNG_TRUE);
243 *pRead = q->device()->read((
char *)pBuf, iSize);
244 return (*pRead > 0) ? MNG_TRUE : MNG_FALSE;
250 *pWritten = q->device()->write((
char *)pBuf, iSize);
256 if (mng_set_canvasstyle(
hMNG,
iStyle) != MNG_NOERROR)
269 ret = mng_readdisplay(
hMNG);
271 ret = mng_display_resume(
hMNG);
273 if ((MNG_NOERROR == ret) || (MNG_NEEDTIMERWAIT == ret)) {
279 ret = mng_display_resume(
hMNG);
293 if (mng_create(
hMNG) != MNG_NOERROR)
297 int w = image.
width();
302 (mng_putchunk_mhdr(
hMNG, w, h, 1000, 0, 0, 0, 7) == MNG_NOERROR) &&
304 (mng_putchunk_term(
hMNG, 3, 0, 1, 0x7FFFFFFF) == MNG_NOERROR) &&
306 (mng_putchunk_ihdr(
hMNG, w, h, 8, 6, 0, 0, 0) == MNG_NOERROR) &&
309 (mng_putchunk_iend(
hMNG) == MNG_NOERROR) &&
310 (mng_putchunk_mend(
hMNG) == MNG_NOERROR) &&
311 (mng_write(
hMNG) == MNG_NOERROR)
341 if (mng_display_freeze(
hMNG) == MNG_NOERROR) {
342 if (mng_display_goframe(
hMNG, imageNumber) == MNG_NOERROR) {
362 mng_uint16 iRed = (mng_uint16)(color.
red() << 8);
363 mng_uint16 iBlue = (mng_uint16)(color.
blue() << 8);
364 mng_uint16 iGreen = (mng_uint16)(color.
green() << 8);
365 return (mng_set_bgcolor(
hMNG, iRed, iBlue, iGreen) == MNG_NOERROR);
373 if (mng_get_bgcolor(
hMNG, &iRed, &iBlue, &iGreen) == MNG_NOERROR)
374 return QColor((iRed >> 8) & 0xFF, (iGreen >> 8) & 0xFF, (iBlue >> 8) & 0xFF);
391 if ((!
d->haveReadNone
392 && (!
d->haveReadAll || (
d->haveReadAll && (
d->nextIndex <
d->frameCount))))
405 qWarning(
"QMngHandler::canRead() called with no device");
409 return device->
peek(8) ==
"\x8A\x4D\x4E\x47\x0D\x0A\x1A\x0A";
422 return canRead() ?
d->getNextImage(image) :
false;
429 return d->writeImage(image);
436 return d->currentImageNumber();
443 return d->imageCount();
450 return d->jumpToImage(imageNumber);
457 return d->jumpToNextImage();
464 if (
d->iterCount == 0x7FFFFFFF)
466 return d->iterCount-1;
473 return d->nextImageDelay();
483 return d->backgroundColor();
492 d->setBackgroundColor(qvariant_cast<QColor>(value));
The QVariant class acts like a union for the most common Qt data types.
int nextImageDelay() const
The QColor class provides colors based on RGB, HSV or CMYK values.
mng_bool writeData(mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pWritten)
void setFormat(const QByteArray &format)
Sets the format of the QImageIOHandler to format.
static mng_ptr myalloc(mng_size_t iSize)
virtual bool write(const QImage &image)
Reimplemented Function
virtual int currentImageNumber() const
Reimplemented Function
virtual bool jumpToImage(int imageNumber)
Reimplemented Function
#define QT_END_NAMESPACE
This macro expands to.
bool getNextImage(QImage *result)
virtual bool jumpToNextImage()
Reimplemented Function
void fill(uint pixel)
Fills the entire image with the given pixelValue.
The QByteArray class provides an array of bytes.
virtual bool read(QImage *image)
Reimplemented Function
ushort red
Returns the red color component of this color.
virtual int loopCount() const
Reimplemented Function
static mng_bool myopenstream(mng_handle)
virtual bool supportsOption(ImageOption option) const
Reimplemented Function
static mng_bool myrefresh(mng_handle, mng_uint32, mng_uint32, mng_uint32, mng_uint32)
QMngHandlerPrivate(QMngHandler *q_ptr)
Q_CORE_EXPORT void qDebug(const char *,...)
mng_bool processHeader(mng_uint32 iWidth, mng_uint32 iHeight)
#define QT_BEGIN_NAMESPACE
This macro expands to.
static mng_bool mywritedata(mng_handle hMNG, mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pWritten)
ImageOption
This enum describes the different options supported by QImageIOHandler.
static mng_uint32 mygettickcount(mng_handle hMNG)
virtual int nextImageDelay() const
Reimplemented Function
static mng_ptr mygetcanvasline(mng_handle hMNG, mng_uint32 iLinenr)
qint64 peek(char *data, qint64 maxlen)
Reads at most maxSize bytes from the device into data, without side effects (i.
Q_CORE_EXPORT void qWarning(const char *,...)
static mng_bool myclosestream(mng_handle hMNG)
QColor backgroundColor() const
The QImage class provides a hardware-independent image representation that allows direct access to th...
static mng_bool myreaddata(mng_handle hMNG, mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pRead)
const T * ptr(const T &t)
static mng_bool myerror(mng_handle, mng_int32 iErrorcode, mng_int8, mng_chunkid iChunkname, mng_uint32, mng_int32 iExtra1, mng_int32 iExtra2, mng_pchar zErrortext)
static mng_bool mytrace(mng_handle, mng_int32 iFuncnr, mng_int32 iFuncseq, mng_pchar zFuncname)
#define TRUE
Synonym for true.
static mng_bool mysettimer(mng_handle hMNG, mng_uint32 iMsecs)
bool setBackgroundColor(const QColor &color)
int width() const
Returns the width of the image.
#define Q_DECLARE_PUBLIC(Class)
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
ushort blue
Returns the blue color component of this color.
mng_bool readData(mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pRead)
virtual int imageCount() const
Reimplemented Function
virtual QByteArray name() const
Reimplemented Function
bool jumpToImage(int imageNumber)
bool writeImage(const QImage &image)
virtual void setOption(ImageOption option, const QVariant &value)
Reimplemented Function
QIODevice * device() const
Returns the device currently assigned to the QImageIOHandler.
virtual QVariant option(ImageOption option) const
Reimplemented Function
int height() const
Returns the height of the image.
static mng_bool myprocessheader(mng_handle hMNG, mng_uint32 iWidth, mng_uint32 iHeight)
static mng_bool myprocessterm(mng_handle hMNG, mng_uint8 iTermaction, mng_uint8, mng_uint32, mng_uint32 iItermax)
virtual bool canRead() const
Reimplemented Function
The QIODevice class is the base interface class of all I/O devices in Qt.
ushort green
Returns the green color component of this color.
static void myfree(mng_ptr pPtr, mng_size_t)
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
int currentImageNumber() const