modules/libpr0n/public/imgIDecoder.idlScriptable
Base class for a decoder that reads an image from an input stream and sends it to an imgILoader object.
Inherits from: nsISupports Last changed in Gecko 1.7

This interface is the base class for decoders for specific image formats.

Method overview

void close();
void flush();
void init(in imgILoad aLoad);
unsigned long writeFrom(in nsIInputStream inStr, in unsigned long count);

Methods

close()

Closes the stream.

void close();
Parameters

None.

flush()

Flushes the stream.

void flush();
Parameters

None.

init()

Initializes an image decoder.

void init(
  in imgILoad aLoad
);
Parameters
aLoad
An imgILoad object to receive the decoded image data. This object also implements the imgIDecoderObserver interface; you should QueryInterface() it to that interface and call its notification methods while handling the decode operation. You should always pass null as the first two parameters of the notification APIs.

writeFrom()

Writes data into the stream from an input stream.

Implementer's note: This method is defined by this interface in order to let the output stream efficiently copy the data from the input stream into its internal buffer (if any). If this method was provided as an external facility, a separate char * buffer would need to be used in order to call the output stream's other write() method.
unsigned long writeFrom(
  in nsIInputStream inStr,
  in unsigned long count
);
Parameters
inStr
The stream from which to read the encoded image data.
count
The maximum number of bytes to write to the image.
Return value

The number of bytes actually written to the image, or undefined if an error occurred.

See also