imgIDecoder 编辑

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:55 次

字数:4135

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文