Struct xpcom::interfaces::mozIColorAnalyzer
[−]
[src]
#[repr(C)]pub struct mozIColorAnalyzer { /* fields omitted */ }
interface mozIColorAnalyzer : nsISupports
Methods
impl mozIColorAnalyzer
[src]
pub fn coerce<T: mozIColorAnalyzerCoerce>(&self) -> &T
[src]
Cast this mozIColorAnalyzer
to one of its base interfaces.
impl mozIColorAnalyzer
[src]
pub unsafe fn FindRepresentativeColor(
&self,
imageURI: *const nsIURI,
callback: *const mozIRepresentativeColorCallback
) -> nsresult
[src]
&self,
imageURI: *const nsIURI,
callback: *const mozIRepresentativeColorCallback
) -> nsresult
/**
* Given an image URI, find the most representative color for that image
* based on the frequency of each color. Preference is given to colors that
* are more interesting. Avoids the background color if it can be
* discerned. Ignores sufficiently transparent colors.
*
* This is intended to be used on favicon images. Larger images take longer
* to process, especially those with a larger number of unique colors. If
* imageURI points to an image that has more than 128^2 pixels, this method
* will fail before analyzing it for performance reasons.
*
* @param imageURI
* A URI pointing to the image - ideally a data: URI, but any scheme
* that will load when setting the src attribute of a DOM img element
* should work.
* @param callback
* Function to call when the representative color is found or an
* error occurs.
*/
void findRepresentativeColor (in nsIURI imageURI, in mozIRepresentativeColorCallback callback);
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 mozIColorAnalyzer
[src]
const IID: nsIID
IID: nsIID = nsID(3495303276, 10400, 18766, [170, 204, 158, 67, 55, 114, 177, 67])
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 mozIColorAnalyzer
[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 mozIColorAnalyzer
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.