Interface imgIToolsType

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Create a wrapper around a scripted notification observer (ordinarily imgINotificationObserver cannot be implemented from scripts).

    Parameters

    • aObserver: imgIScriptedNotificationObserver

      The scripted observer to wrap

    Returns imgINotificationObserver

  • decodeImageAsync See decodeImage. The main difference between this method and decodeImage is that here the operation is done async on a thread from the decode pool. When the operation is completed, the callback is executed with the result.

    Parameters

    • aStream: nsIInputStream

      An input stream for an encoded image file.

    • aMimeType: string

      Type of image in the stream.

    • aCallback: imgIContainerCallback

      The callback is executed when the imgContainer is fully created.

    • aEventTarget: nsIEventTarget

      This eventTarget is used to execute aCallback

    Returns void

  • decodeImageFromArrayBuffer Caller provides an ArrayBuffer and a mimetype. We read from the stream and decompress it (according to the specified mime type) and return the resulting imgIContainer.

    Parameters

    • aArrayBuffer: any

      An ArrayBuffer.

    • aMimeType: string

      Type of image in the stream.

    Returns imgIContainer

  • decodeImageFromBuffer Caller provides an buffer, a buffer size and a mimetype. We read from the stream and decompress it (according to the specified mime type) and return the resulting imgIContainer.

    Parameters

    • aBuffer: string

      Data in memory.

    • aSize: number

      Buffer size.

    • aMimeType: string

      Type of image in the stream.

    Returns imgIContainer

  • decodeImageFromChannelAsync See decodeImage. The main difference between this method and decodeImage is that here the operation is done async on a thread from the decode pool. When the operation is completed, the callback is executed with the result.

    Parameters

    • aURI: nsIURI

      The original URI of the image

    • aChannel: nsIChannel

      Channel to the image to be decoded.

    • aCallback: imgIContainerCallback

      The callback is executed when the imgContainer is fully created.

    • aObserver: imgINotificationObserver

      Optional observer for the decoded image, the caller should make sure the observer is kept alive as long as necessary, as ImageLib does not keep a strong reference to the observer.

    Returns void

  • 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.

    Parameters

    • aContainer: imgIContainer

      An image container.

    • aMimeType: string

      Type of encoded image desired (eg "image/png").

    • aOffsetX: number
    • aOffsetY: number
    • aWidth: number
    • aHeight: number
    • outputOptions: string

      Encoder-specific output options.

    Returns nsIInputStream

  • 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.

    Parameters

    • aContainer: imgIContainer

      An image container.

    • aMimeType: string

      Type of encoded image desired (eg "image/png").

    • outputOptions: string

      Encoder-specific output options.

    Returns nsIInputStream

  • 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.

    Parameters

    • aContainer: imgIContainer

      An image container.

    • aMimeType: string

      Type of encoded image desired (eg "image/png").

    • aWidth: number
    • aHeight: number
    • outputOptions: string

      Encoder-specific output options.

    Returns nsIInputStream

  • getImgLoaderForDocument Retrieve an image cache that reflects the privacy status of the given document.

    Parameters

    • doc: Document

      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.

    Returns imgICache

  • getImgLoaderForDocument Retrieve an image loader that reflects the privacy status of the given document.

    Parameters

    • doc: Document

      A document. Must not be null.

    Returns imgILoader

Generated using TypeDoc