Struct xpcom::interfaces::imgIContainer
[−]
[src]
#[repr(C)]pub struct imgIContainer { /* fields omitted */ }
interface imgIContainer : nsISupports
/**
* 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.
*/
Methods
impl imgIContainer
[src]
pub fn coerce<T: imgIContainerCoerce>(&self) -> &T
[src]
Cast this imgIContainer
to one of its base interfaces.
impl imgIContainer
[src]
pub const TYPE_RASTER: i64
TYPE_RASTER: i64 = 0
/**
* Enumerated values for the 'type' attribute (below).
*/
pub const TYPE_VECTOR: i64
TYPE_VECTOR: i64 = 1
pub const FLAG_NONE: i64
FLAG_NONE: i64 = 0
/**
* Flags for imgIContainer operations.
*
* Meanings:
*
* FLAG_NONE: Lack of flags.
*
* FLAG_SYNC_DECODE: Forces synchronous/non-progressive decode of all
* available data before the call returns.
*
* FLAG_SYNC_DECODE_IF_FAST: Like FLAG_SYNC_DECODE, but requests a sync decode
* be performed only if ImageLib estimates it can be completed very quickly.
*
* FLAG_ASYNC_NOTIFY: Send notifications asynchronously, even if we decode
* synchronously beause of FLAG_SYNC_DECODE or FLAG_SYNC_DECODE_IF_FAST.
*
* FLAG_DECODE_NO_PREMULTIPLY_ALPHA: Do not premultiply alpha if
* it's not already premultiplied in the image data.
*
* FLAG_DECODE_NO_COLORSPACE_CONVERSION: Do not do any colorspace conversion;
* ignore any embedded profiles, and don't convert to any particular
* destination space.
*
* FLAG_CLAMP: Extend the image to the fill area by clamping image sample
* coordinates instead of by tiling. This only affects 'draw'.
*
* FLAG_HIGH_QUALITY_SCALING: A hint as to whether this image should be
* scaled using the high quality scaler. Do not set this if not drawing to
* a window or not listening to invalidations. Passing this flag will do two
* things: 1) request a decode of the image at the size asked for by the
* caller if one isn't already started or complete, and 2) allows a decoded
* frame of any size (it could be neither the requested size, nor the
* intrinsic size) to be substituted.
*
* FLAG_WANT_DATA_SURFACE: Can be passed to GetFrame when the caller wants a
* DataSourceSurface instead of a hardware accelerated surface. This can be
* important for performance (by avoiding an upload to/readback from the GPU)
* when the caller knows they want a SourceSurface of type DATA.
*
* FLAG_BYPASS_SURFACE_CACHE: Forces drawing to happen rather than taking
* cached rendering from the surface cache. This is used when we are printing,
* for example, where we want the vector commands from VectorImages to end up
* in the PDF output rather than a cached rendering at screen resolution.
*
* FLAG_FORCE_PRESERVEASPECTRATIO_NONE: Force scaling this image
* non-uniformly if necessary. This flag is for vector image only. A raster
* image should ignore this flag. While drawing a vector image with this
* flag, do not force uniform scaling even if its root <svg> node has a
* preserveAspectRatio attribute that would otherwise require uniform
* scaling , such as xMinYMin/ xMidYMin. Always scale the graphic content of
* the given image non-uniformly if necessary such that the image's
* viewBox (if specified or implied by height/width attributes) exactly
* matches the viewport rectangle.
*
* FLAG_FORCE_UNIFORM_SCALING: Signal to ClippedImage::OptimalSizeForDest that
* its returned size can only scale the image's size *uniformly* (by the same
* factor in each dimension). We need this flag when painting border-image
* section with SVG image source-data, if the SVG image has no viewBox and no
* intrinsic size. In such a case, we synthesize a viewport for the SVG image
* (a "window into SVG space") based on the border image area, and we need to
* be sure we don't subsequently scale that viewport in a way that distorts
* its contents by stretching them more in one dimension than the other.
*/
pub const FLAG_SYNC_DECODE: i64
FLAG_SYNC_DECODE: i64 = 1
pub const FLAG_SYNC_DECODE_IF_FAST: i64
FLAG_SYNC_DECODE_IF_FAST: i64 = 2
pub const FLAG_ASYNC_NOTIFY: i64
FLAG_ASYNC_NOTIFY: i64 = 4
pub const FLAG_DECODE_NO_PREMULTIPLY_ALPHA: i64
FLAG_DECODE_NO_PREMULTIPLY_ALPHA: i64 = 8
pub const FLAG_DECODE_NO_COLORSPACE_CONVERSION: i64
FLAG_DECODE_NO_COLORSPACE_CONVERSION: i64 = 16
pub const FLAG_CLAMP: i64
FLAG_CLAMP: i64 = 32
pub const FLAG_HIGH_QUALITY_SCALING: i64
FLAG_HIGH_QUALITY_SCALING: i64 = 64
pub const FLAG_WANT_DATA_SURFACE: i64
FLAG_WANT_DATA_SURFACE: i64 = 128
pub const FLAG_BYPASS_SURFACE_CACHE: i64
FLAG_BYPASS_SURFACE_CACHE: i64 = 256
pub const FLAG_FORCE_PRESERVEASPECTRATIO_NONE: i64
FLAG_FORCE_PRESERVEASPECTRATIO_NONE: i64 = 512
pub const FLAG_FORCE_UNIFORM_SCALING: i64
FLAG_FORCE_UNIFORM_SCALING: i64 = 1024
pub const DECODE_FLAGS_DEFAULT: i64
DECODE_FLAGS_DEFAULT: i64 = 0
/**
* A constant specifying the default set of decode flags (i.e., the default
* values for FLAG_DECODE_*).
*/
pub const FRAME_FIRST: i64
FRAME_FIRST: i64 = 0
/**
* Constants for specifying various "special" frames.
*
* FRAME_FIRST: The first frame
* FRAME_CURRENT: The current frame
*
* FRAME_MAX_VALUE should be set to the value of the maximum constant above,
* as it is used for ensuring that a valid value was passed in.
*/
pub const FRAME_CURRENT: i64
FRAME_CURRENT: i64 = 1
pub const FRAME_MAX_VALUE: i64
FRAME_MAX_VALUE: i64 = 1
pub const kNormalAnimMode: i64
kNormalAnimMode: i64 = 0
/**
* Animation mode Constants
* 0 = normal
* 1 = don't animate
* 2 = loop once
*/
pub const kDontAnimMode: i64
kDontAnimMode: i64 = 1
pub const kLoopOnceAnimMode: i64
kLoopOnceAnimMode: i64 = 2
pub unsafe fn GetWidth(&self, aWidth: *mut int32_t) -> nsresult
[src]
/**
* The width of the container rectangle. In the case of any error,
* zero is returned, and an exception will be thrown.
*/
readonly attribute int32_t width;
pub unsafe fn GetHeight(&self, aHeight: *mut int32_t) -> nsresult
[src]
/**
* The height of the container rectangle. In the case of any error,
* zero is returned, and an exception will be thrown.
*/
readonly attribute int32_t height;
pub unsafe fn GetType(&self) -> uint16_t
[src]
/**
* The type of this image (one of the TYPE_* values above).
*/
[infallible] readonly attribute unsigned short type;
pub unsafe fn GetAnimated(&self, aAnimated: *mut bool) -> nsresult
[src]
/**
* Whether this image is animated. You can only be guaranteed that querying
* this will not throw if STATUS_DECODE_COMPLETE is set on the imgIRequest.
*
* @throws NS_ERROR_NOT_AVAILABLE if the animated state cannot be determined.
*/
readonly attribute boolean animated;
pub unsafe fn WillDrawOpaqueNow(&self) -> bool
[src]
/**
* Returns true if this image will draw opaquely right now if asked to draw
* with FLAG_HIGH_QUALITY_SCALING and otherwise default flags. If this image
* (when decoded) is opaque but no decoded frames are available then
* willDrawOpaqueNow will return false.
*/
[noscript,notxpcom] boolean willDrawOpaqueNow ();
pub unsafe fn StartDecoding(&self, aFlags: uint32_t) -> nsresult
[src]
[noscript] void startDecoding (in uint32_t aFlags);
pub unsafe fn StartDecodingWithResult(&self, aFlags: uint32_t) -> bool
[src]
[noscript,notxpcom] boolean startDecodingWithResult (in uint32_t aFlags);
pub unsafe fn LockImage(&self) -> nsresult
[src]
/**
* 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.
*/
void lockImage ();
pub unsafe fn UnlockImage(&self) -> nsresult
[src]
/**
* 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.
*/
void unlockImage ();
pub unsafe fn RequestDiscard(&self) -> nsresult
[src]
/**
* If this image is unlocked, discard its decoded data. If the image is
* locked or has already been discarded, do nothing.
*/
void requestDiscard ();
pub unsafe fn GetAnimationMode(&self, aAnimationMode: *mut uint16_t) -> nsresult
[src]
attribute unsigned short animationMode;
pub unsafe fn SetAnimationMode(&self, aAnimationMode: uint16_t) -> nsresult
[src]
attribute unsigned short animationMode;
pub unsafe fn ResetAnimation(&self) -> nsresult
[src]
void resetAnimation ();
pub unsafe fn GetFrameIndex(&self, aWhichFrame: uint32_t) -> c_float
[src]
[notxpcom] float getFrameIndex (in uint32_t aWhichFrame);
pub unsafe fn GetFirstFrameDelay(&self) -> int32_t
[src]
[notxpcom] int32_t getFirstFrameDelay ();
Methods from Deref<Target = nsISupports>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for imgIContainer
[src]
const IID: nsIID
IID: nsIID = nsID(2832985636, 65414, 18261, [180, 14, 81, 23, 92, 175, 49, 175])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for imgIContainer
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for imgIContainer
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.