decodeImage
Caller provides an input stream and mimetype. We read from the stream
and decompress it (according to the specified mime type) and return
the resulting imgIContainer.
aStream | An input stream for an encoded image file. |
aMimeType | Type of image in the stream. |
decodeImageData
Caller provides an input stream and mimetype. We read from the stream
and decompress it (according to the specified mime type) and return
the resulting imgIContainer.
This method is deprecated and will be removed at some time in the future;
new code should use |decodeImage|.
aStream | An input stream for an encoded image file. |
aMimeType | Type of image in the stream. |
aContainer | An imgIContainer holding the decoded image will be returned via this parameter. It is an error to provide any initial value but |null|. |
encodeImage
Caller provides an image container, and the mime type it should be
encoded to. We return an input stream for the encoded image data.
aContainer | An image container. |
aMimeType | Type of encoded image desired (eg "image/png"). |
outputOptions | Encoder-specific output options. |
encodeScaledImage
Caller provides an image container, and the mime type it should be
encoded to. We return an input stream for the encoded image data.
The encoded image is scaled to the specified dimensions.
aContainer | An image container. |
aMimeType | Type of encoded image desired (eg "image/png"). |
aWidth, | aHeight The size (in pixels) desired for the resulting image. Specify 0 to use the given image's width or height. Values must be >= 0. |
outputOptions | Encoder-specific output options. |
getImgLoaderForDocument
Retrieve an image loader that reflects the privacy status of the given
document.
doc | A document. Must not be null. |
getImgLoaderForDocument
Retrieve an image cache that reflects the privacy status of the given
document.
doc | A document. Null is allowed, but must _only_ be passed when there is no way to obtain a relevant document for the current context in which a cache is desired. |
encodeCroppedImage
Caller provides an image container, and the mime type it should be
encoded to. We return an input stream for the encoded image data.
The encoded image is cropped to the specified dimensions.
The given offset and size must not exceed the image bounds.
aContainer | An image container. |
aMimeType | Type of encoded image desired (eg "image/png"). |
aOffsetX, | aOffsetY The crop offset (in pixels). Values must be >= 0. |
aWidth, | aHeight The size (in pixels) desired for the resulting image. Specify 0 to use the given image's width or height. Values must be >= 0. |
outputOptions | Encoder-specific output options. |
Create a wrapper around a scripted notification observer (ordinarily
imgINotificationObserver cannot be implemented from scripts).
aObserver | The scripted observer to wrap |