By making a derived class of TQImageFormatType, which in turn creates objects that are a subclass of TQImageFormat, you can add support for more incremental image formats, allowing such formats to be sources for a QMovie or for the first frame of the image stream to be loaded as a TQImage or QPixmap.
It should decode some or all of the bytes from \fIbuffer\fR into \fIimg\fR, calling the methods of \fIconsumer\fR as the decoding proceeds to inform that consumer of changes to the image. The length of the data is given in \fIlength\fR. The consumer may be 0, in which case the function should just process the data into \fIimg\fR without telling any consumer about the changes. Note that the decoder must store enough state to be able to continue in subsequent calls to this method - this is the essence of the incremental image loading.
.PP
The function should return without processing all the data if it reaches the end of a frame in the input.
.PP
The function must return the number of bytes it has processed.