30 mng_bool
readData(mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pRead);
31 mng_bool
writeData(mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pWritten);
32 mng_bool
processHeader(mng_uint32 iWidth, mng_uint32 iHeight);
47static mng_bool MNG_DECL
myerror(mng_handle ,
50 mng_chunkid iChunkname,
56 qWarning(
"MNG error %d: %s; chunk %c%c%c%c; subcode %d:%d",
57 iErrorcode,zErrortext,
58 (iChunkname>>24)&0xff,
59 (iChunkname>>16)&0xff,
66static mng_ptr MNG_DECL
myalloc(mng_size_t iSize)
68 return (mng_ptr)calloc(1, iSize);
71static void MNG_DECL
myfree(mng_ptr pPtr, mng_size_t )
94 return pMydata->
readData(pBuf, iSize, pRead);
100 mng_uint32p pWritten)
103 return pMydata->
writeData(pBuf, iSize, pWritten);
146 mng_uint8 iTermaction,
152 if (iTermaction == 3)
162 qDebug(
"mng trace: iFuncnr: %d iFuncseq: %d zFuncname: %s", iFuncnr, iFuncseq, zFuncname);
167 : haveReadNone(true), haveReadAll(
false),
elapsed(0), nextDelay(0), iterCount(1),
168 frameIndex(-1), nextIndex(0), frameCount(0), q_ptr(q_ptr)
186 mng_set_doprogressive(
hMNG, MNG_FALSE);
187 mng_set_suspensionmode(
hMNG, MNG_TRUE);
199 *pRead =
q->device()->read((
char *)pBuf, iSize);
200 return (*pRead > 0) ? MNG_TRUE : MNG_FALSE;
206 *pWritten =
q->device()->write((
char *)pBuf, iSize);
212 if (mng_set_canvasstyle(
hMNG,
iStyle) != MNG_NOERROR)
228 ret = mng_display_resume(
hMNG);
230 if ((MNG_NOERROR ==
ret) || (MNG_NEEDTIMERWAIT ==
ret)) {
236 ret = mng_display_resume(
hMNG);
250 if (mng_create(
hMNG) != MNG_NOERROR)
259 (mng_putchunk_mhdr(
hMNG,
w,
h, 1000, 0, 0, 0, 7) == MNG_NOERROR) &&
261 (mng_putchunk_term(
hMNG, 3, 0, 1, 0x7FFFFFFF) == MNG_NOERROR) &&
263 (mng_putchunk_ihdr(
hMNG,
w,
h, 8, 6, 0, 0, 0) == MNG_NOERROR) &&
266 (mng_putchunk_iend(
hMNG) == MNG_NOERROR) &&
267 (mng_putchunk_mend(
hMNG) == MNG_NOERROR) &&
268 (mng_write(
hMNG) == MNG_NOERROR)
298 if (mng_display_freeze(
hMNG) == MNG_NOERROR) {
299 if (mng_display_goframe(
hMNG, imageNumber) == MNG_NOERROR) {
320 mng_uint16 iRed = (mng_uint16)(
color.red() << 8);
321 mng_uint16 iBlue = (mng_uint16)(
color.blue() << 8);
322 mng_uint16 iGreen = (mng_uint16)(
color.green() << 8);
323 return (mng_set_bgcolor(
hMNG, iRed, iBlue, iGreen) == MNG_NOERROR);
331 if (mng_get_bgcolor(
hMNG, &iRed, &iBlue, &iGreen) == MNG_NOERROR)
332 return QColor((iRed >> 8) & 0xFF, (iGreen >> 8) & 0xFF, (iBlue >> 8) & 0xFF);
349 if ((!
d->haveReadNone
350 && (!
d->haveReadAll || (
d->haveReadAll && (
d->nextIndex <
d->frameCount))))
363 qWarning(
"QMngHandler::canRead() called with no device");
367 return device->
peek(8) ==
"\x8A\x4D\x4E\x47\x0D\x0A\x1A\x0A";
381 return d->writeImage(
image);
388 return d->currentImageNumber();
395 return d->imageCount();
402 return d->jumpToImage(imageNumber);
409 return d->jumpToNextImage();
416 if (
d->iterCount == 0x7FFFFFFF)
418 return d->iterCount-1;
425 return d->nextImageDelay();
435 return d->backgroundColor();
444 d->setBackgroundColor(qvariant_cast<QColor>(
value));
IOBluetoothDevice * device
The QColor class provides colors based on RGB, HSV or CMYK values.
\inmodule QtCore \reentrant
qint64 peek(char *data, qint64 maxlen)
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.
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
mng_bool processHeader(mng_uint32 iWidth, mng_uint32 iHeight)
QColor backgroundColor() const
mng_bool writeData(mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pWritten)
int nextImageDelay() const
QMngHandlerPrivate(QMngHandler *q_ptr)
mng_bool readData(mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pRead)
int currentImageNumber() const
bool setBackgroundColor(const QColor &color)
bool writeImage(const QImage &image)
bool jumpToImage(int imageNumber)
bool getNextImage(QImage *result)
int imageCount() const override
\reimp
bool supportsOption(ImageOption option) const override
\reimp
bool read(QImage *image) override
\reimp
int loopCount() const override
\reimp
bool jumpToNextImage() override
\reimp
QVariant option(ImageOption option) const override
\reimp
void setOption(ImageOption option, const QVariant &value) override
\reimp
int currentImageNumber() const override
\reimp
int nextImageDelay() const override
\reimp
bool write(const QImage &image) override
\reimp
bool canRead() const override
\reimp
bool jumpToImage(int imageNumber) override
\reimp
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static mng_bool MNG_DECL myprocessheader(mng_handle hMNG, mng_uint32 iWidth, mng_uint32 iHeight)
static mng_ptr MNG_DECL mygetcanvasline(mng_handle hMNG, mng_uint32 iLinenr)
static mng_uint32 MNG_DECL mygettickcount(mng_handle hMNG)
static mng_bool MNG_DECL myprocessterm(mng_handle hMNG, mng_uint8 iTermaction, mng_uint8, mng_uint32, mng_uint32 iItermax)
static mng_bool MNG_DECL mysettimer(mng_handle hMNG, mng_uint32 iMsecs)
static mng_bool MNG_DECL myreaddata(mng_handle hMNG, mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pRead)
static mng_ptr MNG_DECL myalloc(mng_size_t iSize)
static mng_bool MNG_DECL mywritedata(mng_handle hMNG, mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pWritten)
static mng_bool MNG_DECL myclosestream(mng_handle hMNG)
static mng_bool MNG_DECL myopenstream(mng_handle)
static mng_bool MNG_DECL myrefresh(mng_handle, mng_uint32, mng_uint32, mng_uint32, mng_uint32)
static mng_bool MNG_DECL mytrace(mng_handle, mng_int32 iFuncnr, mng_int32 iFuncseq, mng_pchar zFuncname)
static mng_bool MNG_DECL myerror(mng_handle, mng_int32 iErrorcode, mng_int8, mng_chunkid iChunkname, mng_uint32, mng_int32 iExtra1, mng_int32 iExtra2, mng_pchar zErrortext)
static void MNG_DECL myfree(mng_ptr pPtr, mng_size_t)
GLfloat GLfloat GLfloat w
[0]
GLfloat GLfloat GLfloat GLfloat h
GLdouble GLdouble GLdouble GLdouble q
static double elapsed(qint64 after, qint64 before)