khtmlImLoad::ImageLoader

#include <imageloader.h>

Inherited by khtmlImLoad::GIFLoader, khtmlImLoad::JPEGLoader, khtmlImLoad::PNGLoader, and khtmlImLoad::QImageIOLoader.

Public Types

enum  { DefaultFrame = 0, FinalVersionID = 0xff }
 
enum  Status { Done = -2, Error = -1 }
 

Public Member Functions

virtual int processData (uchar *data, int length)=0
 
virtual int processEOF ()
 
void setImage (Image *_image)
 

Protected Member Functions

void notifyAppendFrame (int fwidth, int fheight, const ImageFormat &format)
 
void notifyImageInfo (int width, int height)
 
void notifyQImage (unsigned char version, const QImage *qimage)
 
void notifyScanline (unsigned char version, unsigned char *line)
 
void notifySingleFrameImage (int width, int height, const ImageFormat &format)
 
PixmapPlanerequestFrame0 ()
 
void requestScanline (unsigned int lineNum, unsigned char *lineBuf)
 

Protected Attributes

Imageimage
 

Detailed Description

A base class for decoders.

The decoders should inherit off this, and use the protected functions to feed their images data

Definition at line 40 of file imageloader.h.

Member Function Documentation

void khtmlImLoad::ImageLoader::notifyAppendFrame ( int  fwidth,
int  fheight,
const ImageFormat &  format 
)
inlineprotected

Call to declare frame geometry, should be called for each frame.

Definition at line 61 of file imageloader.h.

void khtmlImLoad::ImageLoader::notifyImageInfo ( int  width,
int  height 
)
inlineprotected

Call to declare canvas geometry and format.

May only be called once

Definition at line 53 of file imageloader.h.

void khtmlImLoad::ImageLoader::notifyScanline ( unsigned char  version,
unsigned char *  line 
)
inlineprotected

Call to provide a scanline, for active frame, and given "version".

The decoder must feed multiple versions of the image inside here, top-to-bottom, and incrementing versions. When it's done, it should either feed the last version with FinalVersionID, or call notifyFinished() separately.

Definition at line 81 of file imageloader.h.

void khtmlImLoad::ImageLoader::notifySingleFrameImage ( int  width,
int  height,
const ImageFormat &  format 
)
inlineprotected

wrapper for the above method for single-frame images

Definition at line 69 of file imageloader.h.

virtual int khtmlImLoad::ImageLoader::processData ( uchar *  data,
int  length 
)
pure virtual

Decodes a portion of the image, and returns the appropriate status, or the number of bytes read.

virtual int khtmlImLoad::ImageLoader::processEOF ( )
inlinevirtual

This method is called to notify the decoder that the input is done, if the decoder has not already indicated some sort of completion on the stream; this is intended mostly for non-incremental decoders.

It should return Done if all is OK. Note that the "if" above should mean that the non-incremental decoders should just return the bytes read in processData

Definition at line 140 of file imageloader.h.

PixmapPlane* khtmlImLoad::ImageLoader::requestFrame0 ( )
inlineprotected

Call this to get the first frame.

Definition at line 102 of file imageloader.h.

void khtmlImLoad::ImageLoader::requestScanline ( unsigned int  lineNum,
unsigned char *  lineBuf 
)
inlineprotected

Call this to exract the current state of a scanline to the provided bufer.

Definition at line 94 of file imageloader.h.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri May 29 2020 22:47:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.