imgIDecoder Interface Reference

imgIDecoder interface More...

import "imgIDecoder.idl";

List of all members.

decodeflags

Bits that can be passed to the decoder to affect decoding.

Meanings:

DECODER_FLAG_NONE: No flags

DECODER_FLAG_HEADERONLY: Read basic data from the image in order to set up the image container, but don't read any actual image data.



const long DECODER_FLAG_NONE = 0x0
 Closes the stream.
const long DECODER_FLAG_HEADERONLY = 0x1
 Closes the stream.
const long CLOSE_FLAG_DONTNOTIFY = 0x01
 Closes the stream.
void init (in imgIContainer aImage, in imgIDecoderObserver aObserver, in unsigned long aFlags)
 Initialize an image decoder.
void close (in PRUint32 aFlags)
 Closes the stream.
void flush ()
 Flushes the stream.
void write (in string aBuffer, in unsigned long count)
 Writes data to the decoder.

Detailed Description

imgIDecoder interface

Author:
Stuart Parmenter <pavlov@netscape.com>
Version:
0.2
See also:
imagelib2

Member Function Documentation

void imgIDecoder::close ( in PRUint32  aFlags  ) 

Closes the stream.

Parameters:
aFlags Close flags of the CLOSE_FLAG_* Variety

Resources are always freed with this call. If notifications are sent, OnStopDecode is guaranteed to be called if it hasn't been called already.

CLOSE_FLAG_DONTNOTIFY - Don't send any observer notifications, and don't call imgIContainer::decodingComplete().

void imgIDecoder::flush (  ) 

Flushes the stream.

void imgIDecoder::init ( in imgIContainer  aImage,
in imgIDecoderObserver  aObserver,
in unsigned long  aFlags 
)

Initialize an image decoder.

Parameters:
aContainer The image container to decode to.
aObserver The observer for decode notification events.
aFlags Flags for the decoder
Note:
The decoder should always pass NULL as the first two parameters to all of the imgIDecoderObserver APIs.
void imgIDecoder::write ( in string  aBuffer,
in unsigned long  count 
)

Writes data to the decoder.

For Header-Only decodes, OnStartContainer is the only notification fired. It is an error to write any more data to the decoder for header-only decodes after SetSize() has been called.

If a decoding error occurs, an internal flag is set and an error is returned. Each subsequent call to write will fail immediately for the lifetime of the decoder. Shutdown notifications of the OnStopX variety, as well as DecodingComplete(), are guaranteed not to be called if a decoding error occurs.

Parameters:
aBuffer buffer containing the data to be written
aCount the number of bytes to write

Member Data Documentation

Closes the stream.

Parameters:
aFlags Close flags of the CLOSE_FLAG_* Variety

Resources are always freed with this call. If notifications are sent, OnStopDecode is guaranteed to be called if it hasn't been called already.

CLOSE_FLAG_DONTNOTIFY - Don't send any observer notifications, and don't call imgIContainer::decodingComplete().

Closes the stream.

Parameters:
aFlags Close flags of the CLOSE_FLAG_* Variety

Resources are always freed with this call. If notifications are sent, OnStopDecode is guaranteed to be called if it hasn't been called already.

CLOSE_FLAG_DONTNOTIFY - Don't send any observer notifications, and don't call imgIContainer::decodingComplete().

Closes the stream.

Parameters:
aFlags Close flags of the CLOSE_FLAG_* Variety

Resources are always freed with this call. If notifications are sent, OnStopDecode is guaranteed to be called if it hasn't been called already.

CLOSE_FLAG_DONTNOTIFY - Don't send any observer notifications, and don't call imgIContainer::decodingComplete().


The documentation for this interface was generated from the following file: