Readonly
animatedWhether this image is animated. You can only be guaranteed that querying this will not throw if STATUS_DECODE_COMPLETE is set on the imgIRequest.
NS_ERROR_NOT_AVAILABLE if the animated state cannot be determined.
Readonly
heightThe height of the container rectangle. In the case of any error, zero is returned, and an exception will be thrown.
Readonly
hotspotXThe x coordinate of the image's hotspot, or 0 if there is no hotspot.
Readonly
hotspotYThe y coordinate of the image's hotspot, or 0 if there is no hotspot.
Readonly
intrinsicThe (dimensionless) intrinsic ratio of this image. In the case of any error, Nothing() will be returned.
Readonly
intrinsicThe intrinsic size of this image in appunits. If the image has no intrinsic size in a dimension, -1 will be returned for that dimension. In the case of any error, an exception will be thrown.
Readonly
providerProvider ID for image providers created by this image.
Readonly
typeThe type of this image (one of the TYPE_* values above).
Readonly
widthThe width of the container rectangle. In the case of any error, zero is returned, and an exception will be thrown.
Optional
aInstancePtr: objectA run time mechanism for interface discovery.
NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.
aInstancePtr must not be null.
[in] A requested interface IID
[out] A pointer to an interface pointer to receive the result.
Draw the requested frame of this image onto the context specified.
Drawing an image involves scaling it to a certain size (which may be implemented as a "smart" scale by substituting an HQ-scaled frame or rendering at a high DPI), and then selecting a region of that image to draw. That region is drawn onto the graphics context and in the process transformed by the context matrix, which determines the final area that is filled. The basic process looks like this:
+------------------+
| Image |
| |
| intrinsic width |
| X |
| intrinsic height |
+------------------+
/
/
/ (scale to aSize)
/
+----------------------------+
| |
| Scaled Image |
| aSize.width X aSize.height |
| |
| +---------+ |
| | aRegion | |
| +---------+ |
+-------(---------(----------+
| |
/
| (transform |
/ by aContext
| matrix) |
/
+---------------------+
| |
| Fill Rect |
| |
+---------------------+
The region may extend outside of the scaled image's boundaries. It's actually a region in tiled image space, which is formed by tiling the scaled image infinitely in every direction. Drawing with a region larger than the scaled image thus causes the filled area to contain multiple tiled copies of the image, which looks like this:
....................................................
: : : :
: Tile : Tile : Tile :
: +------------[aRegion]------------+ :
:........|.......:................:........|.......:
: | : : | :
: Ti|le : Scaled Image : Ti|le :
: | : : | :
:........|.......:................:........|.......:
: +---------------------------------+ :
: Ti|le : Tile : Ti|le :
: / : : \ :
:......(.........:................:..........).....:
| |
/
| (transform by aContext matrix) |
/
+---------------------------------------------+
| : : |
|.....:.................................:.....|
| : : |
| : Tiled Fill : |
| : : |
|.....:.................................:.....|
| : : |
+---------------------------------------------+
A ImgDrawResult value indicating whether and to what degree the drawing operation was successful.
The Thebes context to draw the image to.
The size to which the image should be scaled before drawing. This requirement may be satisfied using HQ scaled frames, selecting from different resolution layers, drawing at a higher DPI, or just performing additional scaling on the graphics context. Callers can use optimalImageSizeForDest() to determine the best choice for this parameter if they have no special size requirements.
The region in tiled image space which will be drawn onto the graphics context. aRegion is in the coordinate space of the image after it has been scaled to aSize - that is, the image is scaled first, and then aRegion is applied. When aFlags includes FLAG_CLAMP, the image will be extended to this area by clamping image sample coordinates. Otherwise, the image will be automatically tiled as necessary. aRegion can also optionally contain a second region which restricts the set of pixels we're allowed to sample from when drawing; this is only of use to callers which need to draw with pixel snapping.
Frame specifier of the FRAME_* variety.
The filter to be used if we're scaling the image.
If specified, SVG-related rendering context, such as overridden attributes on the image document's root
Flags of the FLAG_* variety
Returns the delay, in ms, between the first and second frame. If this returns 0, there is no delay between first and second frame (i.e., this image could render differently whenever it draws).
If this image is not animated, or not known to be animated (see attribute animated), returns -1.
Get a surface for the given frame. This may be a platform-native, optimized surface, so you cannot inspect its pixel data. If you need that, use SourceSurface::GetDataSurface.
Frame specifier of the FRAME_* variety.
Flags of the FLAG_* variety
Get a surface for the given frame at the specified size. Matching the requested size is best effort; it's not guaranteed that the surface you get will be a perfect match. (Some reasons you may get a surface of a different size include: if you requested upscaling, if downscale-during-decode is disabled, or if you didn't request the first frame.)
The desired size.
Frame specifier of the FRAME_* variety.
Flags of the FLAG_* variety
Returns an index for the requested animation frame (either FRAME_FIRST or FRAME_CURRENT).
The units of the index aren't specified, and may vary between different types of images. What you can rely on is that on all occasions when getFrameIndex(FRAME_CURRENT) returns a certain value, draw(..FRAME_CURRENT..) will draw the same frame. The same holds for FRAME_FIRST as well.
Frame specifier of the FRAME_* variety.
Attempts to find a WebRenderImageProvider containing the current frame at the given size. Match the requested size is best effort; it's not guaranteed that the surface you get will be a perfect match. (Some reasons you may get a surface of a different size include: if you requested upscaling, or if downscale-during-decode is disabled.)
The draw result for the current frame.
The WindowRenderer which will be used to render the ImageContainer.
If specified, SVG-related rendering context, such as overridden attributes on the image document's root
Decoding / drawing flags (in other words, FLAG_* flags). Currently only FLAG_SYNC_DECODE and FLAG_SYNC_DECODE_IF_FAST are supported.
Return value for WebRenderImageProvider for the current frame. May be null depending on the draw result.
Given an invalidation rect in the coordinate system used by the decoder, returns an invalidation rect in image space.
This is the identity transformation in most cases, but the result can differ if the image is wrapped by an ImageWrapper that changes its size or orientation.
Increments the lock count on the image. An image will not be discarded as long as the lock count is nonzero. Note that it is still possible for the image to be undecoded if decode-on-draw is enabled and the image was never drawn.
Upon instantiation images have a lock count of zero.
Called when media feature values that apply to all documents (such as those based on system metrics) have changed. If this image is a type that can respond to media queries (i.e., an SVG image), this function is overridden to handle restyling and invalidating the image.
Given a size at which this image will be displayed, and the drawing parameters affecting how it will be drawn, returns the image size which should be used to draw to produce the highest quality result. This is the appropriate size, for example, to use as an input to the pixel snapping algorithm.
For best results the size returned by this method should not be cached. It can change over time due to changes in the internal state of the image.
The size of the destination rect into which this image will be drawn, in device pixels.
Frame specifier of the FRAME_* variety.
The filter to be used if we're scaling the image.
Flags of the FLAG_* variety
This method triggers decoding for an image, but unlike startDecoding() it enables the caller to provide more detailed information about the decode request.
The size to which the image should be scaled while decoding, if possible. If the image cannot be scaled to this size while being decoded, it will be decoded at its intrinsic size.
Flags of the FLAG_* variety.
Frame specifier of the FRAME_* variety.
If this is an animated image that hasn't started animating already, this sets the animation's start time to the indicated time.
This has no effect if the image isn't animated or it has started animating already; it also has no effect if the image format doesn't care about animation start time.
In all cases, animation does not actually begin until startAnimation(), resetAnimation(), or requestRefresh() is called for the first time.
Ensures that an image is decoding. Calling this function guarantees that the image will at some point fire off decode notifications. Images that can be decoded "quickly" according to some heuristic will be decoded synchronously.
Flags of the FLAG_* variety. Only FLAG_ASYNC_NOTIFY is accepted; all others are ignored.
Frame specifier of the FRAME_* variety.
Exactly like startDecoding above except returns whether the current frame of the image is complete or not.
Flags of the FLAG_* variety. Only FLAG_ASYNC_NOTIFY is accepted; all others are ignored.
Frame specifier of the FRAME_* variety.
Decreases the lock count on the image. If the lock count drops to zero, the image is allowed to discard its frame data to save memory.
Upon instantiation images have a lock count of zero. It is an error to call this method without first having made a matching lockImage() call. In other words, the lock count is not allowed to be negative.
Generated using TypeDoc
imgIContainer is the interface that represents an image. It allows access to frames as Thebes surfaces. It also allows drawing of images onto Thebes contexts.
Internally, imgIContainer also manages animation of images.